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
finishmethod 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
RolloutSamplesclass as a context manager: >>> with RolloutSamples(run_id, iteration) as rollout_samples: … rollout_samples.visualise()Or manually calling the
finishmethod:>>> rollout_samples = RolloutSamples(run_id, iteration) >>> rollout_samples.visualise() >>> rollout_samples.finish()
Methods Summary
__contains__(item)__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 the rollout samples.
Methods