Fix reshape to put the expanded dimension at the end of the predictions.
"\n",
" def update_state(self, y_true, y_pred, sample_weight=None):\n",
" y_true = tf.reshape(y_true, [-1, 1])\n",
- " y_pred = tf.reshape(y_pred, [-1, 1, len(vocab)])\n",
+ " y_pred = tf.reshape(y_pred, [-1, len(vocab), 1])\n",
" return super(FlattenedCategoricalAccuracy, self).update_state(\n",
" y_true, y_pred, sample_weight)"
]
