Examples of Layer


Examples of org.neuroph.core.Layer

    // set network type
    this.setNetworkType(NeuralNetworkType.MAXNET);

    // createLayer input layer in layer
    Layer inputLayer = LayerFactory.createLayer(neuronsCount,
        new NeuronProperties());
    this.addLayer(inputLayer);

    // createLayer properties for neurons in output layer
    NeuronProperties neuronProperties = new NeuronProperties();
View Full Code Here

Examples of org.neuroph.core.Layer

    double[] weights = flatNetwork.getWeights();

    int index = 0;

    for (int layerIndex = network.getLayers().size() - 1; layerIndex > 0; layerIndex--) {
      Layer layer = network.getLayers().get(layerIndex);

      for (Neuron neuron : layer.getNeurons()) {
        for (Connection connection : neuron.getInputConnections()) {
          if (index >= weights.length)
            throw new EncogEngineError("Weight size mismatch.");

          Weight weight = connection.getWeight();
View Full Code Here

Examples of org.neuroph.core.Layer

   * @return True if unflattening was successful.
   */
  public static boolean unFlattenNeuralNetworkNetwork(NeuralNetwork network) {

    for (int layerIndex = network.getLayers().size() - 1; layerIndex > 0; layerIndex--) {
      Layer layer = network.getLayers().get(layerIndex);

      for (Neuron neuron : layer.getNeurons()) {
        for (Connection connection : neuron.getInputConnections()) {
          Weight weight = connection.getWeight();

          if (weight instanceof FlatWeight) {
            Weight weight2 = new Weight(weight.getValue());
View Full Code Here

Examples of org.neuroph.core.Layer

    promoLayerIdx = 4,
    outputLayerIdx = 5;

  public RecommenderNetwork() {
        for(int i = 0; i < 6; i++)
            this.addLayer(new Layer());
    //this.createDemoNetwork();
 
View Full Code Here

Examples of org.neuroph.core.Layer

    neuronProperties.setProperty("transferFunction", TransferFunctionType.RAMP);
    // for sigmoid and tanh transfer functions
    neuronProperties.setProperty("transferFunction.slope", new Double(1));
   
    // create input layer   
    Layer inputLayer = LayerFactory.createLayer(productsCount,
        neuronProperties);
    this.addLayer(inputLayer);
    createProductLabels(inputLayer);

   
    // create product types layer   
    Layer typeLayer = LayerFactory.createLayer(typesCount,
        neuronProperties);
    createTypeLabels(typeLayer);
    this.addLayer(typeLayer);
   
   
    // create brands layer   
    Layer brandLayer = LayerFactory.createLayer(brandsCount,
        neuronProperties);
    createBrandLabels(brandLayer);
    this.addLayer(brandLayer)
   
   
    // create price layer   
    Layer priceLayer = LayerFactory.createLayer(priceCount, neuronProperties);
    createPriceLabels(priceLayer);
    this.addLayer(priceLayer)
   
    // create price layer   
    Layer promoLayer = LayerFactory.createLayer(promoCount, neuronProperties);
    createPromoLabels(promoLayer);
    this.addLayer(promoLayer);   
       
    // create output layer
    Layer outputLayer = LayerFactory.createLayer(productsCount,
        neuronProperties);
    this.addLayer(outputLayer);
    createProductLabels(outputLayer);
   
    createTypeConnections();
View Full Code Here

Examples of org.neuroph.core.Layer

    }

    // creates jets and sharks IAC example
    private void createNetwork() {
        // napraviti elegantni api za kreiranje vise layera NeuralNetwork.createLayers(6); // creates 6 empty layers
        this.addLayer(new Layer())// Name
        this.addLayer(new Layer())// Gang
        this.addLayer(new Layer())// Age
        this.addLayer(new Layer())// Education
        this.addLayer(new Layer())// Marital Status
        this.addLayer(new Layer())// Occupation
       
        this.addLayer(new Layer())// Associations

        Layer layer = this.getLayerAt(0);
       
        IACNeuron neuron = new IACNeuron();
        neuron.setLabel("Art");
        layer.addNeuron(neuron);

        neuron = new IACNeuron();
        neuron.setLabel("Rick");
        layer.addNeuron(neuron);

        neuron = new IACNeuron();
        neuron.setLabel("Sam");
        layer.addNeuron(neuron);

        neuron = new IACNeuron();
        neuron.setLabel("Ralph");
        layer.addNeuron(neuron);

        neuron = new IACNeuron();
        neuron.setLabel("Lance");
        layer.addNeuron(neuron);

        ConnectionFactory.fullConnect(layer, -0.3);
        //----------------------------------------------

        layer = this.getLayerAt(1);

        neuron = new IACNeuron();
        neuron.setLabel("Jets");
        layer.addNeuron(neuron);

        neuron = new IACNeuron();
        neuron.setLabel("Sharks");
        layer.addNeuron(neuron);

        ConnectionFactory.fullConnect(layer, -0.3);

        //----------------------------------------------

        layer = this.getLayerAt(2);

        neuron = new IACNeuron();
        neuron.setLabel("20's");
        layer.addNeuron(neuron);

        neuron = new IACNeuron();
        neuron.setLabel("30's");
        layer.addNeuron(neuron);

        neuron = new IACNeuron();
        neuron.setLabel("40's");
        layer.addNeuron(neuron);

        ConnectionFactory.fullConnect(layer, -0.3);
       
        //----------------------------------------------

        layer = this.getLayerAt(3);

        neuron = new IACNeuron();
        neuron.setLabel("J.H.");
        layer.addNeuron(neuron);

        neuron = new IACNeuron();
        neuron.setLabel("H.S.");
        layer.addNeuron(neuron);

        neuron = new IACNeuron();
        neuron.setLabel("College");
        layer.addNeuron(neuron);

        ConnectionFactory.fullConnect(layer, -0.3);

        //----------------------------------------------

        layer = this.getLayerAt(4);

        neuron = new IACNeuron();
        neuron.setLabel("Single");
        layer.addNeuron(neuron);

        neuron = new IACNeuron();
        neuron.setLabel("Married");
        layer.addNeuron(neuron);

        neuron = new IACNeuron();
        neuron.setLabel("Divorced");
        layer.addNeuron(neuron);

        ConnectionFactory.fullConnect(layer, -0.3);

        //----------------------------------------------

        layer = this.getLayerAt(5);

        neuron = new IACNeuron();
        neuron.setLabel("Pusher");
        layer.addNeuron(neuron);

        neuron = new IACNeuron();
        neuron.setLabel("Burglar");
        layer.addNeuron(neuron);

        neuron = new IACNeuron();
        neuron.setLabel("Bookie");
        layer.addNeuron(neuron);

        ConnectionFactory.fullConnect(layer, -0.3);

        //----------------------------------------------

        layer = this.getLayerAt(6);

        neuron = new IACNeuron(); // Art     Jets  40's  J.H.  Single     Pusher
        layer.addNeuron(neuron);
        this.createConnection(neuron, this.getLayerAt(0).getNeuronAt(0), 0.1)// art
        this.createConnection(neuron, this.getLayerAt(1).getNeuronAt(0), 0.1)// jets
        this.createConnection(neuron, this.getLayerAt(2).getNeuronAt(2), 0.1)// 40'a
        this.createConnection(neuron, this.getLayerAt(3).getNeuronAt(0), 0.1)// J.H.
        this.createConnection(neuron, this.getLayerAt(4).getNeuronAt(0), 0.1)// Single
        this.createConnection(neuron, this.getLayerAt(5).getNeuronAt(0), 0.1)// Pusher

        this.createConnection(this.getLayerAt(0).getNeuronAt(0), neuron, 0.1)// art
        this.createConnection(this.getLayerAt(1).getNeuronAt(0), neuron, 0.1)// jets
        this.createConnection(this.getLayerAt(2).getNeuronAt(2), neuron, 0.1)// 40'a
        this.createConnection(this.getLayerAt(3).getNeuronAt(0), neuron, 0.1)// J.H.
        this.createConnection(this.getLayerAt(4).getNeuronAt(0), neuron, 0.1)// Single
        this.createConnection(this.getLayerAt(5).getNeuronAt(0), neuron, 0.1)// Pusher


        neuron = new IACNeuron(); // Rick  Sharks  30's  H.S.  Divorced   Burglar
        layer.addNeuron(neuron);
        this.createConnection(neuron, this.getLayerAt(0).getNeuronAt(1), 0.1)// Rick
        this.createConnection(neuron, this.getLayerAt(1).getNeuronAt(1), 0.1)// Sharks
        this.createConnection(neuron, this.getLayerAt(2).getNeuronAt(1), 0.1)// 30'a
        this.createConnection(neuron, this.getLayerAt(3).getNeuronAt(1), 0.1)// H.S.
        this.createConnection(neuron, this.getLayerAt(4).getNeuronAt(2), 0.1)// Divorced
        this.createConnection(neuron, this.getLayerAt(5).getNeuronAt(1), 0.1)// Burglar

        this.createConnection(this.getLayerAt(0).getNeuronAt(1), neuron, 0.1)// Rick
        this.createConnection(this.getLayerAt(1).getNeuronAt(1), neuron, 0.1)// Sharks
        this.createConnection(this.getLayerAt(2).getNeuronAt(1), neuron, 0.1)// 30'a
        this.createConnection(this.getLayerAt(3).getNeuronAt(1), neuron, 0.1)// H.S.
        this.createConnection(this.getLayerAt(4).getNeuronAt(2), neuron, 0.1)// Divorced
        this.createConnection(this.getLayerAt(5).getNeuronAt(1), neuron, 0.1)// Burglar

        neuron = new IACNeuron(); // Sam     Jets  20's  College  Single     Bookie
        layer.addNeuron(neuron);
        this.createConnection(neuron, this.getLayerAt(0).getNeuronAt(2), 0.1)// Sam
        this.createConnection(neuron, this.getLayerAt(1).getNeuronAt(0), 0.1)// Jets
        this.createConnection(neuron, this.getLayerAt(2).getNeuronAt(0), 0.1)// 20's
        this.createConnection(neuron, this.getLayerAt(3).getNeuronAt(2), 0.1)// College
        this.createConnection(neuron, this.getLayerAt(4).getNeuronAt(0), 0.1)// Single
        this.createConnection(neuron, this.getLayerAt(5).getNeuronAt(2), 0.1)// Bookie

        this.createConnection(this.getLayerAt(0).getNeuronAt(2), neuron, 0.1)// Sam
        this.createConnection(this.getLayerAt(1).getNeuronAt(0), neuron, 0.1)// Jets
        this.createConnection(this.getLayerAt(2).getNeuronAt(0), neuron, 0.1)// 20's
        this.createConnection(this.getLayerAt(3).getNeuronAt(2), neuron, 0.1)// College
        this.createConnection(this.getLayerAt(4).getNeuronAt(0), neuron, 0.1)// Single
        this.createConnection(this.getLayerAt(5).getNeuronAt(2), neuron, 0.1)// Bookie

        neuron = new IACNeuron(); // Ralph  Jets  30's  J.H.  Single     Pusher
        layer.addNeuron(neuron);
        this.createConnection(neuron, this.getLayerAt(0).getNeuronAt(3), 0.1)// Ralph
        this.createConnection(neuron, this.getLayerAt(1).getNeuronAt(0), 0.1)// Jets
        this.createConnection(neuron, this.getLayerAt(2).getNeuronAt(1), 0.1)// 30's
        this.createConnection(neuron, this.getLayerAt(3).getNeuronAt(0), 0.1)// J.H.
        this.createConnection(neuron, this.getLayerAt(4).getNeuronAt(0), 0.1)// Single
        this.createConnection(neuron, this.getLayerAt(5).getNeuronAt(0), 0.1)// Pusher

        this.createConnection(this.getLayerAt(0).getNeuronAt(3), neuron, 0.1)// Ralph
        this.createConnection(this.getLayerAt(1).getNeuronAt(0), neuron, 0.1)// Jets
        this.createConnection(this.getLayerAt(2).getNeuronAt(1), neuron, 0.1)// 30's
        this.createConnection(this.getLayerAt(3).getNeuronAt(0), neuron, 0.1)// J.H.
        this.createConnection(this.getLayerAt(4).getNeuronAt(0), neuron, 0.1)// Single
        this.createConnection(this.getLayerAt(5).getNeuronAt(0), neuron, 0.1)// Pusher

        neuron = new IACNeuron(); // Lance  Jets  20's  J.H.  Married    Burglar
        layer.addNeuron(neuron);
        this.createConnection(neuron, this.getLayerAt(0).getNeuronAt(4), 0.1)// Lance
        this.createConnection(neuron, this.getLayerAt(1).getNeuronAt(0), 0.1)// Jets
        this.createConnection(neuron, this.getLayerAt(2).getNeuronAt(0), 0.1)// 20's
        this.createConnection(neuron, this.getLayerAt(3).getNeuronAt(0), 0.1)// J.H.
        this.createConnection(neuron, this.getLayerAt(4).getNeuronAt(1), 0.1)// Married
View Full Code Here

Examples of org.neuroph.core.Layer

   * Sets default input and output neurons for network (first layer as input,
   * last as output)
   */
  public static void setDefaultIO(NeuralNetwork nnet) {
                ArrayList<Neuron> inputNeurons = new ArrayList<Neuron>();
                Layer firstLayer = (Layer) nnet.getLayers().get(0);
                for (Neuron neuron : firstLayer.getNeurons() ) {
                    if (!(neuron instanceof BiasNeuron)) {  // dont set input to bias neurons
                        inputNeurons.add(neuron);
                    }
                }

View Full Code Here

Examples of org.neuroph.core.Layer

    // init neuron settings for input layer
    NeuronProperties inputNeuronProperties = new NeuronProperties();
       inputNeuronProperties.setProperty("transferFunction", TransferFunctionType.LINEAR);

    // create input layer
    Layer inputLayer = LayerFactory.createLayer(inputNeuronsCount, inputNeuronProperties);
    this.addLayer(inputLayer);

    NeuronProperties outputNeuronProperties = new NeuronProperties();
    outputNeuronProperties.setProperty("neuronType", ThresholdNeuron.class);
    outputNeuronProperties.setProperty("thresh", new Double(Math.abs(Math.random())));
    outputNeuronProperties.setProperty("transferFunction", transferFunctionType);
    // for sigmoid and tanh transfer functions set slope propery
    outputNeuronProperties.setProperty("transferFunction.slope", new Double(1));

    // createLayer output layer
    Layer outputLayer = LayerFactory.createLayer(outputNeuronsCount, outputNeuronProperties);
    this.addLayer(outputLayer);

    // create full conectivity between input and output layer
    ConnectionFactory.fullConnect(inputLayer, outputLayer);
View Full Code Here

Examples of org.newdawn.slick.tiled.Layer

  @Override
  public void render(int x, int y, int sx, int sy, int width, int height,
      boolean lineByLine) {
    for (int ty = 0; ty < height; ty++) {
      for (int i = 0; i < layers.size(); i++) {
        Layer layer = (Layer) layers.get(i);
        if (!m_isCurrent) {
          layer.render(x, y, sx, sy, width, ty, lineByLine,
              tileWidth, tileHeight);
        } else if (!layer.name.equalsIgnoreCase("WalkBehind")) {
          layer.render(x, y, sx, sy, width, ty, lineByLine,
              tileWidth, tileHeight);
        }
      }
    }
  }
View Full Code Here

Examples of org.openstreetmap.josm.gui.layer.Layer

            }
        } else if (klass.isAssignableFrom(GpxLayer.class)) {
            if (!Main.isDisplayingMapView())
                return null;
            boolean merge = Main.pref.getBoolean("download.gps.mergeWithLocal", false);
            Layer active = Main.map.mapView.getActiveLayer();
            if (active instanceof GpxLayer && (merge || ((GpxLayer) active).data.fromServer))
                return ((GpxLayer) active).data.getDataSourceBounds();
            for (GpxLayer l : Main.map.mapView.getLayersOfType(GpxLayer.class)) {
                if (merge || l.data.fromServer)
                    return l.data.getDataSourceBounds();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.