public class ProfilingListener extends BaseListener
builder(File)
:ProfileAnalyzer
Modifier and Type | Class and Description |
---|---|
static class |
ProfilingListener.Builder |
Modifier | Constructor and Description |
---|---|
protected |
ProfilingListener(@NonNull File outputFile,
boolean all,
int warmup,
int nIter,
long nMs,
Operation[] operations) |
Modifier and Type | Method and Description |
---|---|
static ProfilingListener.Builder |
builder(File outputFile)
Create a new builder
|
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
|
static org.nd4j.shade.jackson.databind.ObjectMapper |
jsonMapper()
Get a new JSON mapper for use in serializing/deserializing JSON format
|
void |
operationEnd(SameDiff sd,
Operation op)
Called at the end of an operation, e.g.
|
void |
operationStart(SameDiff sd,
Operation op)
Called at the start of an operation, e.g.
|
void |
opExecution(SameDiff sd,
At at,
MultiDataSet batch,
SameDiffOp op,
OpContext opContext,
INDArray[] outputs)
Called at the end of each operation execution
|
void |
preOpExecution(SameDiff sd,
At at,
SameDiffOp op,
OpContext opContext)
Called just before each operation is executed (native code called, etc) - after all inputs etc have been set
|
activationAvailable, epochEnd, epochStart, iterationStart, preUpdate, requiredVariables, validationDone
public boolean isActive(Operation operation)
Listener
public void operationStart(SameDiff sd, Operation op)
Listener
operationStart
in interface Listener
operationStart
in class BaseListener
sd
- The SameDiff instanceop
- The operation being startedpublic void operationEnd(SameDiff sd, Operation op)
Listener
operationEnd
in interface Listener
operationEnd
in class BaseListener
sd
- The SameDiff instanceop
- The operation being startedpublic 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 preOpExecution(SameDiff sd, At at, SameDiffOp op, OpContext opContext)
Listener
preOpExecution
in interface Listener
preOpExecution
in class BaseListener
sd
- The SameDiff instanceat
- Current iteration/epoch etcop
- Operation that has just been executedpublic void opExecution(SameDiff sd, At at, MultiDataSet batch, SameDiffOp op, OpContext opContext, 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 static org.nd4j.shade.jackson.databind.ObjectMapper jsonMapper()
public static ProfilingListener.Builder builder(File outputFile)
outputFile
- Output file. Will be overwritten if file already existsCopyright © 2020. All rights reserved.