.Fluxnfan
function defined in module
Flux
nfan(n_out, n_in=1) -> Tuple
nfan(dims...)
nfan(dims::Tuple)
For a layer characterized by dimensions
dims, return a tuple
(fan_in, fan_out), where
fan_in is the number of input neurons connected to an output one, and
fan_out is the number of output neurons connected to an input one.
This function is mainly used by weight initializers, e.g., [
kaiming_normal]( Flux.kaiming_normal).
julia> layer = Dense(10, 20);
julia> Flux.nfan(size(layer.weight))
(10, 20)
julia> layer = Conv((3, 3), 2=>10);
julia> Flux.nfan(size(layer.weight))
(18, 90)
There are
5
methods for Flux.nfan:
The following page links back here: