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

Method _get_reward

mbd/envs/hopper.py:57–65  ·  view source on GitHub ↗

Returns the environment reward.

(self, pipeline_state: base.State)

Source from the content-addressed store, hash-verified

55 return jp.concatenate((position, velocity))
56
57 def _get_reward(self, pipeline_state: base.State) -> jax.Array:
58 """Returns the environment reward."""
59 return (
60 pipeline_state.x.pos[0, 0] +
61 # pipeline_state.x.pos[1, 0] +
62 # pipeline_state.x.pos[2, 0] +
63 # pipeline_state.x.pos[3, 0] +
64 - jp.clip(jp.abs(pipeline_state.x.pos[0, 2] - 1.0), -1.0, 1.0) * 0.5
65 )

Callers 1

stepMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected