Class BaseConstraint
- java.lang.Object
-
- org.deeplearning4j.nn.conf.constraint.BaseConstraint
-
- All Implemented Interfaces:
Serializable
,Cloneable
,LayerConstraint
- Direct Known Subclasses:
MaxNormConstraint
,MinMaxNormConstraint
,NonNegativeConstraint
,UnitNormConstraint
public abstract class BaseConstraint extends Object implements LayerConstraint
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static double
DEFAULT_EPSILON
protected int[]
dimensions
protected double
epsilon
protected Set<String>
params
-
Constructor Summary
Constructors Modifier Constructor Description protected
BaseConstraint()
protected
BaseConstraint(Set<String> paramNames, int... dimensions)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
apply(INDArray param)
void
applyConstraint(Layer layer, int iteration, int epoch)
Apply a given constraint to a layer at each iteration in the provided epoch, after parameters have been updated.abstract BaseConstraint
clone()
static int[]
getBroadcastDims(int[] reduceDimensions, int rank)
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.deeplearning4j.nn.api.layers.LayerConstraint
getParams, setParams
-
-
-
-
Field Detail
-
DEFAULT_EPSILON
public static final double DEFAULT_EPSILON
- See Also:
- Constant Field Values
-
epsilon
protected double epsilon
-
dimensions
protected int[] dimensions
-
-
Method Detail
-
applyConstraint
public void applyConstraint(Layer layer, int iteration, int epoch)
Description copied from interface:LayerConstraint
Apply a given constraint to a layer at each iteration in the provided epoch, after parameters have been updated.- Specified by:
applyConstraint
in interfaceLayerConstraint
- Parameters:
layer
- org.deeplearning4j.nn.api.Layeriteration
- given iteration as integerepoch
- current epoch as integer
-
apply
public abstract void apply(INDArray param)
-
clone
public abstract BaseConstraint clone()
- Specified by:
clone
in interfaceLayerConstraint
- Overrides:
clone
in classObject
-
getBroadcastDims
public static int[] getBroadcastDims(int[] reduceDimensions, int rank)
-
-