mikera.vectorz.ops
Class Clamp
- java.lang.Object
-
- mikera.vectorz.Op
-
- mikera.vectorz.ops.ABoundedOp
-
- mikera.vectorz.ops.Clamp
-
- All Implemented Interfaces:
- IOperator
public final class Clamp extends ABoundedOp
Operator for clamping values within a given range
-
-
Field Summary
Fields Modifier and Type Field and Description static ClampZERO_TO_ONE
-
Constructor Summary
Constructors Constructor and Description Clamp(double min, double max)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doubleapply(double x)Applies this operator to a single value, returning the resultvoidapplyTo(AMatrix v)Applies this operator to every element of a target matrix, mutating the matrixvoidapplyTo(AVector v)Applies this operator to a mutable vector.voidapplyTo(double[] data, int start, int length)Applies this operator to the specified range within a double[] array.voidapplyTo(INDArray v)Applies this operator to every element of a target array.doublederivative(double x)Returns the derivative of this Op for a given input value x i.e.doublederivativeForOutput(double y)Returns the derivative of this Op for a given output value y i.e.booleanhasDerivative()Returns true if this operator supports computing the derivative for a given inputdoublemaxValue()doubleminValue()-
Methods inherited from class mikera.vectorz.ops.ABoundedOp
averageValue, isBounded
-
Methods inherited from class mikera.vectorz.Op
applyInverse, applyTo, applyTo, applyTo, applyTo, applyTo, compose, compose, constrainValues, divide, getDerivativeOp, getInverse, getTransform, hasDerivativeForOutput, hasInverse, isDomainBounded, isStochastic, maxDomain, minDomain, product, sum, toString, validateOutput
-
-
-
-
Field Detail
-
ZERO_TO_ONE
public static final Clamp ZERO_TO_ONE
-
-
Method Detail
-
apply
public double apply(double x)
Description copied from interface:IOperatorApplies this operator to a single value, returning the result
-
applyTo
public void applyTo(INDArray v)
Description copied from class:OpApplies this operator to every element of a target array. Mutates the array in place.
-
applyTo
public void applyTo(AVector v)
Description copied from interface:IOperatorApplies this operator to a mutable vector.
-
applyTo
public void applyTo(AMatrix v)
Description copied from class:OpApplies this operator to every element of a target matrix, mutating the matrix
-
applyTo
public void applyTo(double[] data, int start, int length)Description copied from interface:IOperatorApplies this operator to the specified range within a double[] array.
-
minValue
public double minValue()
- Specified by:
minValuein classABoundedOp
-
maxValue
public double maxValue()
- Specified by:
maxValuein classABoundedOp
-
hasDerivative
public boolean hasDerivative()
Description copied from class:OpReturns true if this operator supports computing the derivative for a given input- Overrides:
hasDerivativein classOp- Returns:
-
derivative
public double derivative(double x)
Description copied from class:OpReturns the derivative of this Op for a given input value x i.e. f'(x) where f is the operator- Overrides:
derivativein classOp- Returns:
-
derivativeForOutput
public double derivativeForOutput(double y)
Description copied from class:OpReturns the derivative of this Op for a given output value y i.e. f'(g(y)) where f is the operator, g is the inverse of f- Overrides:
derivativeForOutputin classOp- Returns:
-
-
DMelt 3.0 © DataMelt by jWork.ORG