nip.factory

nip.factory#

A factory function for the components of an experiment scenario.

This is where the logic for creating the agents and environments lives.

The ScenarioInstance class holds the components of a scenario, which serves to abstract away the details of the particular experiment being run.

Scenarios register their components using the register_scenario_class registry, and the factory build_scenario_instance function builds the correct components based on the parameters.

Functions

_add_pretrained_embeddings_to_datasets(...)

Add embeddings to the datasets from pretrained models.

_build_agents(hyper_params, settings, ...)

Build the agents for the experiment.

_build_components_for_rl_trainer(...)

Build the additional components needed for an RL trainer.

build_scenario_instance(hyper_params, settings)

Build a scenario instance from parameters.

register_scenario_class(scenario, base_class)

Register a component with a scenario.

Classes

ScenarioInstance(train_dataset, ...[, ...])

A dataclass for holding the components of an experiment.

_ParameterSelector()

A data structure for storing and retrieving classes based on parameter values.