nip.scenario_base.agents.PureTextCombinedWhole#
- class nip.scenario_base.agents.PureTextCombinedWhole(hyper_params: HyperParameters, settings: ExperimentSettings, protocol_handler: ProtocolHandler, wholes: dict[str, WholeAgent])[source]#
Base class for modules which combine whole pure-text agents together.
Methods Summary
__call__(data, environment)Run a forward pass through all the agents and combine the output.
__init__(hyper_params, settings, ...)Restrict an agent's input to its visible message channels.
forward(data, environment)Run a forward pass through all the agents and combine the output.
Attributes
additional_in_keysadditional_out_keysexcluded_in_keysexcluded_out_keysin_keysThe keys required by the module.
out_keysThe keys produced by the module.
Methods
- async __call__(data: NestedArrayDict, environment: PureTextEnvironment) NestedArrayDict[source]#
Run a forward pass through all the agents and combine the output.
- __init__(hyper_params: HyperParameters, settings: ExperimentSettings, protocol_handler: ProtocolHandler, wholes: dict[str, WholeAgent])[source]#
- _restrict_input_to_visible_channels(agent_name: str, input_array: Tensor | ndarray[Any, dtype[_ScalarType_co]], shape_spec: str) Tensor[source]#
Restrict an agent’s input to its visible message channels.
Agents only receive messages from the channels they can see. This function restricts the input to the agent to only the visible message channels.
- Parameters:
- Returns:
restricted_input (Tensor | NDArray) – The input restricted to the visible message channels.
- abstract async forward(data: NestedArrayDict, environment: PureTextEnvironment) NestedArrayDict[source]#
Run a forward pass through all the agents and combine the output.