Adding a New Agent
- Implement your algorithm in a new file. The agent can inherit base classes such as ValueOptimizationAgent orActorCriticAgent, or the more generic Agent base class.
Note
ValueOptimizationAgent, PolicyOptimizationAgent and Agent are abstract classes. should be overriden with the desired behavior for the algorithm being implemented.If deciding to inherit from Agent, also should be overriden.
Implement your agent’s specific network head, if needed, at the implementation for the framework of your choice.For example architectures/neon_components/heads.py. The head will inherit the generic base class Head.A new output type should be added to configurations.py, and a mapping between the new head and output type shouldbe defined in the get_output_head() function at architectures/neon_components/general_network.py
-
algorithm: A class inheriting AlgorithmParameters which defines any algorithm specific parameters
exploration: A class inheriting ExplorationParameters which defines the exploration policy parameters.There are several common exploration policies built-in which you can use, and are defined underthe exploration sub directory. You can also define your own custom exploration policy.
Additionally, set the path property to return the path to your agent class in the following format:
For example,
- class RainbowAgentParameters(AgentParameters):
- def __init__(self):
- super().__init__(algorithm=RainbowAlgorithmParameters(),
- exploration=RainbowExplorationParameters(),
- networks={"main": RainbowNetworkParameters()})
- @property
- def path(self):
- return 'rainbow.rainbow_agent:RainbowAgent'