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

Method sample_action

rl2/mountaincar/td_lambda.py:70–74  ·  view source on GitHub ↗
(self, s, eps)

Source from the content-addressed store, hash-verified

68 self.models[a].partial_fit(X[0], G, self.eligibilities[a])
69
70 def sample_action(self, s, eps):
71 if np.random.random() < eps:
72 return self.env.action_space.sample()
73 else:
74 return np.argmax(self.predict(s))
75
76
77# returns a list of states_and_rewards, and the total reward

Callers 2

play_oneFunction · 0.45
play_oneFunction · 0.45

Calls 2

predictMethod · 0.95
sampleMethod · 0.45

Tested by

no test coverage detected