public interface Layer extends Serializable, Cloneable, Model
Modifier and Type | Interface and Description |
---|---|
static class |
Layer.Type |
Modifier and Type | Method and Description |
---|---|
org.nd4j.linalg.api.ndarray.INDArray |
activate()
Trigger an activation with the last specified input
|
org.nd4j.linalg.api.ndarray.INDArray |
activate(org.nd4j.linalg.api.ndarray.INDArray input)
Initialize the layer with the given input
and return the activation for this layer
given this input
|
org.nd4j.linalg.api.ndarray.INDArray |
activationMean()
Calculate the mean representation
for the activation for this layer
|
Pair<Gradient,Gradient> |
backWard(Gradient errors,
Gradient deltas,
org.nd4j.linalg.api.ndarray.INDArray activation,
String previousActivation)
Propagate errors backwards for a particular layer.
|
Gradient |
backwardGradient(org.nd4j.linalg.api.ndarray.INDArray activation,
Gradient errorSignal)
Calculate the gradient relative to the
error in the next layer
|
Gradient |
calcGradient(Gradient layerError,
org.nd4j.linalg.api.ndarray.INDArray indArray)
Calculate the gradient
|
Layer |
clone()
Clone the layer
|
org.nd4j.linalg.api.ndarray.INDArray |
derivativeActivation(org.nd4j.linalg.api.ndarray.INDArray input)
Take the derivative of the given input
based on the activation
|
Gradient |
error(org.nd4j.linalg.api.ndarray.INDArray input)
Calculate error with respect to the
current layer.
|
Gradient |
errorSignal(Gradient error,
org.nd4j.linalg.api.ndarray.INDArray input)
Error signal for this layer
Using the amount of error
caused by this layer
calculate the error signal used
as input in to the next layer.
|
Collection<IterationListener> |
getIterationListeners()
Get the iteration listeners for this layer.
|
void |
merge(Layer layer,
int batchSize)
Parameter averaging
|
org.nd4j.linalg.api.ndarray.INDArray |
preOutput(org.nd4j.linalg.api.ndarray.INDArray x)
Raw activations
|
void |
setIterationListeners(Collection<IterationListener> listeners)
Set the iteration listeners for this layer.
|
Layer |
transpose()
Return a transposed copy of the weights/bias
(this means reverse the number of inputs and outputs on the weights)
|
Layer.Type |
type()
Returns the layer type
|
accumulateScore, batchSize, clear, conf, fit, fit, getOptimizer, getParam, gradient, gradientAndScore, initParams, input, iterate, numParams, params, paramTable, score, setConf, setParam, setParams, setParamTable, setScore, transform, update, validateInput
Layer.Type type()
Gradient error(org.nd4j.linalg.api.ndarray.INDArray input)
input
- the gradient for the forward layer
If this is the final layer, it will start
with the error from the output.
This is on the user to initialize.org.nd4j.linalg.api.ndarray.INDArray derivativeActivation(org.nd4j.linalg.api.ndarray.INDArray input)
input
- the input to take the derivative ofGradient calcGradient(Gradient layerError, org.nd4j.linalg.api.ndarray.INDArray indArray)
layerError
- the layer errorindArray
- Gradient errorSignal(Gradient error, org.nd4j.linalg.api.ndarray.INDArray input)
error
- input
- Gradient backwardGradient(org.nd4j.linalg.api.ndarray.INDArray activation, Gradient errorSignal)
activation
- the activation from the networkerrorSignal
- the error signal caused by this network.void merge(Layer layer, int batchSize)
layer
- the layer to mergebatchSize
- the batch size to merge onorg.nd4j.linalg.api.ndarray.INDArray activationMean()
org.nd4j.linalg.api.ndarray.INDArray preOutput(org.nd4j.linalg.api.ndarray.INDArray x)
x
- the input to transformorg.nd4j.linalg.api.ndarray.INDArray activate()
org.nd4j.linalg.api.ndarray.INDArray activate(org.nd4j.linalg.api.ndarray.INDArray input)
input
- the input to useLayer transpose()
Layer clone()
Pair<Gradient,Gradient> backWard(Gradient errors, Gradient deltas, org.nd4j.linalg.api.ndarray.INDArray activation, String previousActivation)
errors
- the errors to propagatedeltas
- the previous deltaspreviousActivation
- the previous layer's activationactivation
- the activation from the previous layerCollection<IterationListener> getIterationListeners()
void setIterationListeners(Collection<IterationListener> listeners)
Copyright © 2015. All Rights Reserved.