public INDArray getCorruptedInput ( INDArray x , double corruptionLevel ) { INDArray corrupted = Nd4j . getDistributions ( ) . createBinomial ( 1 , 1 - corruptionLevel ) . sample ( x . ulike ( ) ) ; corrupted . muli ( x . castTo ( corrupted . dataType ( ) ) ) ; return corrupted ; }
Corrupts the given input by doing a binomial sampling given the corruption level