Skip to main content

Overview

The Agent class provides a foundation for implementing various types of agents, such as reinforcement learning agents or autonomous agents.

Class Definition

Parameters

Optional[str]
The name of the agent. If None, a random name is generated.

Properties

name

Get the name of the agent.
str
The agent’s name.

Core Methods

act

Choose an action based on the current observation. This method should be overridden by all subclasses.
Any
required
The current observation of the environment.
Any
The action to take.

learn

Learn from experience. This method should be overridden by all subclasses that support learning.
Any
required
The experience to learn from.

reset

Reset the agent’s state. This is typically called at the beginning of a new episode.

Persistence

save

Save the agent’s state to a file.
str
required
The path to save the agent to.

load

Load the agent’s state from a file.
str
required
The path to load the agent from.

Example Usage

Built-in Agent Types

Neurenix provides several built-in agent implementations:

DQN Agent

Deep Q-Network agent for discrete action spaces

A2C Agent

Advantage Actor-Critic agent

PPO Agent

Proximal Policy Optimization agent

SAC Agent

Soft Actor-Critic agent for continuous control
See the RL Algorithms documentation for details on these implementations.