nip.scenario_base.rollout_samples.RolloutSamples#

class nip.scenario_base.rollout_samples.RolloutSamples(run_id: str, iteration: int, wandb_entity: str | None = None, wandb_project: str | None = None, silence_wandb: bool = True)[source]#

A collection of rollout samples loaded from W&B.

Since this class has some cleanup, it should be used as a context manager, or else the finish method should be called manually (see examples).

Parameters:
  • run_id (str) – The ID of the W&B run.

  • iteration (int) – The iteration of the rollout samples to load.

  • wandb_entity (str, optional) – The W&B entity to load the rollout samples from. Defaults to the default entity.

  • wandb_project (str, optional) – The W&B project to load the rollout samples from. Defaults to the default project.

  • silence_wandb (bool, default=True) – Whether to suppress W&B output.

Examples

Using the RolloutSamples class as a context manager: >>> with RolloutSamples(run_id, iteration) as rollout_samples: … rollout_samples.visualise()

Or manually calling the finish method:

>>> rollout_samples = RolloutSamples(run_id, iteration)
>>> rollout_samples.visualise()
>>> rollout_samples.finish()

Methods Summary

__contains__(item)

__enter__()

__exit__(exc_type, exc_value, traceback)

__getitem__(key)

__init__(run_id, iteration[, wandb_entity, ...])

__iter__()

__len__()

__repr__()

Return repr(self).

__str__()

Return str(self).

finish()

Finish the W&B run.

visualise()

Visualise the rollout samples.

Methods

__contains__(item)[source]#
__enter__()[source]#
__exit__(exc_type, exc_value, traceback)[source]#
__getitem__(key)[source]#
__init__(run_id: str, iteration: int, wandb_entity: str | None = None, wandb_project: str | None = None, silence_wandb: bool = True)[source]#
__iter__()[source]#
__len__()[source]#
__repr__()[source]#

Return repr(self).

__str__()[source]#

Return str(self).

finish()[source]#

Finish the W&B run.

abstract visualise()[source]#

Visualise the rollout samples.