nip.scenario_base.agents.AgentHooks#

class nip.scenario_base.agents.AgentHooks[source]#

Holder for hooks to run at various points in the agent forward pass.

Methods Summary

__eq__(other)

Return self==value.

__init__()

__repr__()

Return repr(self).

create_recorder_hooks(storage[, per_agent])

Create hooks to record the agent's output.

Methods

__eq__(other)#

Return self==value.

__init__() None#
__repr__()#

Return repr(self).

classmethod create_recorder_hooks(storage: dict | TensorDict, per_agent: bool = True) AgentHooks[source]#

Create hooks to record the agent’s output.

Parameters:
  • storage (dict | TensorDict) – The dictionary to store the agent’s output in.

  • per_agent (bool, default=True) – Whether to store the output of each agent separately.

Returns:

hooks (AgentHooks) – The hooks to record the agent’s output.