MCPcopy Index your code
hub / github.com/rlcode/reinforcement-learning / pick

Function pick

2-cartpole/3-ppo.py:116–119  ·  view source on GitHub ↗
(state)

Source from the content-addressed store, hash-verified

114 model.load_state_dict(torch.load(SAVE_PATH))
115
116 def pick(state):
117 with torch.no_grad():
118 logits, _ = model(torch.as_tensor(state))
119 return int(torch.distributions.Categorical(logits=logits).sample().item())
120
121 run_test_loop(env, pick)
122

Callers

nothing calls this directly

Calls 1

sampleMethod · 0.45

Tested by

no test coverage detected