tianshou.exploration

class tianshou.exploration.OUNoise(sigma: float = 0.3, theta: float = 0.15, dt: float = 0.01, x0: Union[float, numpy.ndarray, None] = None)[source]

Bases: object

Class for Ornstein-Uhlenbeck process, as used for exploration in DDPG. Usage:

# init
self.noise = OUNoise()
# generate noise
noise = self.noise(logits.shape, eps)

For required parameters, you can refer to the stackoverflow page. However, our experiment result shows that (similar to OpenAI SpinningUp) using vanilla gaussian process has little difference from using the Ornstein-Uhlenbeck process.

__call__(size: tuple, mu: float = 0.1) → numpy.ndarray[source]

Generate new noise. Return a numpy.ndarray which size is equal to size.

reset() → None[source]

Reset to the initial state.