use of com.simiacryptus.mindseye.layers.cudnn.PoolingLayer in project MindsEye by SimiaCryptus.
the class RecursiveSubspaceTest method buildModel.
@Override
public DAGNetwork buildModel(@Nonnull NotebookOutput log) {
log.h3("Model");
log.p("We use a multi-level convolution network");
return log.code(() -> {
@Nonnull final PipelineNetwork network = new PipelineNetwork();
double weight = 1e-3;
@Nonnull DoubleSupplier init = () -> weight * (Math.random() - 0.5);
network.add(new ConvolutionLayer(3, 3, 1, 5).set(init));
network.add(new ImgBandBiasLayer(5));
network.add(new PoolingLayer().setMode(PoolingLayer.PoolingMode.Max));
network.add(new ActivationLayer(ActivationLayer.Mode.RELU));
network.add(newNormalizationLayer());
network.add(new ConvolutionLayer(3, 3, 5, 5).set(init));
network.add(new ImgBandBiasLayer(5));
network.add(new PoolingLayer().setMode(PoolingLayer.PoolingMode.Max));
network.add(new ActivationLayer(ActivationLayer.Mode.RELU));
network.add(newNormalizationLayer());
network.add(new BiasLayer(7, 7, 5));
network.add(new FullyConnectedLayer(new int[] { 7, 7, 5 }, new int[] { 10 }).set(init));
network.add(new SoftmaxActivationLayer());
return network;
});
}
use of com.simiacryptus.mindseye.layers.cudnn.PoolingLayer in project MindsEye by SimiaCryptus.
the class ConvPipelineTest method buildList_1.
/**
* Build list 1 nn layer [ ].
*
* @return the nn layer [ ]
*/
public static Layer[] buildList_1() {
@Nonnull final ArrayList<Layer> network = new ArrayList<Layer>();
network.add(new ConvolutionLayer(3, 3, 3, 10).set(i -> 1e-8 * (Math.random() - 0.5)));
network.add(new PoolingLayer().setMode(PoolingLayer.PoolingMode.Max));
network.add(new ReLuActivationLayer());
network.add(new ImgCropLayer(126, 126));
network.add(new ConvolutionLayer(3, 3, 10, 20).set(i -> 1e-8 * (Math.random() - 0.5)));
network.add(new PoolingLayer().setMode(PoolingLayer.PoolingMode.Max));
network.add(new ReLuActivationLayer());
network.add(new ImgCropLayer(62, 62));
network.add(new ConvolutionLayer(5, 5, 20, 30).set(i -> 1e-8 * (Math.random() - 0.5)));
network.add(new PoolingLayer().setMode(PoolingLayer.PoolingMode.Max));
network.add(new ReLuActivationLayer());
network.add(new ImgCropLayer(18, 18));
network.add(new ConvolutionLayer(3, 3, 30, 40).set(i -> 1e-8 * (Math.random() - 0.5)));
network.add(new PoolingLayer().setWindowX(4).setWindowY(4).setMode(PoolingLayer.PoolingMode.Avg));
network.add(new ReLuActivationLayer());
network.add(new ImgCropLayer(4, 4));
network.add(new ImgBandBiasLayer(40));
network.add(new FullyConnectedLayer(new int[] { 4, 4, 40 }, new int[] { 100 }).set(() -> 0.001 * (Math.random() - 0.45)));
network.add(new SoftmaxActivationLayer());
return network.toArray(new Layer[] {});
}
Aggregations