Dense#
- class brainpy.dnn.Dense(num_in, num_out, W_initializer=XavierNormal(scale=1.0, mode=fan_avg, in_axis=-2, out_axis=-1, distribution=truncated_normal, rng=[ 479025946 4206239744]), b_initializer=ZeroInit, mode=None, name=None)[source]#
A linear transformation applied over the last dimension of the input.
Mathematically, this node can be defined as:
\[y = x \cdot weight + b\]- Parameters:
num_in (int) – The number of the input feature. A positive integer.
num_out (int) – The number of the output features. A positive integer.
W_initializer (optional, Initializer) – The weight initialization.
b_initializer (optional, Initializer) – The bias initialization.
mode (Mode) – Enable training this node or not. (default True)