Skip to content

Instantly share code, notes, and snippets.

@jvence
Created April 21, 2016 10:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jvence/c011235a00dbd767909efb3f34b2a2b1 to your computer and use it in GitHub Desktop.
Save jvence/c011235a00dbd767909efb3f34b2a2b1 to your computer and use it in GitHub Desktop.
MultiLayerConfiguration conf = new NeuralNetConfiguration.Builder()
.seed(seed)
.iterations(1)
.optimizationAlgo(OptimizationAlgorithm.STOCHASTIC_GRADIENT_DESCENT)
.learningRate(learningRate)
.updater(Updater.NESTEROVS).momentum(0.9)
.list(2)
.layer(0, new DenseLayer.Builder().nIn(numInputs).nOut(numHiddenNodes)
.weightInit(WeightInit.XAVIER)
.activation("relu")
.build())
.layer(1, new OutputLayer.Builder(LossFunction.NEGATIVELOGLIKELIHOOD)
.weightInit(WeightInit.XAVIER)
.activation("softmax")
.nIn(numHiddenNodes).nOut(numOutputs).build())
.pretrain(false).backprop(true).build();
MultiLayerNetwork model = new MultiLayerNetwork(conf);
model.init();
model.setListeners(new ScoreIterationListener(1));
@jvence
Copy link
Author

jvence commented Apr 21, 2016

[-0.20,-0.31,-0.32,-0.16,0.00,-0.20,-0.19,-0.16,-0.15,-0.11,-0.08,-0.00,0.33,1.08,1.08,-1.39,-0.97,-1.18,�]
[-0.31,-0.16,-0.26,-0.20,0.00,-0.31,-0.25,-0.22,-0.21,-0.18,-0.15,-0.08,0.21,0.86,0.86,-0.97,-0.97,-1.18,�]
[-0.32,-0.24,-0.38,-0.30,0.00,-0.32,-0.27,-0.24,-0.23,-0.21,-0.18,-0.11,0.16,0.77,0.77,-0.55,-0.97,-1.18,�]
[-0.46,-0.50,-0.49,-0.38,0.00,-0.46,-0.36,-0.29,-0.29,-0.26,-0.23,-0.18,0.06,0.59,0.59,-0.13,-0.97,-1.18,�]
[-0.37,-0.45,-0.31,-0.32,0.00,-0.37,-0.38,-0.31,-0.30,-0.27,-0.25,-0.19,0.04,0.55,0.55,-0.55,-0.97,-1.18,�]
[-0.50,-0.34,-0.46,-0.38,0.00,-0.50,-0.44,-0.33,-0.33,-0.30,-0.28,-0.23,-0.02,0.45,0.45,-0.13,-0.97,-1.18,�]

@jvence
Copy link
Author

jvence commented Apr 21, 2016

Pre:
[[50.44,50.07,50.54,50.05,0.00,50.44,50.44,50.44,50.44,50.44,50.44,50.44,50.44,50.44,50.44,0.00,0.00,0.00,0.00]
[50.07,50.54,50.71,49.91,0.00,50.07,50.26,50.26,50.26,50.26,50.26,50.26,50.26,50.26,50.26,1.00,0.00,0.00,0.00]
[50.04,50.30,50.34,49.59,0.00,50.04,50.18,50.18,50.18,50.18,50.18,50.18,50.18,50.18,50.18,2.00,0.00,0.00,0.00]
[49.59,49.46,49.96,49.36,0.00,49.59,49.90,50.03,50.03,50.03,50.03,50.03,50.03,50.03,50.03,3.00,0.00,0.00,0.00]

Post normalizeZeroMeanZeroUnitVariance:
[[-0.20,-0.31,-0.32,-0.16,0.00,-0.20,-0.19,-0.16,-0.15,-0.11,-0.08,-0.00,0.33,1.08,1.08,-1.39,-0.97,-1.18,�]
[-0.31,-0.16,-0.26,-0.20,0.00,-0.31,-0.25,-0.22,-0.21,-0.18,-0.15,-0.08,0.21,0.86,0.86,-0.97,-0.97,-1.18,�]
[-0.32,-0.24,-0.38,-0.30,0.00,-0.32,-0.27,-0.24,-0.23,-0.21,-0.18,-0.11,0.16,0.77,0.77,-0.55,-0.97,-1.18,�]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment