Skip to content

Instantly share code, notes, and snippets.

**** Usage:
net.setListeners(new ConvolutionalIterationListener(10) );
**** Exception
Exception in thread "main" java.lang.IllegalArgumentException: bound must be positive
at java.util.Random.nextInt(Random.java:388)
at org.deeplearning4j.ui.weights.ConvolutionalIterationListener.iterationDone(ConvolutionalIterationListener.java:138)
at org.deeplearning4j.optimize.solvers.StochasticGradientDescent.optimize(StochasticGradientDescent.java:90)
at org.deeplearning4j.optimize.Solver.optimize(Solver.java:53)
at org.deeplearning4j.nn.multilayer.MultiLayerNetwork.fit(MultiLayerNetwork.java:1160)
*** PARAMS ***
int slots = 8; // Max character columns per row
int height = 64;
int width = 128;
int channels = 1;
protected double splitTrainTest = 0.7;
protected static int epochs = 64; // 30, 40
boolean save = true;
Examples labeled as AAA3228 classified by model as AICBV8107: 43 times
==========================Scores========================================
# of classes: 21440
Accuracy: 0.0000
Precision: 0.0000 (21439 classes excluded from average)
Recall: 0.0000 (21439 classes excluded from average)
F1 Score: NaN (21440 classes excluded from average)
Precision, recall & F1: macro-averaged (equally weighted avg. of 21440 classes)
@edobm
edobm / ArithmeticException
Created July 20, 2017 16:21
java.lang.ArithmeticException: / by zero
18:18:21.092 [main] INFO org.nd4j.linalg.factory.Nd4jBackend - Loaded [JCublasBackend] backend
18:18:22.285 [main] INFO org.nd4j.nativeblas.NativeOpsHolder - Number of threads used for NativeOps: 32
18:18:22.684 [main] DEBUG o.n.j.a.c.impl.BasicContextPool - Creating new stream for thread: [1], device: [0]...
18:18:22.688 [main] DEBUG o.n.j.a.c.impl.BasicContextPool - Creating new stream for thread: [1], device: [0]...
18:18:22.691 [main] DEBUG o.n.j.a.c.impl.BasicContextPool - Creating new stream for thread: [1], device: [0]...
18:18:22.694 [main] DEBUG o.n.j.a.c.impl.BasicContextPool - Creating new stream for thread: [1], device: [0]...
18:18:22.696 [main] DEBUG o.n.j.a.c.impl.BasicContextPool - Creating new stream for thread: [1], device: [0]...
18:18:22.698 [main] DEBUG o.n.j.a.c.impl.BasicContextPool - Creating new stream for thread: [1], device: [0]...
18:18:22.701 [main] DEBUG o.n.j.a.c.impl.BasicContextPool - Creating new stream for thread: [1], device: [0]...
18:18:22.703 [main] DEBUG o.n.j.a.c.imp
@edobm
edobm / Coding
Created July 20, 2017 12:50
AWS p2.16xlarge with pw + gradientsAccumulator
public class Detector {
int slots = 8; // Max character columns per row
int height = 64;
int width = 128;
int channels = 1;
protected double splitTrainTest = 0.9;
protected static int epochs = 100; // 30, 40
boolean save = true;
07:11:34.318 [main] INFO org.nd4j.linalg.factory.Nd4jBackend - Loaded [JCublasBackend] backend
07:11:35.543 [main] INFO org.nd4j.nativeblas.NativeOpsHolder - Number of threads used for NativeOps: 32
07:11:35.953 [main] DEBUG o.n.j.a.c.impl.BasicContextPool - Creating new stream for thread: [1], device: [0]...
07:11:35.957 [main] DEBUG o.n.j.a.c.impl.BasicContextPool - Creating new stream for thread: [1], device: [0]...
07:11:35.959 [main] DEBUG o.n.j.a.c.impl.BasicContextPool - Creating new stream for thread: [1], device: [0]...
07:11:35.961 [main] DEBUG o.n.j.a.c.impl.BasicContextPool - Creating new stream for thread: [1], device: [0]...
07:11:35.963 [main] DEBUG o.n.j.a.c.impl.BasicContextPool - Creating new stream for thread: [1], device: [0]...
07:11:35.965 [main] DEBUG o.n.j.a.c.impl.BasicContextPool - Creating new stream for thread: [1], device: [0]...
07:11:35.968 [main] DEBUG o.n.j.a.c.impl.BasicContextPool - Creating new stream for thread: [1], device: [0]...
07:11:35.970 [main] DEBUG o.n.j.a.c.imp
package com.arvato.lpd.cnn;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
15:27:55.774 [main] INFO org.nd4j.linalg.factory.Nd4jBackend - Loaded [JCublasBackend] backend
15:28:55.798 [main] INFO org.nd4j.nativeblas.NativeOpsHolder - Number of threads used for NativeOps: 32
15:28:56.654 [main] DEBUG o.n.j.a.c.impl.BasicContextPool - Creating new stream for thread: [1], device: [0]...
15:28:56.692 [main] DEBUG o.n.j.a.c.impl.BasicContextPool - Creating new stream for thread: [1], device: [0]...
15:28:56.704 [main] DEBUG o.n.j.a.c.impl.BasicContextPool - Creating new stream for thread: [1], device: [0]...
15:28:56.716 [main] DEBUG o.n.j.a.c.impl.BasicContextPool - Creating new stream for thread: [1], device: [0]...
15:28:56.732 [main] DEBUG o.n.j.a.c.impl.BasicContextPool - Creating new stream for thread: [1], device: [0]...
15:28:56.744 [main] DEBUG o.n.j.a.c.impl.BasicContextPool - Creating new stream for thread: [1], device: [0]...
15:28:56.756 [main] DEBUG o.n.j.a.c.impl.BasicContextPool - Creating new stream for thread: [1], device: [0]...
15:28:56.774 [main] DEBUG o.n.j.a.c.imp
*** Some fields ***
int SLOTS = 10; // Max character columns per row
int height = 64;
int width = 128;
int channels = 1;
protected double splitTrainTest = 0.9;
protected static int epochs = 60; // 30, 40
int seed = 781976;
@edobm
edobm / gist:cd6e90ba98074d47c37583b441450341
Created July 17, 2017 14:15
Exception with custom input vector 1x390
** Code Changes**
dataIter = new RecordReaderDataSetIterator(recordReader, batchSize, 1, 10 * 39);
scaler.fit(dataIter);
dataIter.setPreProcessor(scaler);
net.fit(dataIter);
** Exception being thrown now on 0.8.1-SNAPSHOT **
Train model....
16:11:15.087 [ADSI prefetch thread] DEBUG o.n.l.memory.abstracts.Nd4jWorkspace - Steps: 6
Exception in thread "ADSI prefetch thread" java.lang.RuntimeException: java.lang.UnsupportedOperationException