Package com.github.neuralnetworks.architecture

Examples of com.github.neuralnetworks.architecture.Layer


    }

    public static RBM rbm(int visibleCount, int hiddenCount, boolean addBias) {
  RBM result = new RBM();
  ConnectionFactory cf = new ConnectionFactory();
  result.addConnections(cf.fullyConnected(new Layer(), new Layer(), visibleCount, hiddenCount));

  if (addBias) {
      result.addConnections(cf.fullyConnected(new Layer(), result.getVisibleLayer(), 1, visibleCount));
      result.addConnections(cf.fullyConnected(new Layer(), result.getHiddenLayer(), 1, hiddenCount));
  }

  return result;
    }
View Full Code Here


  DBN result = new DBN();
  ConnectionFactory cf = new ConnectionFactory();
  result.setProperties(new Properties());
  result.getProperties().setParameter(Constants.CONNECTION_FACTORY, cf);

  result.addLayer(new Layer());
  for (int i = 1; i < layers.length; i++) {
      RBM rbm = new RBM();
      rbm.setProperties(new Properties());
      rbm.getProperties().setParameter(Constants.CONNECTION_FACTORY, cf);

      rbm.addConnections(cf.fullyConnected(result.getOutputLayer(), new Layer(), layers[i - 1], layers[i]));

      if (addBias) {
    rbm.addConnections(cf.fullyConnected(new Layer(), rbm.getVisibleLayer(), 1, layers[i - 1]));
    rbm.addConnections(cf.fullyConnected(new Layer(), rbm.getHiddenLayer(), 1, layers[i]));
      }

      result.addNeuralNetwork(rbm);
  }
View Full Code Here

  }

  ConnectionFactory cf = new ConnectionFactory();
  Properties properties = new Properties();
  properties.setParameter(Constants.CONNECTION_FACTORY, cf);
  StackedAutoencoder result = new StackedAutoencoder(new Layer());
  result.setProperties(properties);

  for (int i = 1; i < layers.length; i++) {
      Autoencoder ae = new Autoencoder();
      ae.setProperties(new Properties());
      ae.getProperties().setParameter(Constants.CONNECTION_FACTORY, cf);

      ae.addLayer(result.getOutputLayer());
      NNFactory.addFullyConnectedLayer(ae, new Layer(), cf, layers[i - 1], layers[i], addBias);
      NNFactory.addFullyConnectedLayer(ae, new Layer(), cf, layers[i], layers[i - 1], addBias);

      result.addNeuralNetwork(ae);
  }

  return result;
View Full Code Here

  Map<Layer, Set<int[]>> dims = getLayersDimensions(nn, miniBatchSize);

  // create tensors
  List<Layer> layers = new ArrayList<>(dims.keySet());
  for (int i = 0; i < layers.size(); i++) {
      Layer l = layers.get(i);
      for (int[] d : dims.get(l)) {
    result.add(l, true, d);
      }
  }
View Full Code Here

      Map<Layer, Set<int[]>> dims = getLayersDimensions(nn, miniBatchSize);
     
      // create tensors
      List<Layer> layers = new ArrayList<>(dims.keySet());
      for (int i = 0; i < layers.size(); i++) {
    Layer l = layers.get(i);
    for (int[] d : dims.get(l)) {
        if (result.get(l, d) == null) {
      result.add(l, true, d);
        }
    }
View Full Code Here

  ValuesProvider result = new ValuesProvider(sibling);

  // create tensors
  List<Layer> layers = new ArrayList<>(dims.keySet());
  for (int i = 0; i < layers.size(); i++) {
      Layer l = layers.get(i);
      for (int[] d : dims.get(l)) {
    result.add(l, true, d);
      }
  }
 
View Full Code Here

TOP

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

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.