Class FeatureInitializerFactory

    • Method Detail

      • uniform

        public static FeatureInitializer uniform​(org.apache.commons.rng.UniformRandomProvider rng,
                                                 double min,
                                                 double max)
        Uniform sampling of the given range.
        Parameters:
        min - Lower bound of the range.
        max - Upper bound of the range.
        rng - Random number generator used to draw samples from a uniform distribution.
        Returns:
        an initializer such that the features will be initialized with values within the given range.
        Throws:
        IllegalArgumentException - if min >= max.
      • function

        public static FeatureInitializer function​(DoubleUnaryOperator 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​(org.apache.commons.rng.sampling.distribution.ContinuousUniformSampler random,
                                                   FeatureInitializer orig)
        Adds some amount of random data to the given initializer.
        Parameters:
        random - Random variable distribution sampler.
        orig - Original initializer.
        Returns:
        an initializer whose value method will return orig.value() + random.sample().