in Education by
I try to learn and implement a simple genetic algorithm library for my project. At this time, evolution, selection of population is ready, and I'm trying to implement a simple good mutation operator like the Gaussian mutation operator (GMO) for my genetic evolution engine in Java and Scala. I find some information on the Gaussian mutation operator (GMO) into the paper A mutation operator based on a Pareto ranking for multi-objective evolutionary algorithms (P.M. Mateo, I. Alberto), page 6 and 7. But I have some problem to find other information on how to implement this Gaussian mutation operator and other useful variants of this operator in Java. What should I do? I'm using the random.nextGaussian() function of random Java util, but this method only returns a random number between 0 and 1. So, a) How can I modify the precision of the return number in this case? (For example, I want to get a random double number between 0 and 1 with a step equal to 0.00001.) b) and how can I specify mu and sigma for this function, because I want to search locally about a value of my genome, not between -1 and 1. How can I adjust that local research around my genome value? After research, I found an answer to the b) question. It seems I can displace the Gaussian random number like this: newGenomeValue = oldGenomeValue + (( gaussiandRndNumber * sigma ) + mean ) where mean = my genome value. (Cf. method of the bottom page in How can I generate random numbers with a normal or Gaussian distribution?.) Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
The solution to your first problem is very simple, you just have to round off to the nearest 0.00001 to get your answer in these units. Here p = 0.00001; quantized_x =p * Math.rint(x/p);//This method returns the closest floating-point value Coming to your second question, your approach is right but you need to rescale your variable to the desired range. The only thing that can be added is the change of variable theorem from calculus:http://en.wikipedia.org/wiki/Integration_by_substitution If you work out this formula in the case of a Gaussian distribution with 0 mean and standard deviation 1 being transformed by a linear shift and a rescaling, then you will see that what you wrote out was correct. Here is a part of the code that you can implement: double next_gaussian() { double x = rng.nextGaussian(); //Use whichever method you like //here you can generate an initial [-1,1] gaussian distribution y = (x * 0.5) + 0.5; //Rescale to [0,1] return Math.rint(y * 100000.0) * 0.00001; //Quantize to step size 0.00001 } Hope this helps! Watch this video to learn about Neural Networks:

Related questions

0 votes
    I'm working through my AI textbook I got and I've come to the last homework problem for my section: "Implement the ... in C# or Java? Select the correct answer from above options...
asked Feb 4, 2022 in Education by JackTerrance
0 votes
    From what I've read so far they seem very similar. Differential evolution uses floating point numbers instead, and ... of both. Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    I am building a model for binary classification problem where each of my data points is of 300 dimensions (I am ... the 300 dim space? Select the correct answer from above options...
asked Feb 1, 2022 in Education by JackTerrance
0 votes
    In the MNIST beginner tutorial, there is the statement accuracy = tf.reduce_mean(tf.cast(correct_prediction, "float")) tf ... (x,1)? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I am currently working on an AI Agent that will be able to identify both the start state and the goal ... be greatly appreciated. Select the correct answer from above options...
asked Feb 1, 2022 in Education by JackTerrance
0 votes
    I'm trying to implement stochastic gradient descent in MATLAB however I am not seeing any convergence. Mini-batch ... cost of 420. Select the correct answer from above options...
asked Feb 1, 2022 in Education by JackTerrance
0 votes
    I am searching for information on algorithms to process text sentences or to follow a structure when creating sentences ... be great. Select the correct answer from above options...
asked Feb 4, 2022 in Education by JackTerrance
0 votes
    I am a little confused about the Hill Climbing algorithm. I want to "run" the algorithm until I found the ... question is too simple. Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    I'm trying to solve the Travelling Salesman Problem (TSP) with a Genetic algorithm. My genome is a permutation of ... problem in C#? Select the correct answer from above options...
asked Jan 26, 2022 in Education by JackTerrance
0 votes
    I write programs to play a board game variants sometimes. The basic strategy is standard alpha-beta pruning or ... human players. Select the correct answer from above options...
asked Jan 29, 2022 in Education by JackTerrance
0 votes
    I am learning programming (Python and algorithms) and was trying to work on a project that I find interesting. ... is impossible). Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    I'm writing a game that's a variant of Gomoku. Basically a tic tac toe on a huge board. Wondering if anyone ... [self put randomly]; } Select the correct answer from above options...
asked Feb 4, 2022 in Education by JackTerrance
0 votes
    I'm wondering how to calculate precision and recall measures for multiclass multilabel classification, i.e. classification ... labels? Select the correct answer from above options...
asked Jan 31, 2022 in Education by JackTerrance
0 votes
    The problem is that I cannot make a script that makes the enemy rotate so that "up" is pointing against the ... something simple... Select the correct answer from above options...
asked Feb 1, 2022 in Education by JackTerrance
0 votes
    I'm looking for a decent implementation of the OPTICS algorithm in Python. I will use it to form density-based ... to that cluster. Select the correct answer from above options...
asked Jan 28, 2022 in Education by JackTerrance
...