de.webdings.jannis.neuralnet

Class WeightRandomizer


public class WeightRandomizer
extends java.lang.Object

WeightRandomizer is used to generate random synapse weights. These are often needed for freshly defined neural nets that will be trained.

By standard, it generates weights ranging from -0.2 and +0.2, yet different ranges can be specified.

It uses the java.util.Random class.

Version:
0.1, 11.08.2005

Author:
Stefan Thesing
Website: http://www.webdings.de

See Also:
Synapse, java.util.Random

Method Summary

float
generateRandomWeight()
float
generateRandomWeight(int maxDigitAfterDot)
float
generateRandomWeight(int maxDigitBeforeDot, int maxDigitAfterDot)

Method Details

generateRandomWeight

public float generateRandomWeight()

Returns:
a random weight between -0.2 and +0.2


generateRandomWeight

public float generateRandomWeight(int maxDigitAfterDot)

Parameters:
maxDigitAfterDot -

Returns:
a random weight between -0.x and +0.x, where x is the specified maximum digit after the dot


generateRandomWeight

public float generateRandomWeight(int maxDigitBeforeDot,
                                  int maxDigitAfterDot)

Parameters:
maxDigitBeforeDot -
maxDigitAfterDot -

Returns:
a random weight between -x.y and +x.y, where x is the specified maximum number before the dot and y is the specified maximum digit after the dot


WeightRandomizer.java - Copyright (c) 2005 by Stefan Thesing

This file is part of Jannis.

Jannis is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Jannis is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Jannis; if not, write to the
Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA



© 2005 by Stefan Thesing;
Verbatim copying and redistribution of this entire page are permitted provided this notice is preserved.