ObsKey = str ActionKey = str :param obs: Dict[ObsKey, torch.Tensor] :return: Dict[ActionKey, np.ndarray] """ pass def act_eval(self, obs): """ Generate an action in an evaluation. ObsKey = str ActionKey = str :param obs: Dict[ObsKey, torch.Tensor] :return: Dict[ActionKey, np.ndarray] """ pass if __name__ == "__main__": args = parse_args() agent_reg = AgentRegistry() agent_reg.register_agent(MyCustomAgent) main(args, agent_registry=agent_reg) # Call script like this to train agent: # python -m custom_agent_stub.py --agent MyCustomAgent
""" pass def reset(self, **kwargs): """ Reset environment. ObsKey = str :param kwargs: :return: Dict[ObsKey, Any] Observation dictionary """ pass def close(self): """ Close any connections / resources. :return: """ pass if __name__ == "__main__": env_reg = EnvRegistry() env_reg.register_env(MyCustomEnv, ["scenario1", "scenario2"]) main(parse_args(), env_registry=env_reg) # Call script like this to train agent: # python -m custom_env_stub.py --env scenario1
def new_internals(self, device): """ Define any initial hidden states here, move them to device if necessary. InternalKey=str :return: Dict[InternalKey, torch.Tensor (ND)] """ pass def forward(self, observation, internals): """ Compute forward pass. ObsKey = str InternalKey = str :param observation: Dict[ObsKey, torch.Tensor (1D | 2D | 3D | 4D)] :param internals: Dict[InternalKey, torch.Tensor (ND)] :return: torch.Tensor """ pass if __name__ == "__main__": args = parse_args() network_reg = NetworkRegistry() network_reg.register_network(MyCustomNetwork) main(args, net_registry=network_reg) # Call script like this to train agent: # python -m custom_network_stub.py --custom-network MyCustomNetwork
pass def reset(self, **kwargs): """ Reset environment. ObsKey = str :param kwargs: :return: Dict[ObsKey, Any] Observation dictionary """ pass def close(self): """ Close any connections / resources. :return: """ pass if __name__ == "__main__": import adept adept.register_env(MyCustomEnv) main(parse_args()) # Call script like this to train agent: # python -m custom_env_stub.py --env scenario1