Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
89ec947f
Commit
89ec947f
authored
Dec 19, 2017
by
Mark Daoust
Browse files
Don't put an activation on the logit layer
parent
268347eb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
4 deletions
+1
-4
samples/outreach/blogs/Blog_Custom_Estimators.py
samples/outreach/blogs/Blog_Custom_Estimators.py
+1
-4
No files found.
samples/outreach/blogs/Blog_Custom_Estimators.py
View file @
89ec947f
...
...
@@ -109,18 +109,15 @@ def my_model_fn(
# We implement it as a fully-connected layer (tf.layers.dense)
# Has 10 neurons, and uses ReLU as the activation function
# Takes input_layer as input
# h1 = tf.layers.dense(input_layer, 10, activation=tf.nn.relu)
h1
=
tf
.
layers
.
Dense
(
10
,
activation
=
tf
.
nn
.
relu
)(
input_layer
)
# Definition of hidden layer: h2 (this is the logits layer)
# Similar to h1, but takes h1 as input
# h2 = tf.layers.dense(h1, 10, activation=tf.nn.relu)
h2
=
tf
.
layers
.
Dense
(
10
,
activation
=
tf
.
nn
.
relu
)(
h1
)
# Output 'logits' layer is three number = probability distribution
# between Iris Sentosa, Versicolor, and Viginica
# logits = tf.layers.dense(h2, 3)
logits
=
tf
.
layers
.
Dense
(
3
,
activation
=
tf
.
nn
.
relu
)(
h2
)
logits
=
tf
.
layers
.
Dense
(
3
)(
h2
)
# class_ids will be the model prediction for the class (Iris flower type)
# The output node with the highest value is our prediction
...
...
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