public class ExecDebuggingListener extends BaseListener
(iter=0,epoch=0,op=1) org.nd4j.linalg.api.ops.impl.transforms.pairwise.arithmetic.AddOp
(iter=1,epoch=0,op=3) org.nd4j.linalg.api.ops.impl.loss.LogLoss
iArgs=[3]
tArgs=[1.0E-7]
Input[0]=Rank: 2, DataType: FLOAT, Offset: 0, Order: c, Shape: [1,2], Stride: [1,1]
Input[1]=Rank: 0, DataType: FLOAT, Offset: 0, Order: c, Shape: [], Stride: []
Input[2]=Rank: 2, DataType: FLOAT, Offset: 0, Order: c, Shape: [1,2], Stride: [1,1]
Outputs[0]=Rank: 0, DataType: FLOAT, Offset: 0, Order: c, Shape: [], Stride: []
REPRODUCE: Print runnable Java code that should reproduce that op execution (other than perhaps exact input/output strides). For example:
(iter=2,epoch=0,op=1) org.nd4j.linalg.api.ops.impl.transforms.pairwise.arithmetic.AddOp
DynamicCustomOp op = new org.nd4j.linalg.api.ops.impl.transforms.pairwise.arithmetic.AddOp();
INDArray[] inputs = new INDArray[2];
inputs[0] = Nd4j.createFromArray(1.5253239f, 0.8733858f).reshape(1, 2);
inputs[1] = Nd4j.createFromArray(0.483428f, 0.86025196f).reshape(1, 2);
op.addInputArgument(inputs);
INDArray[] outputs = new INDArray[1];
outputs[0] = Nd4j.createFromArray(2.012087f, 1.7303026f).reshape(1, 2);
op.addOutputArgument(outputs);
Nd4j.exec(op);
Modifier and Type | Class and Description |
---|---|
static class |
ExecDebuggingListener.PrintMode |
Constructor and Description |
---|
ExecDebuggingListener(ExecDebuggingListener.PrintMode printMode,
int maxIterations,
boolean logIter) |
Modifier and Type | Method and Description |
---|---|
boolean |
isActive(Operation operation)
Returns whether this listener is active during the given operation.
|
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, iterationDone, iterationStart, operationEnd, operationStart, opExecution, preUpdate, requiredVariables, validationDone
public ExecDebuggingListener(ExecDebuggingListener.PrintMode printMode, int maxIterations, boolean logIter)
printMode
- Print mode, see ExecDebuggingListener.PrintMode
maxIterations
- Maximum number of iterations to print. <= 0 for "all iterations"logIter
- If true: prefix iteration/epoch, such as "(iter=1,epoch=0,op=3)" to the outputpublic boolean isActive(Operation operation)
Listener
public 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 executedCopyright © 2020. All rights reserved.