BatchNorm2d Type

Applies Batch Normalization over a 4D input (a mini-batch of 2D inputs with optional additional channel dimension)

The mean and standard-deviation are calculated per-dimension over the mini-batches and \(\gamma\( and \(\beta\) are learnable parameter vectors of size \(C\) (where \(C\) is the input size). By default, the elements of \(\gamma\) are set to 1 and the elements of \(\beta\) are set to 0. The standard-deviation is calculated via the biased estimator, equivalent to dsharp.var(input, unbiased=False).

Also by default, during training this layer keeps running estimates of its computed mean and variance, which are then used for normalization during evaluation. The running estimates are kept with a default momentum of 0.1.

If trackRunningStats is set to False, this layer then does not keep running estimates, and batch statistics are instead used during evaluation time as well.

Constructors

Constructor Description

BatchNorm2d(numFeatures, ?eps, ?momentum, ?affine, ?trackRunningStats, ?reversible)

Full Usage: BatchNorm2d(numFeatures, ?eps, ?momentum, ?affine, ?trackRunningStats, ?reversible)

Parameters:
    numFeatures : int
    ?eps : double
    ?momentum : Tensor
    ?affine : bool
    ?trackRunningStats : bool
    ?reversible : bool

Returns: BatchNorm2d
numFeatures : int
?eps : double
?momentum : Tensor
?affine : bool
?trackRunningStats : bool
?reversible : bool
Returns: BatchNorm2d

Instance members

Instance member Description

this.bias

Full Usage: this.bias

Returns: Tensor

TBD

Returns: Tensor

this.mean

Full Usage: this.mean

Returns: Tensor

TBD

Returns: Tensor

this.stddev

Full Usage: this.stddev

Returns: Tensor

TBD

Returns: Tensor

this.variance

Full Usage: this.variance

Returns: Tensor

TBD

Returns: Tensor

this.weight

Full Usage: this.weight

Returns: Tensor

TBD

Returns: Tensor

© Copyright 2021, DiffSharp Contributors.