com.datumbox.framework.core.mathematics.regularization
Class L2Regularizer
- java.lang.Object
-
- com.datumbox.framework.core.mathematics.regularization.L2Regularizer
-
public class L2Regularizer extends java.lang.ObjectUtility class for L2 regularization.
-
-
Constructor Summary
Constructors Constructor and Description L2Regularizer()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static <K> doubleestimatePenalty(double l2, java.util.Map<K,java.lang.Double> weights)Estimates the penalty by adding the L2 regularization.static <K> voidupdateWeights(double l2, double learningRate, java.util.Map<K,java.lang.Double> weights, java.util.Map<K,java.lang.Double> newWeights)Updates the weights by applying the L2 regularization.
-
-
-
Method Detail
-
updateWeights
public static <K> void updateWeights(double l2, double learningRate, java.util.Map<K,java.lang.Double> weights, java.util.Map<K,java.lang.Double> newWeights)Updates the weights by applying the L2 regularization.- Type Parameters:
K-- Parameters:
l2-learningRate-weights-newWeights-
-
estimatePenalty
public static <K> double estimatePenalty(double l2, java.util.Map<K,java.lang.Double> weights)Estimates the penalty by adding the L2 regularization.- Type Parameters:
K-- Parameters:
l2-weights-- Returns:
-
-
DataMelt 3.0 © DataMelt by jWork.ORG