Approximators

MushroomRL provides a hierarchy of approximator classes for both tabular and function-approximation settings.

The base class Approximator dispatches to an Ensemble of models when n_models > 1 is passed to the constructor. This means any approximator subclass (Table, LinearApproximator, …) can be turned into an ensemble simply by passing n_models:

# single model
q = Table(shape=(10, 4))

# ensemble of 5 tables — returns an Ensemble instance transparently
q = Table(n_models=5, shape=(10, 4))

Approximator

Base class for all approximators.

QApproximator

Interface for Q-function approximators.

Table

Table approximator.

LinearApproximator

This class implements a linear approximator.

CMAC

This class implements a Cerebellar Model Arithmetic Computer.

TorchApproximator

Class to interface a pytorch model to the mushroom Regressor interface.

RecurrentTorchApproximator

Class extending the TorchApproximator for the recurrent-network setting.