public class WeightsRandomizer extends Object
Modifier and Type | Field and Description |
---|---|
protected Random |
randomGen
Random number genarator used to generate random values for weights
|
Constructor and Description |
---|
WeightsRandomizer()
Create a new instance of WeightsRandomizer
|
WeightsRandomizer(Random randomGen)
Create a new instance of WeightsRandomizer with specified random generator
If you use the same random generators, you'll get the same random sequences
|
Modifier and Type | Method and Description |
---|---|
Random |
getRandomGen() |
protected double |
nextRandomWeight()
Returns next random value from random generator, that will be used to initialize weight
Override this method to implement custom random number generators
|
protected void |
randomize(Layer layer)
Iterate and randomizes all neurons in specified layer
|
void |
randomize(NeuralNetwork<?> neuralNetwork)
Iterates and randomizes all layers in specified network
|
protected void |
randomize(Neuron neuron)
Iterates and randomizes all connection weights in specified neuron
|
protected Random randomGen
public WeightsRandomizer()
public WeightsRandomizer(Random randomGen)
randomGen
- random geneartor to use for randomizing weightspublic Random getRandomGen()
public void randomize(NeuralNetwork<?> neuralNetwork)
neuralNetwork
- neural network to randomizeprotected void randomize(Layer layer)
layer
- layer to randomizeprotected void randomize(Neuron neuron)
neuron
- neuron to randomizeprotected double nextRandomWeight()
Copyright © 2019 Neuroph Project. All rights reserved.