public abstract class BaseEvaluationListener extends BaseListener
| Constructor and Description |
|---|
BaseEvaluationListener() |
| Modifier and Type | Method and Description |
|---|---|
void |
activationAvailable(SameDiff sd,
At at,
MultiDataSet batch,
SameDiffOp op,
String varName,
INDArray activation)
Called when any activation becomes available.
|
void |
activationAvailableEvaluations(SameDiff sd,
At at,
MultiDataSet batch,
SameDiffOp op,
String varName,
INDArray activation)
|
ListenerResponse |
epochEnd(SameDiff sd,
At at,
LossCurve lossCurve,
long epochTimeMillis)
Called at the end of every epoch, when fitting from an iterator
|
ListenerResponse |
epochEndEvaluations(SameDiff sd,
At at,
LossCurve lossCurve,
long epochTimeMillis,
EvaluationRecord evaluations)
See
Listener.epochEnd(SameDiff, At, LossCurve, long), also provided the requested evaluations |
void |
epochStart(SameDiff sd,
At at)
Called at the start of every epoch, when fitting from an iterator
|
void |
epochStartEvaluations(SameDiff sd,
At at)
|
abstract ListenerEvaluations |
evaluations()
Return the requested evaluations.
|
ListenerVariables |
otherRequiredVariables(SameDiff sd)
Return any requested variables that are not part of the evaluations
|
ListenerVariables |
requiredVariables(SameDiff sd)
Required variables for this listener.
|
ListenerResponse |
validationDone(SameDiff sd,
At at,
long validationTimeMillis)
Called after the end of every epoch, once validation evaluation is done, when training
|
ListenerResponse |
validationDoneEvaluations(SameDiff sd,
At at,
long validationTimeMillis,
EvaluationRecord evaluations)
See
Listener.validationDone(SameDiff, At, long), also provided the requested evaluations |
iterationDone, iterationStart, operationEnd, operationStart, opExecution, preOpExecution, preUpdatepublic abstract ListenerEvaluations evaluations()
public final ListenerVariables requiredVariables(SameDiff sd)
Listener
Used to ensure these variables end up in the minimum required subgraph calculated by InferenceSession.
Otherwise, if the variables weren't required by a loss variable, they would not be calculated.
Any variables in here are guaranteed to have Listener.activationAvailable(SameDiff, At, MultiDataSet, SameDiffOp, String, INDArray)
called for them, regardless of whether they would normally be calculated or not.
requiredVariables in interface ListenerrequiredVariables in class BaseListenerpublic ListenerVariables otherRequiredVariables(SameDiff sd)
public final void epochStart(SameDiff sd, At at)
ListenerepochStart in interface ListenerepochStart in class BaseListenersd - The SameDiff instanceat - Current iteration/epoch etcpublic final ListenerResponse epochEnd(SameDiff sd, At at, LossCurve lossCurve, long epochTimeMillis)
ListenerepochEnd in interface ListenerepochEnd in class BaseListenersd - The SameDiff instanceat - Current iteration/epoch etclossCurve - The losses so farepochTimeMillis - How long this epoch tookpublic ListenerResponse epochEndEvaluations(SameDiff sd, At at, LossCurve lossCurve, long epochTimeMillis, EvaluationRecord evaluations)
Listener.epochEnd(SameDiff, At, LossCurve, long), also provided the requested evaluationspublic final ListenerResponse validationDone(SameDiff sd, At at, long validationTimeMillis)
ListenervalidationDone in interface ListenervalidationDone in class BaseListenersd - The SameDiff instanceat - Current iteration/epoch etcvalidationTimeMillis - How long validation took for this epochpublic ListenerResponse validationDoneEvaluations(SameDiff sd, At at, long validationTimeMillis, EvaluationRecord evaluations)
Listener.validationDone(SameDiff, At, long), also provided the requested evaluationspublic final void activationAvailable(SameDiff sd, At at, MultiDataSet batch, SameDiffOp op, String varName, INDArray activation)
Listener
The activation will most likely be freed later, use dup() if you need to save it.
Note that this method will be called when any activation becomes available, not just ones from Listener.requiredVariables(SameDiff)
It is guaranteed to be called for variables from requiredVariables().
Note that the activations here overlap with Listener.opExecution(SameDiff, At, MultiDataSet, SameDiffOp, OpContext, INDArray[]) -
both contain the same information/arrays
activationAvailable in interface ListeneractivationAvailable in class BaseListenersd - The SameDiff instanceat - Current iteration/epoch etcbatch - The batch's input data. May be null if not called with a batchop - Operation that has just been executedvarName - The name of the variableactivation - The variable's activationpublic void activationAvailableEvaluations(SameDiff sd, At at, MultiDataSet batch, SameDiffOp op, String varName, INDArray activation)
Copyright © 2021. All rights reserved.