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
37d31ec1
Commit
37d31ec1
authored
Mar 15, 2017
by
Neal Wu
Committed by
GitHub
Mar 15, 2017
Browse files
Merge pull request #783 from dweekly/master
Update sum_of_squares (TF 0.10) to mean_squared_error (TF 0.12)
parents
8a22c8ae
48f5b4da
Changes
1
Hide 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 @
37d31ec1
...
...
@@ -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_squares(predictions, target
s)\n",
" loss =
tf
.losses.
mean_squared_error(labels=targets, predictions=prediction
s)\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_squares(predictions, target
s)\n",
"
mean
_square
d_error
_loss =
tf
.losses.
mean_squared_error(labels=targets, predictions=prediction
s)\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