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

Method act

rl/linear_rl_trader.py:263–267  ·  view source on GitHub ↗
(self, state)

Source from the content-addressed store, hash-verified

261 self.model = LinearModel(state_size, action_size)
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
270 def train(self, state, action, reward, next_state, done):

Callers 3

stepMethod · 0.45
stepMethod · 0.45
play_one_episodeFunction · 0.45

Calls 1

predictMethod · 0.45

Tested by

no test coverage detected