Agent

class agent.supervised_agent.SupervisedAgent(agent_id='Default Agent', log_path='./Brains', **kwargs)[source]

A class representing a supervised agent.

agent_id

The ID of the agent.

Type:

str

log_path

The path to save the agent’s logs.

Type:

str

callback

The callback for saving the best model.

Type:

SupervisedSaveBestModelCallback

hparamcallback

The callback for saving hyperparameters.

Type:

HParamCallback

checkpoint_callback

The callback for saving checkpoints.

Type:

CheckpointCallback

callback_list

The list of callbacks.

Type:

CallbackList

create_model(policy_model, envs, policy_kwargs)[source]

Creates a PPO model for the supervised agent.

Parameters:
  • policy_model (object) – The policy model to be used.

  • envs (object) – The environment to interact with.

  • policy_kwargs (dict) – Additional keyword arguments for the policy.

Returns:

The recurrent model for the supervised agent.

Return type:

object

create_recurrent_model(policy_model, envs, policy_kwargs)[source]

Creates a recurrent PPO model for the supervised agent.

Parameters:
  • policy_model (object) – The policy model to be used.

  • envs (object) – The environment to interact with.

  • policy_kwargs (dict) – Additional keyword arguments for the policy.

Returns:

The recurrent model for the supervised agent.

Return type:

object

setup_model(envs)[source]

Set up the model for the agent.

Returns:

The created model for the agent.

train(env, eps)[source]

Trains the agent using the specified environment and number of episodes.

Parameters:
  • env (gym.Env) – The environment to train the agent on.

  • eps (int) – The number of episodes to train the agent for.

class agent.unsupervised_agent.ICMAgent(agent_id='Default Agent', reward='icm', log_path='./Brains', **kwargs)[source]

ICM agent with callback to implement intrinsic curiosity reward

Parameters:

BaseAgent (_type_) – _description_