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
16da0022
Commit
16da0022
authored
Dec 20, 2016
by
David E. Weekly
Browse files
Update deprecated sum_of_squares (TF 0.10) to mean_squared_error (TF 0.12)
parent
bb5798c7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
slim/slim_walkthough.ipynb
slim/slim_walkthough.ipynb
+4
-4
No files found.
slim/slim_walkthough.ipynb
View file @
16da0022
...
...
@@ -232,7 +232,7 @@
},
"outputs": [],
"source": [
"# The following snippet trains the regression model using a
sum_of
_square
s
loss.\n",
"# The following snippet trains the regression model using a
mean
_square
d_error
loss.\n",
"ckpt_dir = '/tmp/regression_model/'\n",
"\n",
"with tf.Graph().as_default():\n",
...
...
@@ -244,7 +244,7 @@
" predictions, nodes = regression_model(inputs, is_training=True)\n",
"\n",
" # Add the loss function to the graph.\n",
" loss = slim.losses.
sum_of
_square
s
(predictions, targets)\n",
" loss = slim.losses.
mean
_square
d_error
(predictions, targets)\n",
" \n",
" # The total loss is the uers's loss plus any regularization losses.\n",
" total_loss = slim.losses.get_total_loss()\n",
...
...
@@ -289,12 +289,12 @@
" predictions, end_points = regression_model(inputs, is_training=True)\n",
"\n",
" # Add multiple loss nodes.\n",
"
sum_of
_square
s
_loss = slim.losses.
sum_of
_square
s
(predictions, targets)\n",
"
mean
_square
d_error
_loss = slim.losses.
mean
_square
d_error
(predictions, targets)\n",
" absolute_difference_loss = slim.losses.absolute_difference(predictions, targets)\n",
"\n",
" # The following two ways to compute the total loss are equivalent\n",
" regularization_loss = tf.add_n(slim.losses.get_regularization_losses())\n",
" total_loss1 =
sum_of
_square
s
_loss + absolute_difference_loss + regularization_loss\n",
" total_loss1 =
mean
_square
d_error
_loss + absolute_difference_loss + regularization_loss\n",
"\n",
" # Regularization Loss is included in the total loss by default.\n",
" # This is good for training, but not for testing.\n",
...
...
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