rofunc.learning.RofuncRL.processors.noises#

1.  Module Contents#

1.1.  Classes#

Noise

GaussianNoise

1.2.  API#

class rofunc.learning.RofuncRL.processors.noises.Noise(device: Optional[Union[str, torch.device]] = None)[source]#

Initialization

Base class representing a noise

sample_like(tensor: torch.Tensor) torch.Tensor[source]#

Sample a noise with the same size (shape) as the input tensor :param tensor: Input tensor used to determine output tensor size (shape) :return: Sampled noise

abstract sample(size: Union[Tuple[int], torch.Size]) torch.Tensor[source]#

Noise sampling method to be implemented by the inheriting classes :param size: Shape of the sampled tensor

class rofunc.learning.RofuncRL.processors.noises.GaussianNoise(mean: float, std: float, device: Optional[Union[str, torch.device]] = None)[source]#

Bases: rofunc.learning.RofuncRL.processors.noises.Noise

Initialization

Class representing a Gaussian noise :param mean: Mean of the normal distribution :param std: Standard deviation of the normal distribution :param device: Device on which a torch tensor is or will be allocated (default: None).

If None, the device will be either "cuda:0" if available or "cpu"

sample(size: Union[Tuple[int], torch.Size]) torch.Tensor[source]#

Sample a Gaussian noise :param size: Shape of the sampled tensor