Package org.apache.commons.math3.ml.neuralnet

# Class FeatureInitializerFactory

java.lang.Object
org.apache.commons.math3.ml.neuralnet.FeatureInitializerFactory

public class FeatureInitializerFactory extends Object
Creates functions that will select the initial values of a neuron's features.

Since:
  3.3

## Method Summary

Modifier and Type
Method
Description
`static FeatureInitializer`
`function(UnivariateFunction f, double init, double inc)`
Creates an initializer from a univariate function `f(x)`.
`static FeatureInitializer`
`randomize(RealDistribution random, FeatureInitializer orig)`
Adds some amount of random data to the given initializer.
`static FeatureInitializer`
`uniform(double min, double max)`
Uniform sampling of the given range.
`static FeatureInitializer`
`uniform(RandomGenerator rng, double min, double max)`
Uniform sampling of the given range.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Method Details

### uniform

public static FeatureInitializer uniform(RandomGenerator rng, double min, double max)
Uniform sampling of the given range.

Parameters:
  `rng` - Random number generator used to draw samples from a uniform distribution.
  `min` - Lower bound of the range.
  `max` - Upper bound of the range.
Returns:
  an initializer such that the features will be initialized with values within the given range.
Throws:
  `NumberIsTooLargeException` - if `min >= max`.

### uniform

public static FeatureInitializer uniform(double min, double max)
Uniform sampling of the given range.

Parameters:
  `min` - Lower bound of the range.
  `max` - Upper bound of the range.
Returns:
  an initializer such that the features will be initialized with values within the given range.
Throws:
  `NumberIsTooLargeException` - if `min >= max`.

### function

public static FeatureInitializer function(UnivariateFunction f, double init, double inc)
Creates an initializer from a univariate function `f(x)`. The argument `x` is set to `init` at the first call and will be incremented at each call.

Parameters:
  `f` - Function.
  `init` - Initial value.
  `inc` - Increment
Returns:
  the initializer.

### randomize

public static FeatureInitializer randomize(RealDistribution random, FeatureInitializer orig)
Adds some amount of random data to the given initializer.

Parameters:
  `random` - Random variable distribution.
  `orig` - Original initializer.
Returns:
  an initializer whose `value` method will return `orig.value() + random.sample()`.