Package org.apache.commons.math3.random

Examples of org.apache.commons.math3.random.MersenneTwister


   
   
   
   
   
    RandomGenerator r = new MersenneTwister(1234);
   
    HiddenLayer layer = new HiddenLayer(20, 2, r);
    layer.setInput(input);
   
    MatrixUtils.debug_print_matrix_stats( layer.connectionWeights, "connection" );
View Full Code Here


        ,{0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,1,1,1,1}
        ,{0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0}
        }
    );

    RandomGenerator r = new MersenneTwister(1234);
   
    HiddenLayer layer = new HiddenLayer(20, 2, r);
    layer.setInput(input)
   
    Matrix output = layer.computeActivationOutput();
View Full Code Here

    public BaseNeuralNetworkVectorized(int nVisible, int nHidden, Matrix weights, Matrix hBias, Matrix vBias, RandomGenerator rng) {
        this.numberVisibleNeurons = nVisible;
        this.numberHiddenNeurons = nHidden;

        if (rng == null)  {
            this.randNumGenerator = new MersenneTwister(1234);
        } else {
            this.randNumGenerator = rng;
        }

        if (weights == null) {
View Full Code Here

   * Sample without replacement and a random rng
   * @param numSamples the number of samples to get
   * @return a sample data set without replacement
   */
  public DataSet sample(int numSamples) {
    return sample(numSamples,new MersenneTwister(System.currentTimeMillis()));
  }
View Full Code Here

   * @param numSamples the number of samples to get
   * @param withReplacement the rng to use
   * @return the sampled dataset without replacement
   */
  public DataSet sample(int numSamples,boolean withReplacement) {
    return sample(numSamples,new MersenneTwister(System.currentTimeMillis()),withReplacement);
  }
View Full Code Here

    this.numberVisibleNeurons = numVisibleNeurons;
    this.numberHiddenNeurons = numHiddenNeurons;
   
    if (rnd == null) {
     
      this.randNumGenerator = new MersenneTwister(1234);

    } else {
     
      this.randNumGenerator = rnd;
     
View Full Code Here

    this.neuronCount = neuronCount;
    this.neuronCountPreviousLayer = neuronCountPrevLayer;
    this.rndNumGenerator = rndGen;
   
    if ( null == rndGen ) {
      this.rndNumGenerator = new MersenneTwister(1234);
    } else {
      this.rndNumGenerator = rndGen;
    }
   
View Full Code Here

        this.hiddenLayers = new HiddenLayer[n_layers];
        this.preTrainingLayers = createNetworkLayers( this.numberLayers );

        if (rng == null) {
            this.randomGenerator = new MersenneTwister(123);
        } else {
            this.randomGenerator = rng;
        }

View Full Code Here

    private RandomGenerator generator;

    @Before
    public void setUp() {
        field = new DfpField(40);
        generator = new MersenneTwister(6176597458463500194l);
    }
View Full Code Here

            PointValuePair expected) {
        int dim = startPoint.length;
        // test diagonalOnly = 0 - slow but normally fewer feval#
        CMAESOptimizer optim = new CMAESOptimizer( lambda, inSigma, 30000,
                                                   stopValue, isActive, diagonalOnly,
                                                   0, new MersenneTwister(), false);
        final double[] lB = boundaries == null ? null : boundaries[0];
        final double[] uB = boundaries == null ? null : boundaries[1];
        PointValuePair result = optim.optimize(maxEvaluations, func, goal, startPoint, lB, uB);
        Assert.assertEquals(expected.getValue(),
                result.getValue(), fTol);
View Full Code Here

TOP

Related Classes of org.apache.commons.math3.random.MersenneTwister

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.