Skip to content

Instantly share code, notes, and snippets.

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.dl4j.test.project</groupId>
<artifactId>dl4j-lib</artifactId>
<version>1.0-SNAPSHOT</version>
<name>DL Lib</name>
<description>Forecasting lib using dl4j</description>
<properties>
package com.issue2548;
import org.deeplearning4j.nn.multilayer.MultiLayerNetwork;
import org.nd4j.linalg.api.buffer.DataBuffer;
import org.nd4j.linalg.api.buffer.util.DataTypeUtil;
import org.nd4j.linalg.api.ndarray.INDArray;
import org.nd4j.linalg.dataset.api.preprocessor.NormalizerStandardize;
import org.nd4j.linalg.factory.Nd4j;
import java.io.BufferedReader;
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
9
10
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
8
9
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
2
3
4
5
6
7
8
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
1
2
3
4
5
6
7
public class EvaluationExample {
public static void main(String... args) {
// where are the trained model and the corresponding normalizers stored ?
String modelPath = "data" + File.separator + "models" + File.separator;
String normalizerPath = "data" + File.separator + "normalizers" + File.separator;
String modelName = "train.model";
// define the paths to the train features, test features and test labels
public class TrainExample {
public static final int BATCH_SIZE = 100;
public static final int N_EPOCHS = 150;
public static void main(String... args) {
// define some paths where you would like to store the model
String modelPath = "data" + File.separator + "models" + File.separator;
String normalizerPath = "data" + File.separator + "normalizers" + File.separator;
public class SerializationUtils {
private final Logger logger = LoggerFactory.getLogger(getClass());
private String modelPath;
private String modelName;
private String normalizerPath;
private String configName;
public SerializationUtils(String modelPath, String modelName, String normalizerPath) {
hiddenWidth = 20;
MultiLayerConfiguration conf = new NeuralNetConfiguration.Builder()
.optimizationAlgo(OptimizationAlgorithm.STOCHASTIC_GRADIENT_DESCENT).iterations(1)
.learningRate(0.05476383804339002) // 0.02 with BPTT
.momentum(0.5358333571512998)
.seed(12345)
.regularization(true)
.l2(0.016384859214629816)
.dropOut(0.8145498131858961)