This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ds = ===========INPUT=================== | |
[[ 0.9206, 0.0396], | |
[ 1.1601, 1.1761], | |
[ 0.9884, 1.7857], | |
[ 0.3592, 1.5785], | |
[ 0.5957, 0.7707], | |
[ 0.9643, 1.8737], | |
[ 2.8688, 1.3088], | |
[ 2.5304, 0.0485], | |
[ 1.2180, 0.7743], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package xxxxx; | |
import java.util.Collections; | |
import java.util.List; | |
import java.util.Random; | |
import org.deeplearning4j.datasets.iterator.impl.ListDataSetIterator; | |
import org.deeplearning4j.nn.api.OptimizationAlgorithm; | |
import org.deeplearning4j.nn.conf.NeuralNetConfiguration; | |
import org.deeplearning4j.nn.conf.layers.DenseLayer; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Caused by: java.lang.RuntimeException: ND4J is probably missing dependencies. For more information, please refer to: http://nd4j.org/getstarted.html | |
at org.nd4j.nativeblas.NativeOpsHolder.<init>(NativeOpsHolder.java:68) | |
at org.nd4j.nativeblas.NativeOpsHolder.<clinit>(NativeOpsHolder.java:36) | |
... 35 more | |
Caused by: java.lang.UnsatisfiedLinkError: no jnind4jcpu in java.library.path | |
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867) | |
at java.lang.Runtime.loadLibrary0(Runtime.java:870) | |
at java.lang.System.loadLibrary(System.java:1122) | |
at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:1224) | |
at org.bytedeco.javacpp.Loader.load(Loader.java:982) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public ComputationGraph getComputationGraph(){ | |
ComputationGraph multiLayerNetwork; | |
NeuralNetConfiguration.Builder builder = new NeuralNetConfiguration.Builder(); | |
builder.seed(140); | |
builder.optimizationAlgo(OptimizationAlgorithm.STOCHASTIC_GRADIENT_DESCENT); | |
builder.weightInit(WeightInit.XAVIER); | |
Map<Integer, Double> lrSchedule = new HashMap<>(); | |
lrSchedule.put(0, 1e-2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
error info: | |
java.lang.IllegalStateException: Expected rank 4 mask array for 2D CNN layers. Mask arrays for 2D CNN layers must have shape [batchSize,channels,X,Y] where X = (1 or activationsHeight) and Y = (1 or activationsWidth): Got rank 2 array with shape [60, 1] | |
at org.deeplearning4j.util.ConvolutionUtils.cnn2dMaskReduction(ConvolutionUtils.java:602) | |
at org.deeplearning4j.nn.layers.convolution.ConvolutionLayer.feedForwardMaskArray(ConvolutionLayer.java:473) | |
at org.deeplearning4j.nn.graph.vertex.impl.LayerVertex.feedForwardMaskArrays(LayerVertex.java:196) | |
at org.deeplearning4j.nn.graph.ComputationGraph.setLayerMaskArrays(ComputationGraph.java:3689) | |
at org.deeplearning4j.nn.graph.ComputationGraph.fitHelper(ComputationGraph.java:1115) | |
at org.deeplearning4j.nn.graph.ComputationGraph.fit(ComputationGraph.java:1097) | |
at org.deeplearning4j.nn.graph.ComputationGraph.fit(ComputationGraph.java:962) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.liweigu.dls.competition.srad; | |
import java.io.IOException; | |
import java.util.HashMap; | |
import java.util.Map; | |
import org.deeplearning4j.nn.api.OptimizationAlgorithm; | |
import org.deeplearning4j.nn.conf.BackpropType; | |
import org.deeplearning4j.nn.conf.GradientNormalization; | |
import org.deeplearning4j.nn.conf.InputPreProcessor; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
network: | |
GraphBuilder graphBuilder = builder.graphBuilder().backpropType(BackpropType.Standard).addInputs("inputs") | |
.addLayer("cnn1", | |
new ConvolutionLayer.Builder(new int[] { kernelSize1, kernelSize1 }, | |
new int[] { cnnStride1, cnnStride1 }, | |
new int[] { padding, padding }) | |
.nIn(channels) | |
.nOut(64) | |
inputPreProcessors.put("cnn1", new RnnToCnnPreProcessor(501, 501, channels)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Error Log: | |
java.lang.IllegalStateException: Backprop: array (ACTIVATION_GRAD) workspace validation failed (vertex lstm1 - class: GravesLSTM) - array is defined in incorrect workspace | |
at org.deeplearning4j.nn.graph.ComputationGraph.validateArrayWorkspaces(ComputationGraph.java:1708) | |
at org.deeplearning4j.nn.graph.ComputationGraph.calcBackpropGradients(ComputationGraph.java:2435) | |
at org.deeplearning4j.nn.graph.ComputationGraph.computeGradientAndScore(ComputationGraph.java:1319) | |
at org.deeplearning4j.nn.graph.ComputationGraph.computeGradientAndScore(ComputationGraph.java:1280) | |
at org.deeplearning4j.optimize.solvers.BaseOptimizer.gradientAndScore(BaseOptimizer.java:178) | |
at org.deeplearning4j.optimize.solvers.StochasticGradientDescent.optimize(StochasticGradientDescent.java:60) | |
at org.deeplearning4j.optimize.Solver.optimize(Solver.java:54) | |
at org.deeplearning4j.nn.graph.ComputationGraph.fit(ComputationGraph.java:1104) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MultiLayerConfiguration | |
int OutDemension = 2; | |
ListBuilder listBuilder = builder.list(); | |
int layerIndex = 0; | |
listBuilder.layer(layerIndex++, new GravesLSTM.Builder().activation(Activation.SOFTSIGN) // SOFTSIGN, TANH, RELU, SIGMOID | |
.nIn(inNum).nOut(hiddenCount).build()); | |
listBuilder.layer(layerIndex++, new GravesLSTM.Builder().activation(Activation.SOFTSIGN) | |
.nIn(hiddenCount).nOut(hiddenCount).build()); | |
listBuilder.layer(layerIndex++, new DenseLayer.Builder().activation(Activation.TANH) | |
.nIn(hiddenCount).nOut(denseLayerHiddenCount).build()); |