Skip to content

Instantly share code, notes, and snippets.

@ieee8023
Last active October 19, 2015 17:25
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 ieee8023/9f4313f769e498ab5ac5 to your computer and use it in GitHub Desktop.
Save ieee8023/9f4313f769e498ab5ac5 to your computer and use it in GitHub Desktop.
MultiLayerConfiguration.Builder builder = new NeuralNetConfiguration.Builder()
.seed(seed)
.batchSize(batchSize)
.optimizationAlgo(OptimizationAlgorithm.STOCHASTIC_GRADIENT_DESCENT)
.list(3)
.layer(0, new ConvolutionLayer.Builder(5, 5)
.nIn(nChannels)
.nOut(6)
.weightInit(WeightInit.XAVIER)
.activation("relu")
.build())
.layer(1, new SubsamplingLayer.Builder(SubsamplingLayer.PoolingType.MAX, new int[] {2,2})
.build())
.layer(2, new OutputLayer.Builder(LossFunctions.LossFunction.NEGATIVELOGLIKELIHOOD)
.nOut(outputNum)
.weightInit(WeightInit.XAVIER)
.activation("softmax")
.build())
.backprop(true).pretrain(false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment