我自己在tensorflow中实现了ddpg,遇到了一个神秘的bug,花了我好几天的时间去思考,但仍然没有结果。你知道吗
我把演员的损失定义为
actor_loss = - tf.reduce_mean(self.critic_with_actor.Q)
其中self.critic_with_actor.Q
是critic
的输出,它将从actor
获得的操作作为其输入之一。问题是,actor
不知何故没有任何梯度。以下是相关tensorboard信息的快照:
其中Tanh
是actor
的输出张量,即actor
选择的action
。BiasAdd
是Tanh
的输入张量,其他张量只是actor
中的可训练变量。如您所见,Tanh
有梯度,但其他的没有。
这是我的主要演员-评论家网络的架构
其中critic_1
对应于代码中的self.critic_with_actor
,它与critic
共享变量。你知道吗
这是我的代码https://github.com/xlnwel/ddpg-bipedal/blob/f1f6ed8842f7f13254f77ff37d9d0d340a4650e0/tensorflow-imp/ddpg_tf.py#L37-L41。代码应该能够运行(作为自述文件.md建议)即使错误存在。你知道吗
目前没有回答
相关问题 更多 >
编程相关推荐