MCPcopy Create free account
hub / github.com/rlcode/reinforcement-learning / step

Method step

4-atari-hard/3-robustify.py:98–105  ·  view source on GitHub ↗

One timestep for acting. obs (B,4,105,80), hx (B,gru). Returns logits, value, new hx.

(self, obs, hx, inc_entropy=None)

Source from the content-addressed store, hash-verified

96 return h
97
98 def step(self, obs, hx, inc_entropy=None):
99 """One timestep for acting. obs (B,4,105,80), hx (B,gru). Returns
100 logits, value, new hx."""
101 hx = self.gru(self.features(obs), hx)
102 logits = self.pi(hx)
103 if inc_entropy is not None:
104 logits = torch.where(inc_entropy.unsqueeze(1), logits / 2.0, logits)
105 return logits, self.v(hx).squeeze(-1), hx
106
107 def unroll(self, obs_seq, hx0, done_seq):
108 """Recompute a (T,B) rollout's logits/values with done-masked GRU state

Callers 7

mainFunction · 0.45
evaluateFunction · 0.45
mainFunction · 0.45
warmup_obs_rmsFunction · 0.45
1-ppo-rnd.pyFile · 0.45
run_test_loopFunction · 0.45
_explore_taskFunction · 0.45

Calls 1

featuresMethod · 0.95

Tested by

no test coverage detected