在Karpathy寫的下面的代碼中,為什么我們有這一行(為什么我們需要比較均勻分布來選擇一個動作,而策略函數(shù)是這樣做的) # forward the policy network and sample an action from the returned probability aprob, h = policy_forward(x) action = 2 if np.random.uniform() < aprob else 3 # roll the dice!而不僅僅是 # forward the policy network and sample an action from the returned probability aprob, h = policy_forward(x) action = 2 if 0.5 < aprob else 3 # roll the dice!....Karpathy 的完整代碼來自:https://gist.github.com/karpathy/a4166c7fe253700972fcbc77e4ea32c5
1 回答

米脂
TA貢獻1836條經(jīng)驗 獲得超3個贊
如果沒有統(tǒng)一比較,政策將是確定性的。對于任何給定的狀態(tài),該policy_forward
函數(shù)將返回相同的輸出,因此每次都會采取相同的操作。因此,不會對您使用您提出的方法進行任何探索。制服在動作選擇中引入了一些隨機性,這鼓勵了探索。沒有探索,基本上不可能發(fā)現(xiàn)最優(yōu)策略。
添加回答
舉報
0/150
提交
取消