trinity.algorithm.policy_loss_fn.topr_policy_loss module

trinity.algorithm.policy_loss_fn.topr_policy_loss module#

TOPR policy loss function. Refer to https://arxiv.org/pdf/2503.14286v1

class trinity.algorithm.policy_loss_fn.topr_policy_loss.TOPRPolicyLossFn(backend: str = 'verl', advantage_threshold: float = 0.0)[source]#

Bases: PolicyLossFn

__init__(backend: str = 'verl', advantage_threshold: float = 0.0) None[source]#

Initialize the policy loss function.

Parameters:

backend – The training framework/backend to use (e.g., “verl”)

classmethod default_args() Dict[source]#

Get default initialization arguments for this loss function.

Returns:

The default init arguments for the policy loss function.

Return type:

Dict

property select_keys#

Returns parameter keys mapped to the specific training framework’s naming convention.