nn.Dense

class nn.Dense(*args: Any, **kwargs: Any)[source]

Fully connected linear layer with activation function.

\[y = activation(x W^T + b)\]
Parameters:
  • in_features – number of input feature \(x\).

  • out_features – umber of output features \(y\).

  • bias – If False, the layer will not adapt bias \(b\).

  • activation – if None, no activation function is used.

  • weight_init – weight initializer from current weight.

  • bias_init – bias initializer from current bias.