Package com.github.neuralnetworks.architecture

Examples of com.github.neuralnetworks.architecture.ConnectionFactory


    @Test
    public void testDimensions() {
  // convolution dimensions
  Environment.getInstance().setUseWeightsSharedMemory(true);
  ConnectionFactory cf = new ConnectionFactory();
  Conv2DConnection conv = cf.conv2d(new Layer(), new Layer(), 4, 4, 3, 2, 2, 2, 1);

  assertEquals(3, conv.getOutputFeatureMapColumns(), 0);
  assertEquals(3, conv.getOutputFeatureMapRows(), 0);
  assertEquals(2, conv.getOutputFilters(), 0);

  // subsampling dimensions
  Subsampling2DConnection sub = cf.subsampling2D(new Layer(), new Layer(), 5, 5, 2, 2, 3);

  assertEquals(2, sub.getOutputFeatureMapColumns(), 0);
  assertEquals(2, sub.getOutputFeatureMapRows(), 0);
  assertEquals(3, sub.getFilters(), 0);
    }
View Full Code Here


    }

    @Test
    public void testConvolutions() {
  Environment.getInstance().setUseWeightsSharedMemory(true);
  Conv2DConnection c = new ConnectionFactory().conv2d(new Layer(), new Layer(), 3, 3, 2, 2, 2, 1, 1);

  c.getWeights().setElements(new float[] {1, 2, 3, 4, 1, 2, 3, 4});

  ValuesProvider vp = TensorFactory.tensorProvider(c, 1, true);
  TensorIterator it = vp.get(c.getInputLayer()).iterator();
View Full Code Here

    }

    @Test
    public void testConvolutions2() {
  Environment.getInstance().setUseWeightsSharedMemory(true);
  Conv2DConnection c = new ConnectionFactory().conv2d(new Layer(), new Layer(), 3, 3, 2, 2, 2, 2, 1);
  c.getWeights().setElements(new float[] {1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4});

  ValuesProvider vp = TensorFactory.tensorProvider(c, 1, true);
  TensorIterator it = vp.get(c.getInputLayer()).iterator();
  for (int i = 0; i < vp.get(c.getInputLayer()).getSize(); i++) {
View Full Code Here

TOP

Related Classes of com.github.neuralnetworks.architecture.ConnectionFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.