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, preUpdate
public 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 Listener
requiredVariables
in class BaseListener
public ListenerVariables otherRequiredVariables(SameDiff sd)
public final void epochStart(SameDiff sd, At at)
Listener
epochStart
in interface Listener
epochStart
in class BaseListener
sd
- The SameDiff instanceat
- Current iteration/epoch etcpublic final ListenerResponse epochEnd(SameDiff sd, At at, LossCurve lossCurve, long epochTimeMillis)
Listener
epochEnd
in interface Listener
epochEnd
in class BaseListener
sd
- 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)
Listener
validationDone
in interface Listener
validationDone
in class BaseListener
sd
- 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 detach() 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, INDArray[])
-
both contain the same information/arrays
activationAvailable
in interface Listener
activationAvailable
in class BaseListener
sd
- 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 © 2019. All rights reserved.