Package com.neuralnetwork.shared.values

Examples of com.neuralnetwork.shared.values.RandomValue


   *     vector of random values.
   */
  public static Vector<Double> getRandomVector(final int featureSize) {
    Vector<Double> randVector = new Vector<Double>(featureSize);
    for (int i = 0; i < featureSize; i++) {
      randVector.add(new RandomValue().getValue());
    }
   
    return randVector;
  }
View Full Code Here


    /**
     * Construct a new Abstract output neuron.
     */
    public AbstractOutputNeuron() {
        super(NeuronType.OUTPUT, new RandomValue());
    }
View Full Code Here

     * Constructs a new input value with value
     * RandomValue.
     */
    public InputNeuron() {
        super();
        setValue(new RandomValue());
    }
View Full Code Here

     * Construct a new hidden Neuron.
     * With it's value set randomly.
     */
    public Neuron() {
        this.type = NeuronType.HIDDEN;
        this.value = new RandomValue();
        inputLinks = new Vector<ILink>();
        setOutputs(new Vector<ILink>());
    }
View Full Code Here

        return inputLinks.get(numInputLinks);
    }

    @Override
    public final ILink addInputLink(final INeuron inode) {
        return addInputLink(inode, new RandomValue());
    }
View Full Code Here

        return getOutputs().get(numOutputLinks);
    }

    @Override
    public final ILink addOutputLink(final INeuron inode) {
        return addOutputLink(inode, new RandomValue());
    }
View Full Code Here

    }

    @Override
    public final void reset() {
        for (ILink i : getOutputs()) {
            i.setWeight(new RandomValue());
        }
    }
View Full Code Here

   * .shared.values.RandomValue#RandomValue()}.
   */
  @Test
  public final void testRandomValue() {
    for (int i = 0; i < NUM_ITER; i++) {
      Double v = new RandomValue().getValue();
      assertTrue(v >= -1 && v <= 1);
    }
  }
View Full Code Here

TOP

Related Classes of com.neuralnetwork.shared.values.RandomValue

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.