Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
" # Clip prediction values to avoid log(0) error.\n",
" y_pred = tf.clip_by_value(y_pred, 1e-9, 1.)\n",
" # Compute cross-entropy.\n",
" return tf.reduce_mean(-tf.reduce_sum(y_true * tf.math.log(y_pred)))\n",
" return tf.reduce_mean(-tf.reduce_sum(y_true * tf.math.log(y_pred),1))\n",
"\n",
"# Accuracy metric.\n",
"def accuracy(y_pred, y_true):\n",
Expand Down