mpcrl.LearnableParameter#

class mpcrl.LearnableParameter(name, shape, value, lb=-inf, ub=inf)[source]#

Bases: object

A parameter that is learnable, that is, it can be adjusted via RL or any other learning strategy. This class is useful for managing bounds and value of the learnable parameter.

Parameters:
namestr

Name of the learnable parameter.

shapeint or tuple of ints

Shape of the parameter.

valuearray_like

Starting value of the parameter.

lbarray_like, optional

Lower bound of the parameter values. If not specified, it is unbounded.

ubarray_like, optional

Upper bound of the parameter values. If not specified, it is unbounded.

Raises:
ValueError

Raises if value, lb or ub cannot be broadcasted to a 1D vector with shape equal to shape.

Methods

Attributes

size

Gets the number of elements in the parameter.

property size: int#

Gets the number of elements in the parameter.

Examples using mpcrl.LearnableParameter#

Off-policy Q-learning

Off-policy Q-learning

On-policy Deterministic Policy Gradient

On-policy Deterministic Policy Gradient

On-policy Q-learning

On-policy Q-learning

Bayesian Optimization for MPC Data-driven Tuning

Bayesian Optimization for MPC Data-driven Tuning