Search in sources :

Example 1 with ImgModulusPaddingLayer

use of com.simiacryptus.mindseye.layers.cudnn.ImgModulusPaddingLayer in project MindsEye by SimiaCryptus.

the class VGG16_HDF5 method phase2b.

/**
 * Phase 2 b.
 */
protected void phase2b() {
    if (large) {
        add(new ImgModulusPaddingLayer(7, 7));
    } else {
        add(new ImgModulusPaddingLayer(-7, -7));
    }
    if (dense) {
        add(new ConvolutionLayer(7, 7, 512, 4096).setStrideXY(1, 1).setPaddingXY(0, 0).setAndFree(hdf5.readDataSet("param_0", "layer_32").reshapeCast(7, 7, 512, 4096).permuteDimensionsAndFree(0, 1, 3, 2)));
    } else {
        add(new ImgModulusPaddingLayer(7, 7));
        add(new ImgReshapeLayer(7, 7, false));
        add(new ConvolutionLayer(1, 1, 25088, 4096).setPaddingXY(0, 0).setAndFree(hdf5.readDataSet("param_0", "layer_32").permuteDimensionsAndFree(fullyconnectedOrder)));
    }
    add(new ImgBandBiasLayer(4096).setAndFree((hdf5.readDataSet("param_1", "layer_32"))));
    add(new ActivationLayer(ActivationLayer.Mode.RELU));
}
Also used : ImgReshapeLayer(com.simiacryptus.mindseye.layers.java.ImgReshapeLayer) ImgBandBiasLayer(com.simiacryptus.mindseye.layers.cudnn.ImgBandBiasLayer) SoftmaxActivationLayer(com.simiacryptus.mindseye.layers.cudnn.SoftmaxActivationLayer) ActivationLayer(com.simiacryptus.mindseye.layers.cudnn.ActivationLayer) ImgModulusPaddingLayer(com.simiacryptus.mindseye.layers.cudnn.ImgModulusPaddingLayer) ConvolutionLayer(com.simiacryptus.mindseye.layers.cudnn.ConvolutionLayer)

Example 2 with ImgModulusPaddingLayer

use of com.simiacryptus.mindseye.layers.cudnn.ImgModulusPaddingLayer in project MindsEye by SimiaCryptus.

the class VGG19_HDF5 method phase2b.

/**
 * Phase 2 b.
 */
protected void phase2b() {
    if (large) {
        add(new ImgModulusPaddingLayer(7, 7));
    } else {
        add(new ImgModulusPaddingLayer(-7, -7));
    }
    if (dense) {
        add(new ConvolutionLayer(7, 7, 512, 4096).setStrideXY(1, 1).setPaddingXY(0, 0).setAndFree(hdf5.readDataSet("param_0", "layer_38").reshapeCast(7, 7, 512, 4096).permuteDimensionsAndFree(0, 1, 3, 2)));
    } else {
        add(new ImgModulusPaddingLayer(7, 7));
        add(new ImgReshapeLayer(7, 7, false));
        add(new ConvolutionLayer(1, 1, 25088, 4096).setPaddingXY(0, 0).setAndFree(hdf5.readDataSet("param_0", "layer_38").permuteDimensionsAndFree(fullyconnectedOrder)));
    }
    add(new ImgBandBiasLayer(4096).setAndFree((hdf5.readDataSet("param_1", "layer_38"))));
    add(new ActivationLayer(ActivationLayer.Mode.RELU));
}
Also used : ImgReshapeLayer(com.simiacryptus.mindseye.layers.java.ImgReshapeLayer) ImgBandBiasLayer(com.simiacryptus.mindseye.layers.cudnn.ImgBandBiasLayer) SoftmaxActivationLayer(com.simiacryptus.mindseye.layers.cudnn.SoftmaxActivationLayer) ActivationLayer(com.simiacryptus.mindseye.layers.cudnn.ActivationLayer) ImgModulusPaddingLayer(com.simiacryptus.mindseye.layers.cudnn.ImgModulusPaddingLayer) ConvolutionLayer(com.simiacryptus.mindseye.layers.cudnn.ConvolutionLayer)

Aggregations

ActivationLayer (com.simiacryptus.mindseye.layers.cudnn.ActivationLayer)2 ConvolutionLayer (com.simiacryptus.mindseye.layers.cudnn.ConvolutionLayer)2 ImgBandBiasLayer (com.simiacryptus.mindseye.layers.cudnn.ImgBandBiasLayer)2 ImgModulusPaddingLayer (com.simiacryptus.mindseye.layers.cudnn.ImgModulusPaddingLayer)2 SoftmaxActivationLayer (com.simiacryptus.mindseye.layers.cudnn.SoftmaxActivationLayer)2 ImgReshapeLayer (com.simiacryptus.mindseye.layers.java.ImgReshapeLayer)2