Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

6.4网页版和github上面的结果不一致 #53

Open
aesdhj opened this issue May 25, 2020 · 1 comment
Open

6.4网页版和github上面的结果不一致 #53

aesdhj opened this issue May 25, 2020 · 1 comment

Comments

@aesdhj
Copy link

aesdhj commented May 25, 2020

github
网页版
6.4网页版和github上面的结果不一致,代码一致,疑惑,另外6.3vocab_size实际2582,网页版和github上面是1027,如果上述有描述错误,望指教。

@sunshine-zkf
Copy link

github
网页版
6.4网页版和github上面的结果不一致,代码一致,疑惑,另外6.3vocab_size实际2582,网页版和github上面是1027,如果上述有描述错误,望指教。

损失函数缺少一个参数指定为 from_logits = True,因为全连接层没有使用softmax激活函数,需要在这指定这个参数为True。
l = tf.reduce_mean(tf.losses.sparse_categorical_crossentropy(y,outputs,from_logits=True))

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

No branches or pull requests

2 participants