Package org.deeplearning4j.nn.weights
Class WeightInitUtil
- java.lang.Object
-
- org.deeplearning4j.nn.weights.WeightInitUtil
-
public class WeightInitUtil extends Object
Weight initialization utility- Author:
- Adam Gibson
-
-
Field Summary
Fields Modifier and Type Field Description static charDEFAULT_WEIGHT_INIT_ORDERDefault order for the arrays created by WeightInitUtil.
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static INDArrayinitWeights(double fanIn, double fanOut, int[] shape, WeightInit initScheme, Distribution dist, char order, INDArray paramView)Deprecated.static INDArrayinitWeights(double fanIn, double fanOut, int[] shape, WeightInit initScheme, Distribution dist, INDArray paramView)Deprecated.static INDArrayinitWeights(double fanIn, double fanOut, long[] shape, WeightInit initScheme, Distribution dist, char order, INDArray paramView)static INDArrayinitWeights(double fanIn, double fanOut, long[] shape, WeightInit initScheme, Distribution dist, INDArray paramView)Initializes a matrix with the given weight initialization scheme.static INDArrayreshapeWeights(int[] shape, INDArray paramsView)Reshape the parameters view, without modifying the paramsView array values.static INDArrayreshapeWeights(int[] shape, INDArray paramsView, char flatteningOrder)Reshape the parameters view, without modifying the paramsView array values.static INDArrayreshapeWeights(long[] shape, INDArray paramsView)Reshape the parameters view, without modifying the paramsView array values.static INDArrayreshapeWeights(long[] shape, INDArray paramsView, char flatteningOrder)Reshape the parameters view, without modifying the paramsView array values.
-
-
-
Field Detail
-
DEFAULT_WEIGHT_INIT_ORDER
public static final char DEFAULT_WEIGHT_INIT_ORDER
Default order for the arrays created by WeightInitUtil.- See Also:
- Constant Field Values
-
-
Method Detail
-
initWeights
@Deprecated public static INDArray initWeights(double fanIn, double fanOut, int[] shape, WeightInit initScheme, Distribution dist, INDArray paramView)
Deprecated.Initializes a matrix with the given weight initialization scheme. Note: Defaults to fortran ('f') order arrays for the weights. Use#initWeights(int[], WeightInit, Distribution, char, INDArray)to control this- Parameters:
shape- the shape of the matrixinitScheme- the scheme to use- Returns:
- a matrix of the specified dimensions with the specified distribution based on the initialization scheme
-
initWeights
public static INDArray initWeights(double fanIn, double fanOut, long[] shape, WeightInit initScheme, Distribution dist, INDArray paramView)
Initializes a matrix with the given weight initialization scheme. Note: Defaults to fortran ('f') order arrays for the weights. Use#initWeights(long[], WeightInit, Distribution, char, INDArray)to control this- Parameters:
shape- the shape of the matrixinitScheme- the scheme to use- Returns:
- a matrix of the specified dimensions with the specified distribution based on the initialization scheme
-
initWeights
@Deprecated public static INDArray initWeights(double fanIn, double fanOut, int[] shape, WeightInit initScheme, Distribution dist, char order, INDArray paramView)
Deprecated.
-
initWeights
public static INDArray initWeights(double fanIn, double fanOut, long[] shape, WeightInit initScheme, Distribution dist, char order, INDArray paramView)
-
reshapeWeights
public static INDArray reshapeWeights(int[] shape, INDArray paramsView)
Reshape the parameters view, without modifying the paramsView array values.- Parameters:
shape- Shape to reshapeparamsView- Parameters array view
-
reshapeWeights
public static INDArray reshapeWeights(long[] shape, INDArray paramsView)
Reshape the parameters view, without modifying the paramsView array values.- Parameters:
shape- Shape to reshapeparamsView- Parameters array view
-
reshapeWeights
public static INDArray reshapeWeights(int[] shape, INDArray paramsView, char flatteningOrder)
Reshape the parameters view, without modifying the paramsView array values.- Parameters:
shape- Shape to reshapeparamsView- Parameters array viewflatteningOrder- Order in which parameters are flattened/reshaped
-
reshapeWeights
public static INDArray reshapeWeights(long[] shape, INDArray paramsView, char flatteningOrder)
Reshape the parameters view, without modifying the paramsView array values.- Parameters:
shape- Shape to reshapeparamsView- Parameters array viewflatteningOrder- Order in which parameters are flattened/reshaped
-
-