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=RandomState(Array((), dtype=key<fry>) overlaying: [ 216744582 1008666480])), 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 (
Union[Initializer,Callable,TypeVar(ArrayType,Array,Variable,TrainVar,Array,ndarray)]) – The weight initialization.b_initializer (
Union[Callable,TypeVar(ArrayType,Array,Variable,TrainVar,Array,ndarray),Initializer,None]) – The bias initialization.mode (
Optional[Mode]) – Enable training this node or not. (default True)