25262728293031323334
* 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; }
25262728293031
/** * Construct a new Abstract output neuron. */ public AbstractOutputNeuron() { super(NeuronType.OUTPUT, new RandomValue()); }
37383940414243
* Constructs a new input value with value * RandomValue. */ public InputNeuron() { super(); setValue(new RandomValue()); }
110111112113114115116117118
* 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>()); }
124125126127128129130
return inputLinks.get(numInputLinks); } @Override public final ILink addInputLink(final INeuron inode) { return addInputLink(inode, new RandomValue()); }
181182183184185186187
return getOutputs().get(numOutputLinks); } @Override public final ILink addOutputLink(final INeuron inode) { return addOutputLink(inode, new RandomValue()); }
244245246247248249250251
} @Override public final void reset() { for (ILink i : getOutputs()) { i.setWeight(new RandomValue()); } }
353637383940414243
* .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); } }