MCPcopy Index your code
hub / github.com/lazyprogrammer/machine_learning_examples / negative_grid

Function negative_grid

rl/grid_world.py:126–141  ·  view source on GitHub ↗
(step_cost=-0.1)

Source from the content-addressed store, hash-verified

124
125
126def negative_grid(step_cost=-0.1):
127 # in this game we want to try to minimize the number of moves
128 # so we will penalize every move
129 g = standard_grid()
130 g.rewards.update({
131 (0, 0): step_cost,
132 (0, 1): step_cost,
133 (0, 2): step_cost,
134 (1, 0): step_cost,
135 (1, 2): step_cost,
136 (2, 0): step_cost,
137 (2, 1): step_cost,
138 (2, 2): step_cost,
139 (2, 3): step_cost,
140 })
141 return g
142
143
144

Callers 3

q_learning.pyFile · 0.90
approx_control.pyFile · 0.90
sarsa.pyFile · 0.90

Calls 2

standard_gridFunction · 0.85
updateMethod · 0.45

Tested by

no test coverage detected