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

Method predict

rl/cartpole.py:56–59  ·  view source on GitHub ↗
(self, s, a)

Source from the content-addressed store, hash-verified

54 self.w = np.zeros(dims)
55
56 def predict(self, s, a):
57 sa = np.concatenate((s, [a]))
58 x = self.featurizer.transform([sa])[0]
59 return x @ self.w
60
61 def predict_all_actions(self, s):
62 return [self.predict(s, a) for a in range(self.env.action_space.n)]

Callers 6

lstm1Function · 0.95
lstm2Function · 0.95
gru1Function · 0.95
gru2Function · 0.95
predict_all_actionsMethod · 0.95
cartpole.pyFile · 0.45

Calls 1

transformMethod · 0.45

Tested by 4

lstm1Function · 0.76
lstm2Function · 0.76
gru1Function · 0.76
gru2Function · 0.76