Commit 48f5b4da authored by Neal Wu's avatar Neal Wu Committed by GitHub
Browse files

Update to use tf.losses.mean_squared_error

parent d50d2117
...@@ -244,7 +244,7 @@ ...@@ -244,7 +244,7 @@
" predictions, nodes = regression_model(inputs, is_training=True)\n", " predictions, nodes = regression_model(inputs, is_training=True)\n",
"\n", "\n",
" # Add the loss function to the graph.\n", " # Add the loss function to the graph.\n",
" loss = slim.losses.mean_squared_error(predictions, targets)\n", " loss = tf.losses.mean_squared_error(labels=targets, predictions=predictions)\n",
" \n", " \n",
" # The total loss is the uers's loss plus any regularization losses.\n", " # The total loss is the uers's loss plus any regularization losses.\n",
" total_loss = slim.losses.get_total_loss()\n", " total_loss = slim.losses.get_total_loss()\n",
...@@ -289,7 +289,7 @@ ...@@ -289,7 +289,7 @@
" predictions, end_points = regression_model(inputs, is_training=True)\n", " predictions, end_points = regression_model(inputs, is_training=True)\n",
"\n", "\n",
" # Add multiple loss nodes.\n", " # Add multiple loss nodes.\n",
" mean_squared_error_loss = slim.losses.mean_squared_error(predictions, targets)\n", " mean_squared_error_loss = tf.losses.mean_squared_error(labels=targets, predictions=predictions)\n",
" absolute_difference_loss = slim.losses.absolute_difference(predictions, targets)\n", " absolute_difference_loss = slim.losses.absolute_difference(predictions, targets)\n",
"\n", "\n",
" # The following two ways to compute the total loss are equivalent\n", " # The following two ways to compute the total loss are equivalent\n",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment