MCPcopy Create free account
hub / github.com/lazyprogrammer/machine_learning_examples / act

Method act

pytorch/rl_trader.py:304–308  ·  view source on GitHub ↗
(self, state)

Source from the content-addressed store, hash-verified

302
303
304 def act(self, state):
305 if np.random.rand() <= self.epsilon:
306 return np.random.choice(self.action_size)
307 act_values = predict(self.model, state)
308 return np.argmax(act_values[0]) # returns action
309
310
311 def replay(self, batch_size=32):

Callers 1

play_one_episodeFunction · 0.45

Calls 1

predictFunction · 0.70

Tested by

no test coverage detected