public interface Model
Modifier and Type | Method and Description |
---|---|
void |
accumulateScore(double accum)
Sets a rolling tally for the score.
|
void |
addListeners(IterationListener... listener)
This method ADDS additional IterationListener to existing listeners
|
void |
applyLearningRateScoreDecay()
Update learningRate using for this model.
|
int |
batchSize()
The current inputs batch size
|
void |
clear()
Clear input
|
void |
computeGradientAndScore()
Update the score
|
NeuralNetConfiguration |
conf()
The configuration for the neural network
|
void |
fit()
All models have a fit method
|
void |
fit(org.nd4j.linalg.api.ndarray.INDArray data)
Fit the model to the given data
|
org.nd4j.linalg.api.ndarray.INDArray |
getGradientsViewArray() |
ConvexOptimizer |
getOptimizer()
Returns this models optimizer
|
org.nd4j.linalg.api.ndarray.INDArray |
getParam(String param)
Get the parameter
|
Gradient |
gradient()
Calculate a gradient
|
org.nd4j.linalg.primitives.Pair<Gradient,Double> |
gradientAndScore()
Get the gradient and score
|
void |
init()
Init the model
|
void |
initParams()
Deprecated.
As of 0.7.3 - Feb 2017. Not used; neural network params are initialized by the parameter initializaters.
Furthermore, most implementations are unsupported or no-op.
|
org.nd4j.linalg.api.ndarray.INDArray |
input()
The input/feature matrix for the model
|
void |
iterate(org.nd4j.linalg.api.ndarray.INDArray input)
Run one iteration
|
int |
numParams()
the number of parameters for the model
|
int |
numParams(boolean backwards)
the number of parameters for the model
|
org.nd4j.linalg.api.ndarray.INDArray |
params()
Parameters of the model (if any)
|
Map<String,org.nd4j.linalg.api.ndarray.INDArray> |
paramTable()
The param table
|
Map<String,org.nd4j.linalg.api.ndarray.INDArray> |
paramTable(boolean backpropParamsOnly)
Table of parameters by key, for backprop
For many models (dense layers, etc) - all parameters are backprop parameters
|
double |
score()
The score for the model
|
void |
setBackpropGradientsViewArray(org.nd4j.linalg.api.ndarray.INDArray gradients)
Set the gradients array as a view of the full (backprop) network parameters
NOTE: this is intended to be used internally in MultiLayerNetwork and ComputationGraph, not by users.
|
void |
setConf(NeuralNetConfiguration conf)
Setter for the configuration
|
void |
setListeners(Collection<IterationListener> listeners)
Set the IterationListeners for the ComputationGraph (and all layers in the network)
|
void |
setListeners(IterationListener... listeners)
Set the IterationListeners for the ComputationGraph (and all layers in the network)
|
void |
setParam(String key,
org.nd4j.linalg.api.ndarray.INDArray val)
Set the parameter with a new ndarray
|
void |
setParams(org.nd4j.linalg.api.ndarray.INDArray params)
Set the parameters for this model.
|
void |
setParamsViewArray(org.nd4j.linalg.api.ndarray.INDArray params)
Set the initial parameters array as a view of the full (backprop) network parameters
NOTE: this is intended to be used internally in MultiLayerNetwork and ComputationGraph, not by users.
|
void |
setParamTable(Map<String,org.nd4j.linalg.api.ndarray.INDArray> paramTable)
Setter for the param table
|
void |
update(Gradient gradient)
Update layer weights and biases with gradient change
|
void |
update(org.nd4j.linalg.api.ndarray.INDArray gradient,
String paramType)
Perform one update applying the gradient
|
void |
validateInput()
Deprecated.
As of 0.7.3 - Feb 2017. No longer used, most implementations are unsupported or no-op.
|
void init()
void setListeners(Collection<IterationListener> listeners)
void setListeners(IterationListener... listeners)
void addListeners(IterationListener... listener)
listener
- void fit()
void update(Gradient gradient)
void update(org.nd4j.linalg.api.ndarray.INDArray gradient, String paramType)
gradient
- the gradient to applydouble score()
void computeGradientAndScore()
void accumulateScore(double accum)
accum
- the amount to accumorg.nd4j.linalg.api.ndarray.INDArray params()
int numParams()
int numParams(boolean backwards)
void setParams(org.nd4j.linalg.api.ndarray.INDArray params)
params
- the parameters for the modelvoid setParamsViewArray(org.nd4j.linalg.api.ndarray.INDArray params)
params
- a 1 x nParams row vector that is a view of the larger (MLN/CG) parameters arrayorg.nd4j.linalg.api.ndarray.INDArray getGradientsViewArray()
void setBackpropGradientsViewArray(org.nd4j.linalg.api.ndarray.INDArray gradients)
gradients
- a 1 x nParams row vector that is a view of the larger (MLN/CG) gradients arrayvoid applyLearningRateScoreDecay()
void fit(org.nd4j.linalg.api.ndarray.INDArray data)
data
- the data to fit the model tovoid iterate(org.nd4j.linalg.api.ndarray.INDArray input)
input
- the input to iterate onGradient gradient()
org.nd4j.linalg.primitives.Pair<Gradient,Double> gradientAndScore()
int batchSize()
NeuralNetConfiguration conf()
void setConf(NeuralNetConfiguration conf)
conf
- org.nd4j.linalg.api.ndarray.INDArray input()
@Deprecated void validateInput()
ConvexOptimizer getOptimizer()
org.nd4j.linalg.api.ndarray.INDArray getParam(String param)
param
- the key of the parameter@Deprecated void initParams()
Map<String,org.nd4j.linalg.api.ndarray.INDArray> paramTable(boolean backpropParamsOnly)
backpropParamsOnly
- If true, return backprop params only. If false: return all params (equivalent to
paramsTable())void setParamTable(Map<String,org.nd4j.linalg.api.ndarray.INDArray> paramTable)
paramTable
- void setParam(String key, org.nd4j.linalg.api.ndarray.INDArray val)
key
- the key to se tval
- the new ndarrayvoid clear()
Copyright © 2017. All rights reserved.