-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
リポジトリありがとうございます。実装例のおかげで手元の応用もスムーズに行きました。
Qiita記事で日本語でしたので、こちらもあえて日本語でコメントを書かせてください。
一点だけ気づいたのですが、こちらの混合比率がひょっとすると違うかもしれません。
loss_hard_target = -tf.reduce_sum(y_ * tf.log(y), reduction_indices=[1])
loss_soft_target = -tf.reduce_sum(soft_target_ * tf.log(y_soft_target), \
reduction_indices=[1])
In [16]: loss = tf.reduce_mean(\
tf.square(T) * loss_hard_target \
+ tf.square(T) * loss_soft_target)lossにhard/softどちらも$T^2$を乗じた和の平均を代入されていますが、softだけでいいのかもしれません。
元の論文を読むと、
"... We found that the best results were generally obtained by using a condiderably lower weight on the second objective function. Since the magnitudes of the gradients produced by the soft targets scale as
2つ目の目的関数(=hardの目的関数)のウェイトをぐっと下げると良い結果で、softターゲットのgradientが$1/T^2$されているので$T^2$を掛ける必要がある、と書いてあるように見えます。手元の応用では、そのようにしたほうがうまくいきました。
(余談 - considerably と書きたかったところが condiderably と誤植のようです)
以上ご参考まで、公開していただきありがとうございました。
johnnyasd12 and akimach
Metadata
Metadata
Assignees
Labels
No labels