Search in sources :

Example 1 with PoolingType

use of org.deeplearning4j.nn.conf.layers.SubsamplingLayer.PoolingType in project deeplearning4j by deeplearning4j.

the class MultiNeuralNetConfLayerBuilderTest method testNeuralNetConfigAPI.

@Test
public void testNeuralNetConfigAPI() {
    LossFunction newLoss = LossFunction.SQUARED_LOSS;
    int newNumIn = numIn + 1;
    int newNumOut = numOut + 1;
    WeightInit newWeight = WeightInit.UNIFORM;
    double newDrop = 0.5;
    int[] newFS = new int[] { 3, 3 };
    int newFD = 7;
    int[] newStride = new int[] { 3, 3 };
    Convolution.Type newConvType = Convolution.Type.SAME;
    PoolingType newPoolType = PoolingType.AVG;
    double newCorrupt = 0.5;
    double newSparsity = 0.5;
    HiddenUnit newHidden = HiddenUnit.BINARY;
    VisibleUnit newVisible = VisibleUnit.BINARY;
    MultiLayerConfiguration multiConf1 = new NeuralNetConfiguration.Builder().list().layer(0, new DenseLayer.Builder().nIn(newNumIn).nOut(newNumOut).activation(act).build()).layer(1, new DenseLayer.Builder().nIn(newNumIn + 1).nOut(newNumOut + 1).activation(act).build()).build();
    NeuralNetConfiguration firstLayer = multiConf1.getConf(0);
    NeuralNetConfiguration secondLayer = multiConf1.getConf(1);
    assertFalse(firstLayer.equals(secondLayer));
}
Also used : HiddenUnit(org.deeplearning4j.nn.conf.layers.RBM.HiddenUnit) VisibleUnit(org.deeplearning4j.nn.conf.layers.RBM.VisibleUnit) WeightInit(org.deeplearning4j.nn.weights.WeightInit) PoolingType(org.deeplearning4j.nn.conf.layers.SubsamplingLayer.PoolingType) Convolution(org.nd4j.linalg.convolution.Convolution) DenseLayer(org.deeplearning4j.nn.conf.layers.DenseLayer) LossFunction(org.nd4j.linalg.lossfunctions.LossFunctions.LossFunction) Test(org.junit.Test)

Aggregations

DenseLayer (org.deeplearning4j.nn.conf.layers.DenseLayer)1 HiddenUnit (org.deeplearning4j.nn.conf.layers.RBM.HiddenUnit)1 VisibleUnit (org.deeplearning4j.nn.conf.layers.RBM.VisibleUnit)1 PoolingType (org.deeplearning4j.nn.conf.layers.SubsamplingLayer.PoolingType)1 WeightInit (org.deeplearning4j.nn.weights.WeightInit)1 Test (org.junit.Test)1 Convolution (org.nd4j.linalg.convolution.Convolution)1 LossFunction (org.nd4j.linalg.lossfunctions.LossFunctions.LossFunction)1