Search in sources :

Example 1 with ImgCropLayer

use of com.simiacryptus.mindseye.layers.java.ImgCropLayer 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[] {});
}
Also used : ConvolutionLayer(com.simiacryptus.mindseye.layers.cudnn.ConvolutionLayer) FullyConnectedLayer(com.simiacryptus.mindseye.layers.java.FullyConnectedLayer) SoftmaxActivationLayer(com.simiacryptus.mindseye.layers.java.SoftmaxActivationLayer) ImgCropLayer(com.simiacryptus.mindseye.layers.java.ImgCropLayer) Layer(com.simiacryptus.mindseye.lang.Layer) ImgBandBiasLayer(com.simiacryptus.mindseye.layers.java.ImgBandBiasLayer) PoolingLayer(com.simiacryptus.mindseye.layers.cudnn.PoolingLayer) Nonnull(javax.annotation.Nonnull) ReLuActivationLayer(com.simiacryptus.mindseye.layers.java.ReLuActivationLayer) ArrayList(java.util.ArrayList) SoftmaxActivationLayer(com.simiacryptus.mindseye.layers.java.SoftmaxActivationLayer) FullyConnectedLayer(com.simiacryptus.mindseye.layers.java.FullyConnectedLayer) ImgBandBiasLayer(com.simiacryptus.mindseye.layers.java.ImgBandBiasLayer) Nonnull(javax.annotation.Nonnull) PoolingLayer(com.simiacryptus.mindseye.layers.cudnn.PoolingLayer) ArrayList(java.util.ArrayList) ConvolutionLayer(com.simiacryptus.mindseye.layers.cudnn.ConvolutionLayer) FullyConnectedLayer(com.simiacryptus.mindseye.layers.java.FullyConnectedLayer) SoftmaxActivationLayer(com.simiacryptus.mindseye.layers.java.SoftmaxActivationLayer) ImgCropLayer(com.simiacryptus.mindseye.layers.java.ImgCropLayer) Layer(com.simiacryptus.mindseye.lang.Layer) ImgBandBiasLayer(com.simiacryptus.mindseye.layers.java.ImgBandBiasLayer) PoolingLayer(com.simiacryptus.mindseye.layers.cudnn.PoolingLayer) ReLuActivationLayer(com.simiacryptus.mindseye.layers.java.ReLuActivationLayer) ReLuActivationLayer(com.simiacryptus.mindseye.layers.java.ReLuActivationLayer) ImgCropLayer(com.simiacryptus.mindseye.layers.java.ImgCropLayer) ConvolutionLayer(com.simiacryptus.mindseye.layers.cudnn.ConvolutionLayer)

Aggregations

Layer (com.simiacryptus.mindseye.lang.Layer)1 ConvolutionLayer (com.simiacryptus.mindseye.layers.cudnn.ConvolutionLayer)1 PoolingLayer (com.simiacryptus.mindseye.layers.cudnn.PoolingLayer)1 FullyConnectedLayer (com.simiacryptus.mindseye.layers.java.FullyConnectedLayer)1 ImgBandBiasLayer (com.simiacryptus.mindseye.layers.java.ImgBandBiasLayer)1 ImgCropLayer (com.simiacryptus.mindseye.layers.java.ImgCropLayer)1 ReLuActivationLayer (com.simiacryptus.mindseye.layers.java.ReLuActivationLayer)1 SoftmaxActivationLayer (com.simiacryptus.mindseye.layers.java.SoftmaxActivationLayer)1 ArrayList (java.util.ArrayList)1 Nonnull (javax.annotation.Nonnull)1