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

Method act

tf2.0/mlp_trader.py:263–267  ·  view source on GitHub ↗
(self, state)

Source from the content-addressed store, hash-verified

261
262
263 def act(self, state):
264 if np.random.rand() <= self.epsilon:
265 return np.random.choice(self.action_size)
266 act_values = self.model.predict(state)
267 return np.argmax(act_values[0]) # returns action
268
269 def replay(self, batch_size=32):
270 # first check if replay buffer contains enough data

Callers 1

play_one_episodeFunction · 0.45

Calls 1

predictMethod · 0.45

Tested by

no test coverage detected