public static INDArray normalizeZeroMeanAndUnitVariance ( INDArray toNormalize ) { INDArray columnMeans = toNormalize . mean ( 0 ) ; INDArray columnStds = toNormalize . std ( 0 ) ; toNormalize . subiRowVector ( columnMeans ) ; //padding for non zero columnStds . addi ( Nd4j . EPS_THRESHOLD ) ; toNormalize . diviRowVector ( columnStds ) ; return toNormalize ; }
Normalize data to zero mean and unit variance substract by the mean and divide by the standard deviation