mujoco/jax_rl/agents/omd/model.py
def fwd_solver(constraint_func: Callable, omd: ModelActorCriticTemp,
               model_params: Params, batch: Batch, discount: float, tau: float,
               target_entropy: float):
    """Get Q_* satisfying the constraint (approximately). Makes K grad updates.
    """

    for _ in range(FLAGS.config.inner_steps):
        omd, critic_info = critic.update(omd,
                                         model_params,
                                         batch,
                                         discount,
                                         soft_critic=True,
                                         use_model=True)
        omd = critic.target_update(omd, tau)

        # note that actor and temp do not use next_observations and rewards
        omd, actor_info = actor.update(omd, batch)
        omd, alpha_info = temperature.update(omd, actor_info['entropy'],
                                             target_entropy)

    merged_info = {**critic_info, **actor_info, **alpha_info}
    return omd, merged_info
Get Q_* satisfying the constraint (approximately). Makes K grad updates.
    
Get Q_* satisfying the constraint (approximately). Makes K grad updates.
Get Q_ * satisfying the constraint ( approximately ) . Makes K grad updates .
def fwd_solver(constraint_func: Callable, omd: ModelActorCriticTemp,
               model_params: Params, batch: Batch, discount: float, tau: float,
               target_entropy: float):
    for _ in range(FLAGS.config.inner_steps):
        omd, critic_info = critic.update(omd,
                                         model_params,
                                         batch,
                                         discount,
                                         soft_critic=True,
                                         use_model=True)
        omd = critic.target_update(omd, tau)
        omd, actor_info = actor.update(omd, batch)
        omd, alpha_info = temperature.update(omd, actor_info['entropy'],
                                             target_entropy)
    merged_info = {**critic_info, **actor_info, **alpha_info}
    return omd, merged_info
def fwd_solver ( constraint_func : Callable , omd : ModelActorCriticTemp , model_params : Params , batch : Batch , discount : float , tau : float , target_entropy : float ) : for _ in range ( FLAGS . config . inner_steps ) : omd , critic_info = critic . update ( omd , model_params , batch , discount , soft_critic = True , use_model = True ) omd = critic . target_update ( omd , tau ) omd , actor_info = actor . update ( omd , batch ) omd , alpha_info = temperature . update ( omd , actor_info [ 'entropy' ] , target_entropy ) merged_info = { ** critic_info , ** actor_info , ** alpha_info } return omd , merged_info
Get Q_* satisfying the constraint (approximately).
Get Q_ * satisfying the constraint ( approximately ) .
"""Get Q_* satisfying the constraint (approximately). Makes K grad updates.
    """ # note that actor and temp do not use next_observations and rewards
constraint_func
Callable
omd
ModelActorCriticTemp
model_params
Params
batch
Batch
discount
float
tau
float
target_entropy
float