public class Max2NormRegularizer extends Object implements WeightRegularizer
Constructor and Description |
---|
Max2NormRegularizer(double maxNorm) |
Modifier and Type | Method and Description |
---|---|
void |
applyRegularization(Matrix W,
Vec b)
Applies regularization to one matrix, where the rows of the matrix
correspond tot he weights associated to one neuron's input.
|
void |
applyRegularization(Matrix W,
Vec b,
ExecutorService ex)
Applies regularization to one matrix, where the rows of the matrix
correspond tot he weights associated to one neuron's input.
|
double |
applyRegularizationToRow(Vec w,
double b)
Applies the regularization to one row of the weight matrix, where the row
corresponds to the weights into one neuron.
|
Max2NormRegularizer |
clone() |
double |
getMaxNorm() |
void |
setMaxNorm(double maxNorm)
Sets the maximum allowed 2 norm for a single neuron's weights
|
public void setMaxNorm(double maxNorm)
maxNorm
- the maximum norm per neuron's weightspublic double getMaxNorm()
public void applyRegularization(Matrix W, Vec b)
WeightRegularizer
applyRegularization
in interface WeightRegularizer
W
- the matrix to apply regularization tob
- the vector of bias terms to apply regularization topublic void applyRegularization(Matrix W, Vec b, ExecutorService ex)
WeightRegularizer
applyRegularization
in interface WeightRegularizer
W
- the matrix to apply regularization tob
- the vector of bias terms to apply regularization toex
- the source of threads for parallel computationpublic double applyRegularizationToRow(Vec w, double b)
WeightRegularizer
applyRegularizationToRow
in interface WeightRegularizer
w
- the weight row to be altered depending on the regularization methodb
- the original bias input to this rowpublic Max2NormRegularizer clone()
clone
in interface WeightRegularizer
clone
in class Object
Copyright © 2017. All rights reserved.