用argmax输出one-hot向量带来的问题:
(1)argmax不能计算梯度,也就不能更新网络
(2)而且输出并不代表概率意义,只是单纯的argmax没有探索性。
代码:
choice = F.gumbel_softmax (choice, tau=0.5, hard=False, eps=1e-10, dim=1)
(choice为tensor)
用argmax输出one-hot向量带来的问题:
(1)argmax不能计算梯度,也就不能更新网络
(2)而且输出并不代表概率意义,只是单纯的argmax没有探索性。
代码:
choice = F.gumbel_softmax (choice, tau=0.5, hard=False, eps=1e-10, dim=1)
(choice为tensor)