public class UIListener extends BaseListener
UIListener l = UIListener.builder(f)
//Plot loss curve, at every iteration (enabled and set to 1 by default)
.plotLosses(1)
//Plot the training set evaluation metrics: accuracy and f1 score
.trainEvaluationMetrics("softmax", 0, Evaluation.Metric.ACCURACY, Evaluation.Metric.F1)
//Plot the parameter to update:ratios for each parameter, every 10 iterations
.updateRatios(10)
.build();
UIListener.FileMode
for configuration/detailsModifier and Type | Class and Description |
---|---|
static class |
UIListener.Builder |
static class |
UIListener.FileMode
Default: FileMode.CREATE_OR_APPEND
The mode for handling behaviour when an existing UI file already exists CREATE: Only allow new file creation. |
static class |
UIListener.HistogramType
Used to specify which histograms should be collected.
|
static class |
UIListener.TestEvaluation |
static class |
UIListener.UpdateRatio
Used to specify how the Update:Parameter ratios are computed.
|
Modifier and Type | Method and Description |
---|---|
static UIListener.Builder |
builder(File logFile) |
protected void |
checkStructureForRestore(SameDiff sd) |
ListenerResponse |
epochEnd(SameDiff sd,
At at,
LossCurve lossCurve,
long epochTimeMillis)
Called at the end of every epoch, when fitting from an iterator
|
void |
epochStart(SameDiff sd,
At at)
Called at the start of every epoch, when fitting from an iterator
|
protected void |
initalizeWriter(SameDiff sd) |
protected void |
initializeHelper(SameDiff sd) |
boolean |
isActive(Operation operation)
Returns whether this listener is active during the given operation.
|
void |
iterationDone(SameDiff sd,
At at,
MultiDataSet dataSet,
Loss loss)
Called at the end of every iteration, after all operations (including updating parameters) has been completed
|
void |
iterationStart(SameDiff sd,
At at,
MultiDataSet data,
long etlMs)
Called at the start of every iteration (minibatch), before any operations have been executed
|
void |
opExecution(SameDiff sd,
At at,
MultiDataSet batch,
SameDiffOp op,
INDArray[] outputs)
Called at the end of each operation execution
|
void |
preUpdate(SameDiff sd,
At at,
Variable v,
INDArray update)
Called just before each parameter is to be updated - i.e., just before each parameter is modified.
|
protected void |
restoreLogFile() |
activationAvailable, operationEnd, operationStart, preOpExecution, requiredVariables, validationDone
protected void restoreLogFile()
protected void checkStructureForRestore(SameDiff sd)
protected void initalizeWriter(SameDiff sd)
protected void initializeHelper(SameDiff sd) throws IOException
IOException
public boolean isActive(Operation operation)
Listener
public void epochStart(SameDiff sd, At at)
Listener
epochStart
in interface Listener
epochStart
in class BaseListener
sd
- The SameDiff instanceat
- Current iteration/epoch etcpublic 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 void iterationStart(SameDiff sd, At at, MultiDataSet data, long etlMs)
Listener
iterationStart
in interface Listener
iterationStart
in class BaseListener
sd
- The SameDiff instanceat
- Current iteration/epoch etcpublic void iterationDone(SameDiff sd, At at, MultiDataSet dataSet, Loss loss)
Listener
iterationDone
in interface Listener
iterationDone
in class BaseListener
sd
- The SameDiff instanceat
- Current iteration/epoch etcdataSet
- The current dataset (minibatch) used for trainingloss
- The loss value for the current minibatch. Will be null except for during trainingpublic void opExecution(SameDiff sd, At at, MultiDataSet batch, SameDiffOp op, INDArray[] outputs)
Listener
Note: Outputs will most likely be freed later, use detach() if you need to save it.
opExecution
in interface Listener
opExecution
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 executedoutputs
- The output arrays for the just-executed operationpublic void preUpdate(SameDiff sd, At at, Variable v, INDArray update)
Listener
preUpdate
in interface Listener
preUpdate
in class BaseListener
sd
- SameDiff instanceat
- The current iteration/epoch etcv
- Variable about to be updated during backpropupdate
- The array representing the update (i.e., the gradient after applying learning rate, momentum, etc)public static UIListener.Builder builder(File logFile)
Copyright © 2019. All rights reserved.