Tensors

Gaussian tensor

class mushroom_rl.features.tensors.gaussian_tensor.GaussianRBFTensor(mu, scale, dim, use_cuda)[source]

Bases: sphinx.ext.autodoc.importer._MockObject

Pytorch module to implement a gaussian radial basis function.

__init__(mu, scale, dim, use_cuda)[source]

Constructor.

Parameters:
  • mu (np.ndarray) – centers of the gaussian RBFs;
  • scale (np.ndarray) – scales for the RBFs;
  • dim (np.ndarray) – list of dimension to be considered for the computation of the features;
  • use_cuda (bool) – whether to use cuda for the computation or not.
static generate(n_centers, low, high, dimensions=None, use_cuda=False)[source]

Factory method that generates the list of dictionaries to build the tensors representing a set of uniformly spaced Gaussian radial basis functions with a 25% overlap.

Parameters:
  • n_centers (list) – list of the number of radial basis functions to be used for each dimension;
  • low (np.ndarray) – lowest value for each dimension;
  • high (np.ndarray) – highest value for each dimension;
  • dimensions (list, None) – list of the dimensions of the input to be considered by the feature. The number of dimensions must match the number of elements in n_centers and low;
  • use_cuda (bool) – whether to use cuda for the computation or not.
Returns:

The list of dictionaries as described above.