malib.utils.stoppers module

class malib.utils.stoppers.NonStopper(config, tasks=None)[source]

Bases: malib.utils.stoppers.Stopper

NonStopper always return false

Create a stopper instance with metric fields. This fields should cover all feasible attributes from rollout/training results.

Parameters
  • config (Dict) – Configuration to control the stopping.

  • tasks (List) – A list of sub task identifications. Default to None

property info

Return statistics for analysis

class malib.utils.stoppers.SimpleRolloutStopper(config, tasks: Optional[List] = None)[source]

Bases: malib.utils.stoppers.Stopper

SimpleRolloutStopper will check the equivalence between evaluate results and

Create a stopper instance with metric fields. This fields should cover all feasible attributes from rollout/training results.

Parameters
  • config (Dict) – Configuration to control the stopping.

  • tasks (List) – A list of sub task identifications. Default to None

property info

Return statistics for analysis

property max_iteration
class malib.utils.stoppers.SimpleTrainingStopper(config: Dict, tasks: Optional[List] = None)[source]

Bases: malib.utils.stoppers.Stopper

SimpleRolloutStopper will check the equivalence between evaluate results and

Create a stopper instance with metric fields. This fields should cover all feasible attributes from rollout/training results.

Parameters
  • config (Dict) – Configuration to control the stopping.

  • tasks (List) – A list of sub task identifications. Default to None

property info

Return statistics for analysis

class malib.utils.stoppers.Stopper(config: Dict, tasks: Optional[List] = None)[source]

Bases: object

Create a stopper instance with metric fields. This fields should cover all feasible attributes from rollout/training results.

Parameters
  • config (Dict) – Configuration to control the stopping.

  • tasks (List) – A list of sub task identifications. Default to None

all()[source]

Judge whether all tasks have been terminated

Returns

a bool value indicates terminated or not

property info

Return statistics for analysis

set_terminate(task_id: str) None[source]

Terminate sub task tagged with task_id, and set status to terminate.

malib.utils.stoppers.get_stopper(name: str)[source]

Return a stopper class with given type name.

Parameters

name (str) – Stopper name, choices {simple_rollout, simple_training}.

Returns

A stopper type.