MCPcopy Create free account
hub / github.com/Physical-Intelligence/openpi / loss_fn

Function loss_fn

scripts/train.py:147–151  ·  view source on GitHub ↗
(
        model: _model.BaseModel, rng: at.KeyArrayLike, observation: _model.Observation, actions: _model.Actions
    )

Source from the content-addressed store, hash-verified

145
146 @at.typecheck
147 def loss_fn(
148 model: _model.BaseModel, rng: at.KeyArrayLike, observation: _model.Observation, actions: _model.Actions
149 ):
150 chunked_loss = model.compute_loss(rng, observation, actions, train=True)
151 return jnp.mean(chunked_loss)
152
153 train_rng = jax.random.fold_in(rng, state.step)
154 observation, actions = batch

Callers

nothing calls this directly

Calls 1

compute_lossMethod · 0.45

Tested by

no test coverage detected