Dive-into-DL-TensorFlow2.0 icon indicating copy to clipboard operation
Dive-into-DL-TensorFlow2.0 copied to clipboard

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

Open aesdhj opened this issue 4 years ago • 1 comments

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

aesdhj avatar May 25 '20 16:05 aesdhj

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))

sunshine-zkf avatar Aug 04 '20 01:08 sunshine-zkf