genetic-algorithm

Parallelize for loop in python

北城以北 提交于 2020-01-05 05:50:08
问题 I have a genetic algorithm which I would like to speed up. I'm thinking the easiest way to achieve this is by pythons multiprocessing module. After running cProfile on my GA, I found out that most of the computational time takes place in the evaluation function. def evaluation(): scores = [] for chromosome in population: scores.append(costly_function(chromosome)) How would I go about to parallelize this method? It is important that all the scores append in the same order as they would if the

Retrieve a specific permutation without storing all possible permutations in Matlab

谁都会走 提交于 2020-01-03 00:37:22
问题 I am working on 2D rectangular packing. In order to minimize the length of the infinite sheet (Width is constant) by changing the order in which parts are placed. For example, we could place 11 parts in 11! ways. I could label those parts and save all possible permutations using perms function and run it one by one, but I need a large amount of memory even for 11 parts. I'd like to be able to do it for around 1000 parts. Luckily, I don't need every possible sequence. I would like to index

Algorithm to optimize # threads used in a calculation

笑着哭i 提交于 2020-01-02 05:42:46
问题 I'm performing an operation, lets call it CalculateSomeData. CalculateSomeData operates in successive "generations", numbered 1..x. The number of generations in the entire run is fixed by the input parameters to CalculateSomeData and is known a priori. A single generation takes anywhere from 30 minutes to 2 hours to complete. Some of that variability is due to the input parameters and that cannot be controlled. However, a portion of that variability is due to things like hardware capacities,

Genetic algorithms: fitness function for feature selection algorithm

巧了我就是萌 提交于 2020-01-02 02:42:08
问题 I have data set n x m where there are n observations and each observation consists of m values for m attributes. Each observation has also observed result assigned to it. m is big, too big for my task. I am trying to find a best and smallest subset of m attributes that still represents the whole dataset quite well, so that I could use only these attributes for teaching a neural network. I want to use genetic algorithm for this. The problem is the fittness function. It should tell how well the

How to prevent genetic algorithm from converging on local minima?

僤鯓⒐⒋嵵緔 提交于 2020-01-01 03:37:09
问题 I am trying to build a 4 x 4 sudoku solver by using the genetic algorithm. I have some issues with values converging to local minima. I am using a ranked approach and removing the bottom two ranked answer possibilities and replacing them with a crossover between the two highest ranked answer possibilities. For additional help avoiding local mininma, I am also using mutation. If an answer is not determined within a specific amount of generation, my population is filled with completely new and

How to find the best parameters for a Genetic Algorithm?

杀马特。学长 韩版系。学妹 提交于 2020-01-01 03:31:22
问题 Some Genetic Algorithm frameworks, such as http://www.aforgenet.com/ requires many parameters, such as mutation rate, population size, etc There is universal best numbers for such parameters? I believe that it depends on the problem (fitness function delay, mutation delay, recombination delay, evolution rate, etc). My first thought was to use a GA to configure another GA. Any better ideas? 回答1: The one time I programmed a genetic algorithm I included those values in the values to mutate,

AI How to model genetic programming for Battleships

你离开我真会死。 提交于 2019-12-30 03:34:10
问题 I have a question regarding Genetic Programming. I am going to work on a genetic algorithm for a game called Battleships. My question is: How would I decide upon a "decision" model for the AI to evolve? And how does that work? I have read multiple papers and multiple answers that just speak about using different models, but could not find something specific, which, unfortunately, I apparently need to wrap my head around the problem. I want it to evolve over multiple iterations and "learn"

When should I use genetic algorithms as opposed to neural networks? [closed]

旧街凉风 提交于 2019-12-29 10:10:02
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . Is there a rule of thumb (or set of examples) to determine when to use genetic algorithms as opposed to neural networks (and vice

When should I use genetic algorithms as opposed to neural networks? [closed]

走远了吗. 提交于 2019-12-29 10:09:07
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . Is there a rule of thumb (or set of examples) to determine when to use genetic algorithms as opposed to neural networks (and vice

Roulette wheel selection algorithm [duplicate]

吃可爱长大的小学妹 提交于 2019-12-27 11:59:09
问题 This question already has answers here : Roulette Selection in Genetic Algorithms (13 answers) Closed 3 years ago . Can anyone provide some pseudo code for a roulette selection function? How would I implement this: I don't really understand how to read this math notation.I want General algorithm to this. 回答1: The other answers seem to be assuming that you are trying to implement a roulette game. I think that you are asking about roulette wheel selection in evolutionary algorithms. Here is