Package org.neuroph.util

Examples of org.neuroph.util.NeuronProperties


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

    // init neuron settings for this type of network
    NeuronProperties neuronProperties = new NeuronProperties();
    neuronProperties.setProperty("transferFunction", TransferFunctionType.STEP);
   
    // create input layer
    Layer inputLayer = LayerFactory.createLayer(inputNeuronsCount, neuronProperties);
    this.addLayer(inputLayer);

    // createLayer output layer
    neuronProperties.setProperty("transferFunction", TransferFunctionType.STEP);
    Layer outputLayer = LayerFactory.createLayer(1,  neuronProperties);
    this.addLayer(outputLayer);

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


   * @param neuronsInLayers
   *            collection of neuron number in layers
   */
  public MultiLayerPerceptron(List<Integer> neuronsInLayers) {
    // init neuron settings
    NeuronProperties neuronProperties = new NeuronProperties();
                neuronProperties.setProperty("useBias", true);
    neuronProperties.setProperty("transferFunction", TransferFunctionType.SIGMOID);

    this.createNetwork(neuronsInLayers, neuronProperties);
  }
View Full Code Here

    this.createNetwork(neuronsInLayers, neuronProperties);
  }
 
  public MultiLayerPerceptron(int ... neuronsInLayers) {
    // init neuron settings
    NeuronProperties neuronProperties = new NeuronProperties();
                neuronProperties.setProperty("useBias", true);
    neuronProperties.setProperty("transferFunction",
        TransferFunctionType.SIGMOID);
                neuronProperties.setProperty("inputFunction", WeightedSum.class);

    Vector<Integer> neuronsInLayersVector = new Vector<Integer>();
    for(int i=0; i<neuronsInLayers.length; i++)
      neuronsInLayersVector.add(new Integer(neuronsInLayers[i]));
   
View Full Code Here

    this.createNetwork(neuronsInLayersVector, neuronProperties);
  }

  public MultiLayerPerceptron(TransferFunctionType transferFunctionType, int ... neuronsInLayers) {
    // init neuron settings
    NeuronProperties neuronProperties = new NeuronProperties();
                neuronProperties.setProperty("useBias", true);
    neuronProperties.setProperty("transferFunction", transferFunctionType);
                neuronProperties.setProperty("inputFunction", WeightedSum.class);


    Vector<Integer> neuronsInLayersVector = new Vector<Integer>();
    for(int i=0; i<neuronsInLayers.length; i++)
      neuronsInLayersVector.add(new Integer(neuronsInLayers[i]));
View Full Code Here

    this.createNetwork(neuronsInLayersVector, neuronProperties);
  }

  public MultiLayerPerceptron(List<Integer> neuronsInLayers, TransferFunctionType transferFunctionType) {
    // init neuron settings
    NeuronProperties neuronProperties = new NeuronProperties();
                neuronProperties.setProperty("useBias", true);
    neuronProperties.setProperty("transferFunction", transferFunctionType);

    this.createNetwork(neuronsInLayers, neuronProperties);
  }
View Full Code Here

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

                // create input layer
                NeuronProperties inputNeuronProperties = new NeuronProperties(InputNeuron.class, TransferFunctionType.LINEAR);
                Layer layer = LayerFactory.createLayer(neuronsInLayers.get(0), inputNeuronProperties);

                boolean useBias = true; // use bias neurons by default
                if (neuronProperties.hasProperty("useBias")) {
                    useBias = (Boolean)neuronProperties.getProperty("useBias");
View Full Code Here

  private void createNetwork(int inputNeuronsCount) {
    // set network type code
    this.setNetworkType(NeuralNetworkType.ADALINE);
               
                // create input layer neuron settings for this network
    NeuronProperties inNeuronProperties = new NeuronProperties();
    inNeuronProperties.setProperty("transferFunction", TransferFunctionType.LINEAR);

    // createLayer input layer with specified number of neurons
    Layer inputLayer = LayerFactory.createLayer(inputNeuronsCount, inNeuronProperties);
                inputLayer.addNeuron(new BiasNeuron()); // add bias neuron (always 1, and it will act as bias input for output neuron)
    this.addLayer(inputLayer);
               
               // create output layer neuron settings for this network
    NeuronProperties outNeuronProperties = new NeuronProperties();
    outNeuronProperties.setProperty("transferFunction", TransferFunctionType.RAMP);
    outNeuronProperties.setProperty("transferFunction.slope", new Double(1));
    outNeuronProperties.setProperty("transferFunction.yHigh", new Double(1));
    outNeuronProperties.setProperty("transferFunction.xHigh", new Double(1));
    outNeuronProperties.setProperty("transferFunction.yLow", new Double(-1));
    outNeuronProperties.setProperty("transferFunction.xLow", new Double(-1));

    // createLayer output layer (only one neuron)
    Layer outputLayer = LayerFactory.createLayer(1, outNeuronProperties);
    this.addLayer(outputLayer);
View Full Code Here

   *            number of neurons in output layer
   */
  public BAM(int inputNeuronsCount, int outputNeuronsCount) {

    // init neuron settings for BAM network
    NeuronProperties neuronProperties = new NeuronProperties();
    neuronProperties.setProperty("neuronType", InputOutputNeuron.class);
    neuronProperties.setProperty("bias", new Double(0));
    neuronProperties.setProperty("transferFunction", TransferFunctionType.STEP);
    neuronProperties.setProperty("transferFunction.yHigh", new Double(1));
    neuronProperties.setProperty("transferFunction.yLow", new Double(0));

    this.createNetwork(inputNeuronsCount, outputNeuronsCount, neuronProperties);
 
View Full Code Here

   */
  private void createNetwork(int inputNeuronsNum, int outputNeuronsNum,
    TransferFunctionType transferFunctionType) {

    // init neuron properties
    NeuronProperties neuronProperties = new NeuronProperties();
    neuronProperties.setProperty("transferFunction", transferFunctionType);
    neuronProperties.setProperty("transferFunction.slope", new Double(1));
    neuronProperties.setProperty("transferFunction.yHigh", new Double(1));
    neuronProperties.setProperty("transferFunction.xHigh", new Double(1));   
    neuronProperties.setProperty("transferFunction.yLow", new Double(-1));
    neuronProperties.setProperty("transferFunction.xLow", new Double(-1));
   
    // set network type code
    this.setNetworkType(NeuralNetworkType.SUPERVISED_HEBBIAN_NET);

    // createLayer input layer
View Full Code Here

  private void createNetwork(int inputNeuronsCount, int outputNeuronsCount) {
    // set network type
    this.setNetworkType(NeuralNetworkType.COMPETITIVE);

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

    // createLayer properties for neurons in output layer
    NeuronProperties neuronProperties = new NeuronProperties();
    neuronProperties.setProperty("neuronType", CompetitiveNeuron.class);
    neuronProperties.setProperty("weightsFunction",  WeightedInput.class);
    neuronProperties.setProperty("summingFunction", Sum.class);
    neuronProperties.setProperty("transferFunction",TransferFunctionType.RAMP);

    // createLayer full connectivity in competitive layer
    CompetitiveLayer competitiveLayer = new CompetitiveLayer(outputNeuronsCount, neuronProperties);

    // add competitive layer to network
View Full Code Here

TOP

Related Classes of org.neuroph.util.NeuronProperties

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.