|
1 | 1 | package org.deeplearning4j.examples.samediff.training;
|
2 | 2 |
|
3 |
| -import static org.deeplearning4j.examples.samediff.training.SameDiffMNISTTrainingExample.makeMNISTNet; |
4 |
| - |
5 |
| -import java.util.Arrays; |
6 |
| -import java.util.List; |
7 | 3 | import org.deeplearning4j.datasets.iterator.impl.MnistDataSetIterator;
|
8 | 4 | import org.deeplearning4j.examples.samediff.tfimport.SameDiffTransferLearningExample;
|
9 |
| -import org.nd4j.autodiff.listeners.At; |
10 |
| -import org.nd4j.autodiff.listeners.BaseEvaluationListener; |
11 |
| -import org.nd4j.autodiff.listeners.BaseListener; |
12 |
| -import org.nd4j.autodiff.listeners.Listener; |
13 |
| -import org.nd4j.autodiff.listeners.ListenerVariables; |
14 |
| -import org.nd4j.autodiff.listeners.Operation; |
15 |
| -import org.nd4j.autodiff.listeners.impl.ScoreListener; |
| 5 | +import org.nd4j.autodiff.listeners.*; |
16 | 6 | import org.nd4j.autodiff.listeners.records.History;
|
17 |
| -import org.nd4j.autodiff.samediff.SDVariable; |
18 | 7 | import org.nd4j.autodiff.samediff.SameDiff;
|
19 | 8 | import org.nd4j.autodiff.samediff.TrainingConfig;
|
20 | 9 | import org.nd4j.autodiff.samediff.internal.SameDiffOp;
|
21 |
| -import org.nd4j.evaluation.classification.Evaluation; |
22 | 10 | import org.nd4j.evaluation.classification.Evaluation.Metric;
|
23 |
| -import org.nd4j.linalg.api.buffer.DataType; |
24 | 11 | import org.nd4j.linalg.api.ndarray.INDArray;
|
25 |
| -import org.nd4j.linalg.api.ops.impl.layers.convolution.config.Conv2DConfig; |
26 |
| -import org.nd4j.linalg.api.ops.impl.layers.convolution.config.Pooling2DConfig; |
27 | 12 | import org.nd4j.linalg.dataset.api.MultiDataSet;
|
28 | 13 | import org.nd4j.linalg.dataset.api.iterator.DataSetIterator;
|
29 | 14 | import org.nd4j.linalg.learning.config.Adam;
|
30 |
| -import org.nd4j.weightinit.impl.XavierInitScheme; |
| 15 | + |
| 16 | +import java.util.List; |
| 17 | + |
| 18 | +import static org.deeplearning4j.examples.samediff.training.SameDiffMNISTTrainingExample.makeMNISTNet; |
31 | 19 |
|
32 | 20 | /**
|
33 | 21 | * This example shows how to use a custom listener, and is based on the {@link SameDiffMNISTTrainingExample}.<br><br>
|
|
40 | 28 | * If you want to use evaluations in your listener, look at {@link BaseEvaluationListener}.
|
41 | 29 | *
|
42 | 30 | */
|
| 31 | +@SuppressWarnings("DuplicatedCode") |
43 | 32 | public class SameDiffCustomListenerExample {
|
44 | 33 |
|
45 | 34 | public static void main(String[] args) throws Exception {
|
@@ -84,7 +73,7 @@ public static void main(String[] args) throws Exception {
|
84 | 73 | */
|
85 | 74 | public static class CustomListener extends BaseListener {
|
86 | 75 |
|
87 |
| - public INDArray z; |
| 76 | + INDArray z; |
88 | 77 | public INDArray out;
|
89 | 78 |
|
90 | 79 | // Specify that this listener is active during inference operations
|
|
0 commit comments