Implement a custom environment by overriding BaseEnvironment
mainTo use the agent and learner, you must provide an environment by overriding BaseEnvironment. The environment must implement two specific methods:
env.init(): Must return a tuple containing instructions (string) and the initial state (Tensor).- Return type:
Tuple[str, Tensor[*state_shape]]
- Return type:
env(actions): Must accept actions and return a tuple containing rewards, the next state, and a done flag.- Return type:
Tuple[Tensor[()], Tensor[*state_shape], Tensor[()]]
- Return type: