Skip to content

Conversation

@josey4869
Copy link

@josey4869 josey4869 commented Sep 7, 2020

In othello.tensorflow.OthelloNNet.py:

The pi output of the model is

self.pi = Dense(s_fc2, self.action_size) (line 36)

which is incorrect. In fact, it should be

self.pi = tf.nn.softmax(Dense(s_fc2, self.action_size)).

By contrast, the implementation in Keras is correct. In othello.keras.OthelloNNet.py:

self.pi = Dense(self.action_size, activation='softmax', name='pi')(s_fc2) (line 28).

@rlronan
Copy link
Contributor

rlronan commented Jun 9, 2021

Softmax crossentropy expects logits in tensorflow, so softmax should not be applied to pi directly.
https://www.tensorflow.org/api_docs/python/tf/compat/v1/losses/softmax_cross_entropy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants