public interface Model
Modifier and Type | Method and Description |
---|---|
void |
addListeners(TrainingListener... listener)
This method ADDS additional TrainingListener to existing listeners
|
void |
applyConstraints(int iteration,
int epoch)
Apply any constraints to the model
|
int |
batchSize()
The current inputs batch size
|
void |
clear()
Clear input
|
void |
close() |
void |
computeGradientAndScore(LayerWorkspaceMgr workspaceMgr)
Update the score
|
NeuralNetConfiguration |
conf()
The configuration for the neural network
|
void |
fit()
Deprecated.
|
void |
fit(INDArray data,
LayerWorkspaceMgr workspaceMgr)
Fit the model to the given data
|
INDArray |
getGradientsViewArray() |
ConvexOptimizer |
getOptimizer()
Returns this models optimizer
|
INDArray |
getParam(String param)
Get the parameter
|
Gradient |
gradient()
Get the gradient.
|
Pair<Gradient,Double> |
gradientAndScore()
Get the gradient and score
|
void |
init()
Init the model
|
INDArray |
input()
The input/feature matrix for the model
|
long |
numParams()
the number of parameters for the model
|
long |
numParams(boolean backwards)
the number of parameters for the model
|
INDArray |
params()
Parameters of the model (if any)
|
Map<String,INDArray> |
paramTable()
The param table
|
Map<String,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(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<TrainingListener> listeners)
Set the trainingListeners for the ComputationGraph (and all layers in the network)
|
void |
setListeners(TrainingListener... listeners)
Set the trainingListeners for the ComputationGraph (and all layers in the network)
|
void |
setParam(String key,
INDArray val)
Set the parameter with a new ndarray
|
void |
setParams(INDArray params)
Set the parameters for this model.
|
void |
setParamsViewArray(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,INDArray> paramTable)
Setter for the param table
|
void |
update(Gradient gradient)
Update layer weights and biases with gradient change
|
void |
update(INDArray gradient,
String paramType)
Perform one update applying the gradient
|
void init()
void setListeners(Collection<TrainingListener> listeners)
void setListeners(TrainingListener... listeners)
void addListeners(TrainingListener... listener)
listener
- @Deprecated void fit()
void update(Gradient gradient)
void update(INDArray gradient, String paramType)
gradient
- the gradient to applydouble score()
void computeGradientAndScore(LayerWorkspaceMgr workspaceMgr)
INDArray params()
long numParams()
long numParams(boolean backwards)
void setParams(INDArray params)
params
- the parameters for the modelvoid setParamsViewArray(INDArray params)
params
- a 1 x nParams row vector that is a view of the larger (MLN/CG) parameters arrayINDArray getGradientsViewArray()
void setBackpropGradientsViewArray(INDArray gradients)
gradients
- a 1 x nParams row vector that is a view of the larger (MLN/CG) gradients arrayvoid fit(INDArray data, LayerWorkspaceMgr workspaceMgr)
data
- the data to fit the model toGradient gradient()
computeGradientAndScore(LayerWorkspaceMgr)
} .Pair<Gradient,Double> gradientAndScore()
int batchSize()
NeuralNetConfiguration conf()
void setConf(NeuralNetConfiguration conf)
conf
- INDArray input()
ConvexOptimizer getOptimizer()
INDArray getParam(String param)
param
- the key of the parameterMap<String,INDArray> paramTable(boolean backpropParamsOnly)
backpropParamsOnly
- If true, return backprop params only. If false: return all params (equivalent to
paramsTable())void setParamTable(Map<String,INDArray> paramTable)
paramTable
- void setParam(String key, INDArray val)
key
- the key to se tval
- the new ndarrayvoid clear()
void applyConstraints(int iteration, int epoch)
void close()
Copyright © 2021. All rights reserved.