Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.learn.tensorflow
Commits
112bd95b
Commit
112bd95b
authored
Dec 06, 2016
by
Tiago de Freitas Pereira
Browse files
Compatibility to python 2.5
parent
5de07640
Pipeline
#5739
canceled with stages
in 2 minutes and 51 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bob/learn/tensorflow/layers/FullyConnected.py
View file @
112bd95b
...
...
@@ -67,7 +67,7 @@ class FullyConnected(Layer):
def
create_variables
(
self
,
input_layer
):
self
.
input_layer
=
input_layer
if
self
.
W
is
None
:
input_dim
=
reduce
(
mul
,
self
.
input_layer
.
get_shape
().
as_list
()[
1
:])
input_dim
=
numpy
.
prod
(
self
.
input_layer
.
get_shape
().
as_list
()[
1
:])
if
self
.
init_value
is
None
:
self
.
init_value
=
input_dim
...
...
bob/learn/tensorflow/loss/__init__.py
View file @
112bd95b
from
.BaseLoss
import
BaseLoss
from
.ContrastiveLoss
import
ContrastiveLoss
from
.TripletLoss
import
TripletLoss
from
NegLogLoss
import
NegLogLoss
from
.
NegLogLoss
import
NegLogLoss
# gets sphinx autodoc done right - don't remove it
...
...
bob/learn/tensorflow/network/SequenceNetwork.py
View file @
112bd95b
...
...
@@ -317,14 +317,14 @@ class SequenceNetwork(six.with_metaclass(abc.ABCMeta, object)):
session
=
Session
.
instance
().
session
open
(
path
+
"_sequence_net.pickle"
,
'w'
).
write
(
self
.
pickle_architecture
)
open
(
path
+
"_sequence_net.pickle"
,
'w
b
'
).
write
(
self
.
pickle_architecture
)
return
saver
.
save
(
session
,
path
)
def
load
(
self
,
path
,
clear_devices
=
False
,
session_from_scratch
=
False
):
session
=
Session
.
instance
(
new
=
session_from_scratch
).
session
self
.
sequence_net
=
pickle
.
loads
(
open
(
path
+
"_sequence_net.pickle"
).
read
())
self
.
sequence_net
=
pickle
.
loads
(
open
(
path
+
"_sequence_net.pickle"
,
'rb'
).
read
())
if
clear_devices
:
saver
=
tf
.
train
.
import_meta_graph
(
path
+
".meta"
,
clear_devices
=
clear_devices
)
else
:
...
...
bob/learn/tensorflow/network/__init__.py
View file @
112bd95b
...
...
@@ -8,7 +8,7 @@ from .FaceNet import FaceNet
from
.FaceNetSimple
import
FaceNetSimple
from
.VGG16
import
VGG16
from
.VGG16_mod
import
VGG16_mod
from
SimpleAudio
import
SimpleAudio
from
.
SimpleAudio
import
SimpleAudio
# gets sphinx autodoc done right - don't remove it
def
__appropriate__
(
*
args
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment