Package org.apache.spark.ml.ann
Interface Layer
- All Superinterfaces:
Serializable
Trait that holds Layer properties, that are needed to instantiate it.
Implements Layer instantiation.
-
Method Summary
Modifier and TypeMethodDescriptioncreateModel
(breeze.linalg.DenseVector<Object> initialWeights) Returns the instance of the layer based on weights provided.int
getOutputSize
(int inputSize) Returns the output size given the input size (not counting the stack size).Returns the instance of the layer with random generated weights.boolean
inPlace()
If true, the memory is not allocated for the output of this layer.int
Number of weights that is used to allocate memory for the weights vector
-
Method Details
-
createModel
Returns the instance of the layer based on weights provided. Size of weights must be equal to weightSize- Parameters:
initialWeights
- vector with layer weights- Returns:
- the layer model
-
getOutputSize
int getOutputSize(int inputSize) Returns the output size given the input size (not counting the stack size). Output size is used to allocate memory for the output.- Parameters:
inputSize
- input size- Returns:
- output size
-
inPlace
boolean inPlace()If true, the memory is not allocated for the output of this layer. The memory allocated to the previous layer is used to write the output of this layer. Developer can set this to true if computing delta of a previous layer does not involve its output, so the current layer can write there. This also mean that both layers have the same number of outputs.- Returns:
- (undocumented)
-
initModel
Returns the instance of the layer with random generated weights.- Parameters:
weights
- vector for weights initialization, must be equal to weightSizerandom
- random number generator- Returns:
- the layer model
-
weightSize
int weightSize()Number of weights that is used to allocate memory for the weights vector- Returns:
- (undocumented)
-