refactored
This commit is contained in:
+3
-3
@@ -78,11 +78,11 @@ def test(_k_arms: int, _episode_len: int, ql_star, _tie_break, _param: Param) ->
|
|||||||
_reward = _reward_z[j] + ql_star[_a]
|
_reward = _reward_z[j] + ql_star[_a]
|
||||||
|
|
||||||
# calc
|
# calc
|
||||||
_nu[_a] = _nu[_a] + 1
|
_nu[_a] += 1
|
||||||
if _param.alpha > 0:
|
if _param.alpha > 0:
|
||||||
_qu[_a] = _qu[_a] + _param.alpha * (_reward - _qu[_a])
|
_qu[_a] += _param.alpha * (_reward - _qu[_a])
|
||||||
else:
|
else:
|
||||||
_qu[_a] = _qu[_a] + (_reward - _qu[_a]) / _nu[_a]
|
_qu[_a] += (_reward - _qu[_a]) / _nu[_a]
|
||||||
|
|
||||||
# Reduce tendency to explore with number of steps (or with age for humans)
|
# Reduce tendency to explore with number of steps (or with age for humans)
|
||||||
_epsilon = _param.epsilon * (1 - _param.rho)
|
_epsilon = _param.epsilon * (1 - _param.rho)
|
||||||
|
|||||||
Reference in New Issue
Block a user