SHARE
TWEET

Untitled

a guest Sep 20th, 2019 92 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Activation actv = Activation.IDENTITY;
  2.         Activation outA = Activation.HARDSIGMOID;
  3.         MultiLayerConfiguration mlp = new NeuralNetConfiguration.Builder().weightInit(WeightInit.XAVIER)
  4.                 .activation(actv).optimizationAlgo(OptimizationAlgorithm.STOCHASTIC_GRADIENT_DESCENT).updater(updater)
  5.                 .list()
  6.                 .layer(0,
  7.                         new ConvolutionLayer.Builder().nIn(1).nOut(6).weightInit(WeightInit.XAVIER)
  8.                                 .activation(actv).stride(1, 1).kernelSize(5, 5).build())
  9.                 .layer(1,
  10.                         new SubsamplingLayer.Builder(SubsamplingLayer.PoolingType.MAX).kernelSize(2, 2).stride(2, 2)
  11.                                 .build())
  12.                 .layer(2,
  13.                         new ConvolutionLayer.Builder().nIn(6).nOut(16).weightInit(WeightInit.XAVIER)
  14.                                 .activation(actv).stride(1, 1).kernelSize(5, 5).build())
  15.                 .layer(3,
  16.                         new SubsamplingLayer.Builder(SubsamplingLayer.PoolingType.MAX).kernelSize(2, 2).stride(2, 2)
  17.                                 .build())
  18.                 .layer(4,
  19.                         new DenseLayer.Builder().nIn(256).nOut(16).activation(actv).weightInit(WeightInit.XAVIER)
  20.                                 .build())
  21.                 .layer(5,
  22.                         new DenseLayer.Builder().nIn(16).nOut(256).activation(actv).weightInit(WeightInit.XAVIER)
  23.                                 .build())
  24.                 .layer(6,
  25.                         new Deconvolution2D.Builder().nIn(16).nOut(6).weightInit(WeightInit.XAVIER)
  26.                                 .activation(actv).stride(1, 1).kernelSize(5, 5).build())
  27.                 .layer(7,
  28.                         new Deconvolution2D.Builder().nIn(6).nOut(6).weightInit(WeightInit.XAVIER)
  29.                                 .activation(actv).stride(1, 1).kernelSize(5, 5).build())
  30.                 .layer(8,
  31.                         new Deconvolution2D.Builder().nIn(6).nOut(1).weightInit(WeightInit.XAVIER)
  32.                                 .activation(actv).stride(1, 1).kernelSize(5, 5).build())
  33.                 .layer(9,
  34.                         new LossLayer.Builder().lossFunction(LossFunction.MSE).build())
  35.                 .inputPreProcessor(6, new FeedForwardToCnnPreProcessor(16, 16))
  36.                 .setInputType(InputType.convolutionalFlat(28, 28, 1))
  37.                 .build();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top