Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.learn.tensorflow
Commits
f02aaff2
Commit
f02aaff2
authored
Sep 09, 2020
by
Amir MOHAMMADI
Browse files
make sure all architectures output logits
parent
5718c4e0
Changes
6
Hide whitespace changes
Inline
Side-by-side
bob/learn/tensorflow/models/alexnet.py
View file @
f02aaff2
...
...
@@ -52,7 +52,7 @@ def AlexNet_simplified(name="AlexNet", **kwargs):
tf
.
keras
.
layers
.
Dense
(
units
=
4096
,
activation
=
"relu"
,
name
=
"F6"
),
tf
.
keras
.
layers
.
Dropout
(
rate
=
0.5
,
name
=
"D7"
),
tf
.
keras
.
layers
.
Dense
(
units
=
4096
,
activation
=
"relu"
,
name
=
"F7"
),
tf
.
keras
.
layers
.
Dense
(
units
=
1000
,
activation
=
"softmax"
,
name
=
"OUTPUT"
),
tf
.
keras
.
layers
.
Dense
(
units
=
1000
,
name
=
"OUTPUT"
),
],
name
=
name
,
**
kwargs
...
...
bob/learn/tensorflow/models/densenet.py
View file @
f02aaff2
...
...
@@ -434,15 +434,14 @@ class DeepPixBiS(tf.keras.Model):
tf
.
keras
.
layers
.
Flatten
(
data_format
=
data_format
,
name
=
"Pixel_Logits_Flatten"
),
tf
.
keras
.
layers
.
Activation
(
"sigmoid"
,
name
=
"activation"
),
]
def
call
(
self
,
x
,
training
=
None
):
for
l
in
self
.
sequential_layers
:
for
l
ayer
in
self
.
sequential_layers
:
try
:
x
=
l
(
x
,
training
=
training
)
x
=
l
ayer
(
x
,
training
=
training
)
except
TypeError
:
x
=
l
(
x
)
x
=
l
ayer
(
x
)
return
x
...
...
bob/learn/tensorflow/models/inception.py
View file @
f02aaff2
...
...
@@ -132,7 +132,7 @@ def GoogLeNet(*, num_classes=1000, name="GoogLeNet", **kwargs):
InceptionModule
(
384
,
192
,
384
,
48
,
128
,
128
,
name
=
"inception_5b"
),
tf
.
keras
.
layers
.
GlobalAvgPool2D
(
name
=
"pool5"
),
tf
.
keras
.
layers
.
Dropout
(
rate
=
0.4
,
name
=
"dropout"
),
tf
.
keras
.
layers
.
Dense
(
num_classes
,
name
=
"output"
,
activation
=
"softmax"
),
tf
.
keras
.
layers
.
Dense
(
num_classes
,
name
=
"output"
),
],
name
=
name
,
**
kwargs
...
...
bob/learn/tensorflow/models/inception_resnet_v2.py
View file @
f02aaff2
...
...
@@ -542,7 +542,7 @@ def InceptionResNetV2(
if
include_top
:
# Classification block
x
=
GlobalAvgPool2D
(
name
=
"avg_pool"
)(
x
)
x
=
Dense
(
classes
,
activation
=
"softmax"
,
name
=
"predictions"
)(
x
)
x
=
Dense
(
classes
,
name
=
"predictions"
)(
x
)
else
:
if
pooling
==
"avg"
:
x
=
GlobalAvgPool2D
()(
x
)
...
...
bob/learn/tensorflow/models/lenet5.py
View file @
f02aaff2
...
...
@@ -22,7 +22,7 @@ def LeNet5_simplified(name="LeNet5", **kwargs):
),
tf
.
keras
.
layers
.
Flatten
(
name
=
"FLATTEN"
),
tf
.
keras
.
layers
.
Dense
(
units
=
84
,
activation
=
"tanh"
,
name
=
"F6"
),
tf
.
keras
.
layers
.
Dense
(
units
=
10
,
activation
=
"sigmoid"
,
name
=
"OUTPUT"
),
tf
.
keras
.
layers
.
Dense
(
units
=
10
,
name
=
"OUTPUT"
),
],
name
=
name
,
**
kwargs
...
...
bob/learn/tensorflow/models/mcae.py
View file @
f02aaff2
...
...
@@ -51,8 +51,8 @@ class ConvEncoder(tf.keras.Model):
self
.
sequential_layers
=
layers
def
call
(
self
,
x
,
training
=
None
):
for
l
in
self
.
sequential_layers
:
x
=
l
(
x
)
for
l
ayer
in
self
.
sequential_layers
:
x
=
l
ayer
(
x
)
return
x
...
...
@@ -91,8 +91,8 @@ class ConvDecoder(tf.keras.Model):
self
.
sequential_layers
=
layers
def
call
(
self
,
x
,
training
=
None
):
for
l
in
self
.
sequential_layers
:
x
=
l
(
x
)
for
l
ayer
in
self
.
sequential_layers
:
x
=
l
ayer
(
x
)
return
x
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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