public abstract class BaseLayer extends Object implements Layer
Modifier and Type | Field and Description |
---|---|
protected org.nd4j.linalg.api.ndarray.INDArray |
b |
protected NeuralNetConfiguration |
conf |
protected org.nd4j.linalg.api.ndarray.INDArray |
dropoutMask |
protected org.nd4j.linalg.api.ndarray.INDArray |
input |
protected org.nd4j.linalg.api.ndarray.INDArray |
W |
Constructor and Description |
---|
BaseLayer(NeuralNetConfiguration conf,
org.nd4j.linalg.api.ndarray.INDArray W,
org.nd4j.linalg.api.ndarray.INDArray b,
org.nd4j.linalg.api.ndarray.INDArray input) |
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
|
protected void |
applyDropOutIfNecessary(org.nd4j.linalg.api.ndarray.INDArray input) |
Layer |
clone() |
NeuralNetConfiguration |
conf() |
protected org.nd4j.linalg.api.ndarray.INDArray |
createBias() |
protected org.nd4j.linalg.api.ndarray.INDArray |
createWeightMatrix() |
org.nd4j.linalg.api.ndarray.INDArray |
getB() |
org.nd4j.linalg.api.ndarray.INDArray |
getInput() |
org.nd4j.linalg.api.ndarray.INDArray |
getW() |
void |
merge(Layer l,
int batchSize)
Averages the given logistic regression
from a mini batch in to this one
|
org.nd4j.linalg.api.ndarray.INDArray |
preOutput(org.nd4j.linalg.api.ndarray.INDArray x)
Classify input
|
void |
setB(org.nd4j.linalg.api.ndarray.INDArray b) |
void |
setConfiguration(NeuralNetConfiguration conf) |
void |
setInput(org.nd4j.linalg.api.ndarray.INDArray input) |
void |
setW(org.nd4j.linalg.api.ndarray.INDArray W) |
String |
toString() |
Layer |
transpose()
Return a transposed copy of the weights/bias
(this means reverse the number of inputs and outputs on the weights)
|
protected org.nd4j.linalg.api.ndarray.INDArray W
protected org.nd4j.linalg.api.ndarray.INDArray b
protected org.nd4j.linalg.api.ndarray.INDArray input
protected NeuralNetConfiguration conf
protected org.nd4j.linalg.api.ndarray.INDArray dropoutMask
public BaseLayer(NeuralNetConfiguration conf, org.nd4j.linalg.api.ndarray.INDArray W, org.nd4j.linalg.api.ndarray.INDArray b, org.nd4j.linalg.api.ndarray.INDArray input)
protected org.nd4j.linalg.api.ndarray.INDArray createBias()
protected org.nd4j.linalg.api.ndarray.INDArray createWeightMatrix()
public org.nd4j.linalg.api.ndarray.INDArray preOutput(org.nd4j.linalg.api.ndarray.INDArray x)
preOutput
in interface Layer
x
- the input (can either be a matrix or vector)
If it's a matrix, each row is considered an example
and associated rows are classified accordingly.
Each row will be the likelihood of a label given that examplepublic org.nd4j.linalg.api.ndarray.INDArray activate()
Layer
public org.nd4j.linalg.api.ndarray.INDArray activate(org.nd4j.linalg.api.ndarray.INDArray input)
Layer
public NeuralNetConfiguration conf()
public void setConfiguration(NeuralNetConfiguration conf)
setConfiguration
in interface Layer
public org.nd4j.linalg.api.ndarray.INDArray getInput()
public void setInput(org.nd4j.linalg.api.ndarray.INDArray input)
protected void applyDropOutIfNecessary(org.nd4j.linalg.api.ndarray.INDArray input)
public void merge(Layer l, int batchSize)
l
- the logistic regression to average in to this onebatchSize
- the batch sizepublic Layer transpose()
Layer
Copyright © 2014. All rights reserved.