MCPcopy Create free account
hub / github.com/LeCAR-Lab/model-based-diffusion / step

Method step

mbd/envs/humanoidrun.py:34–41  ·  view source on GitHub ↗

Runs one timestep of the environment's dynamics.

(self, state: State, action: jax.Array)

Source from the content-addressed store, hash-verified

32 return State(pipeline_state, obs, reward, done, {})
33
34 def step(self, state: State, action: jax.Array) -> State:
35 """Runs one timestep of the environment's dynamics."""
36 pipeline_state = self.pipeline_step(state.pipeline_state, action)
37
38 obs = self._get_obs(pipeline_state, action)
39 reward = self._get_reward(pipeline_state)
40
41 return state.replace(pipeline_state=pipeline_state, obs=obs, reward=reward)
42
43 def _get_obs(self, pipeline_state: base.State, action: jax.Array) -> jax.Array:
44 return jnp.concatenate([pipeline_state.q, pipeline_state.qd], axis=-1)

Callers

nothing calls this directly

Calls 2

_get_obsMethod · 0.95
_get_rewardMethod · 0.95

Tested by

no test coverage detected