causally.scm.noise.MLPNoise

class causally.scm.noise.MLPNoise(hidden_dim: int = 100, activation: Module = Sigmoid(), bias: bool = False, a_weight: float = -3.0, b_weight: float = 3.0, a_bias: float = -1.0, b_bias: float = 1.0, standardize: bool = False)

Samples form adistribution defined by a neural network applied to a standard normal.

Generate a random variable with unknown distribution as a nonlinear transformation of a standard Gaussian. The transformation is parametrized by a simple neural network with one hidden layer and a nonlinear activation.

Parameters:
  • hidden_dim (int, default 100) – Number of neurons in the hidden layer.

  • activation (nn.Module, default nn.Sigmoid) – The nonlinear activation function.

  • bias (bool, default True) – If True, include the bias term.

  • a_weight (float, default -3) – Lower bound for the value of the model weights.

  • b_weight (float, default 3) – Upper bound for the value of the model weights.

  • a_bias (float, default -1) – Lower bound for the value of the model bias terms.

  • b_bias (float, default 1) – Upper bound for the value of the model bias terms.

  • standardize (bool, default False) – If True, remove the empirical mean and variance of the samples.

Methods

sample(size)

Sample random noise of the required input size.