Class TruncatedNormalDistribution
- java.lang.Object
-
- org.nd4j.autodiff.functions.DifferentialFunction
-
- org.nd4j.linalg.api.ops.BaseOp
-
- org.nd4j.linalg.api.ops.random.BaseRandomOp
-
- org.nd4j.linalg.api.ops.random.impl.TruncatedNormalDistribution
-
public class TruncatedNormalDistribution extends BaseRandomOp
-
-
Field Summary
-
Fields inherited from class org.nd4j.linalg.api.ops.random.BaseRandomOp
dataType, shape
-
Fields inherited from class org.nd4j.linalg.api.ops.BaseOp
dimensionz, extraArgz, x, xVertexId, y, yVertexId, z, zVertexId
-
Fields inherited from class org.nd4j.autodiff.functions.DifferentialFunction
dimensions, extraArgs, inPlace, ownName, ownNameSetWithDefault, sameDiff, scalarValue
-
-
Constructor Summary
Constructors Constructor Description TruncatedNormalDistribution()
TruncatedNormalDistribution(double mean, double stddev, DataType datatype, long... shape)
TruncatedNormalDistribution(@NonNull INDArray z)
This op fills Z with random values within -1.0..0..1.0TruncatedNormalDistribution(@NonNull INDArray z, double stddev)
This op fills Z with random values within stddev..0..stddevTruncatedNormalDistribution(@NonNull INDArray z, double mean, double stddev)
This op fills Z with random values within stddev..mean..stddev boundariesTruncatedNormalDistribution(@NonNull INDArray z, @NonNull INDArray means, double stddev)
TruncatedNormalDistribution(SameDiff sd, double mean, double stddev, long[] shape)
TruncatedNormalDistribution(SameDiff sd, double mean, double stddev, DataType dataType, long[] shape)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<DataType>
calculateOutputDataTypes(List<DataType> inputDataTypes)
Calculate the data types for the output arrays.List<LongShapeDescriptor>
calculateOutputShape()
Calculate the output shape for this opList<LongShapeDescriptor>
calculateOutputShape(OpContext oc)
List<SDVariable>
doDiff(List<SDVariable> f1)
The actual implementation for automatic differentiation.boolean
isTripleArgRngOp()
String
onnxName()
The opName of this function in onnxString
opName()
The name of the opint
opNum()
The number of the op (mainly for old legacy XYZ ops likeOp
)void
setPropertiesForFunction(Map<String,Object> properties)
void
setZ(INDArray z)
set z (the solution ndarray)String
tensorflowName()
The opName of this function tensorflow-
Methods inherited from class org.nd4j.linalg.api.ops.random.BaseRandomOp
isInPlace, opType
-
Methods inherited from class org.nd4j.linalg.api.ops.BaseOp
clearArrays, computeVariables, defineDimensions, dimensions, equals, extraArgs, extraArgsBuff, extraArgsDataBuff, getFinalResult, getInputArgument, getNumOutputs, getOpType, hashCode, initFromOnnx, initFromTensorFlow, outputVariables, setX, setY, toCustomOp, toString, x, y, z
-
Methods inherited from class org.nd4j.autodiff.functions.DifferentialFunction
arg, arg, argNames, args, attributeAdaptersForFunction, configFieldName, configureWithSameDiff, diff, dup, getBooleanFromProperty, getDoubleValueFromProperty, getIntValueFromProperty, getLongValueFromProperty, getStringFromProperty, getValue, isConfigProperties, larg, mappingsForFunction, onnxNames, outputs, outputVariable, outputVariables, outputVariablesNames, propertiesForFunction, rarg, replaceArg, setInstanceId, setValueFor, tensorflowNames
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.nd4j.linalg.api.ops.Op
clearArrays, extraArgs, extraArgsBuff, extraArgsDataBuff, setExtraArgs, setX, setY, toCustomOp, x, y, z
-
-
-
-
Constructor Detail
-
TruncatedNormalDistribution
public TruncatedNormalDistribution()
-
TruncatedNormalDistribution
public TruncatedNormalDistribution(SameDiff sd, double mean, double stddev, long[] shape)
-
TruncatedNormalDistribution
public TruncatedNormalDistribution(SameDiff sd, double mean, double stddev, DataType dataType, long[] shape)
-
TruncatedNormalDistribution
public TruncatedNormalDistribution(double mean, double stddev, DataType datatype, long... shape)
-
TruncatedNormalDistribution
public TruncatedNormalDistribution(@NonNull @NonNull INDArray z, double mean, double stddev)
This op fills Z with random values within stddev..mean..stddev boundaries- Parameters:
z
-mean
-stddev
-
-
TruncatedNormalDistribution
public TruncatedNormalDistribution(@NonNull @NonNull INDArray z, @NonNull @NonNull INDArray means, double stddev)
-
TruncatedNormalDistribution
public TruncatedNormalDistribution(@NonNull @NonNull INDArray z)
This op fills Z with random values within -1.0..0..1.0- Parameters:
z
-
-
TruncatedNormalDistribution
public TruncatedNormalDistribution(@NonNull @NonNull INDArray z, double stddev)
This op fills Z with random values within stddev..0..stddev- Parameters:
z
-
-
-
Method Detail
-
opNum
public int opNum()
Description copied from class:DifferentialFunction
The number of the op (mainly for old legacy XYZ ops likeOp
)- Specified by:
opNum
in interfaceOp
- Overrides:
opNum
in classDifferentialFunction
- Returns:
-
opName
public String opName()
Description copied from class:DifferentialFunction
The name of the op- Specified by:
opName
in interfaceOp
- Overrides:
opName
in classDifferentialFunction
- Returns:
- the opName of this operation
-
onnxName
public String onnxName()
Description copied from class:DifferentialFunction
The opName of this function in onnx
-
tensorflowName
public String tensorflowName()
Description copied from class:DifferentialFunction
The opName of this function tensorflow- Overrides:
tensorflowName
in classBaseOp
- Returns:
-
setZ
public void setZ(INDArray z)
Description copied from interface:Op
set z (the solution ndarray)
-
setPropertiesForFunction
public void setPropertiesForFunction(Map<String,Object> properties)
- Overrides:
setPropertiesForFunction
in classDifferentialFunction
-
calculateOutputShape
public List<LongShapeDescriptor> calculateOutputShape(OpContext oc)
- Overrides:
calculateOutputShape
in classDifferentialFunction
-
calculateOutputShape
public List<LongShapeDescriptor> calculateOutputShape()
Description copied from class:DifferentialFunction
Calculate the output shape for this op- Overrides:
calculateOutputShape
in classBaseRandomOp
- Returns:
- List of output shape descriptors
-
doDiff
public List<SDVariable> doDiff(List<SDVariable> f1)
Description copied from class:DifferentialFunction
The actual implementation for automatic differentiation.- Specified by:
doDiff
in classDifferentialFunction
- Returns:
-
calculateOutputDataTypes
public List<DataType> calculateOutputDataTypes(List<DataType> inputDataTypes)
Description copied from class:DifferentialFunction
Calculate the data types for the output arrays. Though datatypes can also be inferred fromDifferentialFunction.calculateOutputShape()
, this method differs in that it does not require the input arrays to be populated. This is important as it allows us to do greedy datatype inference for the entire net - even if arrays are not available.- Overrides:
calculateOutputDataTypes
in classBaseRandomOp
- Parameters:
inputDataTypes
- The data types of the inputs- Returns:
- The data types of the outputs
-
isTripleArgRngOp
public boolean isTripleArgRngOp()
- Overrides:
isTripleArgRngOp
in classBaseRandomOp
-
-