Class AbstractConstraint
java.lang.Object
org.tensorflow.framework.constraints.AbstractConstraint
- All Implemented Interfaces:
Constraint
- Direct Known Subclasses:
MaxNorm, MinMaxNorm, NonNeg, UnitNorm
Base class for Constraints. AbstractConstraint subclasses impose constraints on weight values
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the element-wise value clipping.Calculates the norm of the weights along the axesGets the element-wise square root.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Constraint
call
-
Field Details
-
EPSILON
public static final float EPSILON- See Also:
-
-
Constructor Details
-
AbstractConstraint
public AbstractConstraint()Creates a AbstractConstraint
-
-
Method Details
-
sqrt
Gets the element-wise square root.- Type Parameters:
T- The data type for the operand and result.- Parameters:
tf- the TensorFlow Opsx- the input Operand.- Returns:
- the element-wise square root.
- Throws:
IllegalArgumentException- if x is null
-
clip
protected <T extends TNumber> Operand<T> clip(Ops tf, Operand<T> x, double minValue, double maxValue) Gets the element-wise value clipping.- Type Parameters:
T- The data type for the operand and result.- Parameters:
tf- the TensorFlow Opsx- the Operand to clipminValue- the minimum valuemaxValue- the maximum value- Returns:
- the operand with clipped values
- Throws:
IllegalArgumentException- if x is null
-
norm
Calculates the norm of the weights along the axes- Type Parameters:
T- the data type for the weights and the result- Parameters:
tf- the TensorFlow Opsweights- the weights used to calculate the normsaxes- the axes along which to calculate weight norms.- Returns:
- the norms
- Throws:
IllegalArgumentException- if weights is null
-