BatchNormalization

class BatchNormalization<T : DType, V>(numFeatures: Int, eps: Double = 1.0E-5, momentum: Double = 0.1, affine: Boolean = true, val name: String = "BatchNormalization", initGamma: Tensor<T, V>? = null, initBeta: Tensor<T, V>? = null) : Module<T, V> , ModuleParameters<T, V> (source)

BatchNormalization layer for training stability and performance. Normalizes the input across the batch dimension. https://arxiv.org/abs/1607.06450

Parameters

numFeatures

Number of features (channels)

eps

Small value added to the denominator for numerical stability

momentum

Momentum for running statistics update during training

affine

Whether to learn affine parameters (gamma and beta)

name

Name of the module

initGamma

Initial gamma (scale) parameter

initBeta

Initial beta (shift) parameter

Constructors

Link copied to clipboard
constructor(numFeatures: Int, eps: Double = 1.0E-5, momentum: Double = 0.1, affine: Boolean = true, name: String = "BatchNormalization", initGamma: Tensor<T, V>? = null, initBeta: Tensor<T, V>? = null)

Properties

Link copied to clipboard
open override val modules: List<Module<T, V>>
Link copied to clipboard
open override val name: String
Link copied to clipboard
open override val params: List<ModuleParameter<T, V>>

Parameters owned by this node (weights, biases, etc.).

Functions

Link copied to clipboard
fun eval()

Set the module to evaluation mode

Link copied to clipboard
open override fun forward(input: Tensor<T, V>, ctx: ExecutionContext): Tensor<T, V>
Link copied to clipboard
fun train()

Set the module to training mode