Questions tagged [fitness]

A fitness functions judges how good a solution of a problem is.

A fitness function is used to determine how well a solution fits a given problem. It is used in s.

87 questions
14
votes
1 answer

Need help designing fitness evaluation for a NEAT algorithm-based neural network

I am working on a neural network based on the NEAT algorithm that learns to play an Atari Breakout clone in Python 2.7, and I have all of the pieces working, but I think the evolution could be greatly improved with a better algorithm for calculating…
Mat Jones
  • 871
  • 1
  • 9
  • 25
10
votes
2 answers

How do I define a fitness function?

I'm working on a project which will have a selected set of data and each data will have different attributes. I will need to use a fitness function to choose the data that best matches my selected scenario using the attributes. However, I don't…
8
votes
5 answers

Genetic algorithm - new generations getting worse

I have implemented a simple Genetic Algorithm to generate short story based on Aesop fables. Here are the parameters I'm using: Mutation: Single word swap mutation with tested rate with 0.01. Crossover: Swap the story sentences at given point. rate…
4
votes
2 answers

How to scale and weight fitness of a given values?

I'm working on a GA. My problem is as follows. I have a fitness function which takes a couple of values: A - value which is huge, but less important for example 999999. (weight of importance 30% of the final result) B - value couple times smaller…
4
votes
1 answer

What is a good fitness function for an AI of a zero-sum game?

I am making an AI for a zero-sum 4-player board game. It's actually not zero-sum (the 4 players will "die" when they lose all their lives, so there will be a player who died first, second, third and a player who survived. However, I am telling the…
Sweeper
  • 145,870
  • 17
  • 129
  • 225
4
votes
0 answers

Backpack (knapsack) by means of genetic algorithm. How to add penalty to the fitness func

I use ga (matlab optimization tool) to solve the backpack problem. I wrote a simple fitness function with hardcoded weight-value array: function fitness = bp_fitness(x) % This function computes the fitness value for the 0-1 knapsack problem % x:…
4
votes
2 answers

How many and which parents should we select for crossover in genetic algorithm

I have read many tutorials, papers and I understood the concept of Genetic Algorithm, but I have some problems to implement the problem in Matlab. In summary, I have: A chromosome containing three genes [ a b c ] with each gene constrained by some…
3
votes
1 answer

How to know whether i'm forcing convergence too much, if my GA converges to the RIGHT solution quickly?

I'm developing a genetic algorithm to solve a two-dimensional knapsack problem. Currently, I'm testing with 50 itens, each one having a weight, volume, and value. Each cycle, 10(of my population of 500) of the best individuals survive to the next …
Eduard
  • 127
  • 4
3
votes
2 answers

Fitness sharing in DEAP

Is there any way to implement fitness sharing/niching using DEAP? Specifically I'm looking for an implementation of the method defined here (Goldberg's fitness sharing) on page 98 of the pdf. If you know of any other methods that are in DEAP, that…
David
  • 1,219
  • 1
  • 13
  • 19
2
votes
1 answer

Python DEAP - Custom fitness function

My question is about the possibility to implement a custom fitness function in DEAP/Python in my Genetic Programming implementation. After search and reading DEAP official documentation, i don't find anything about it, so, if one of you could help…
2
votes
0 answers

Java: Solving 15 Puzzle using Fitness functions

I am currently working on a project to solve a 15 Puzzle using fitness functions. There are 3 kinds of fitness functions that can be used, Fitness function1= 1 - (number of misplaced tiles/total number of tiles); Fitness function2= 1- (sum of…
2
votes
1 answer

Fitness Proportionate Selection when some fitnesses are 0

I have a question about what to do with the fitnesses (fitness'?) that are 0 when getting the fitness proportionate probabilities. Should the container for the members be sorted by highest fitness first, then do code similar to this: for all members…
2
votes
1 answer

Generate probabilities list for fitness proportionate selection (roulette wheel) in genetic algorithms

firs of all I apologize if my approach is too dumb or simplistic, I am an economist trying very hard to get into programming, therefore I lack some specific skills. Anyways, I have the following code: population = [[[0, 0, 1, 0, 1, 1, 0, 1, 1, 1,…
vferraz
  • 311
  • 2
  • 14
2
votes
0 answers

Implementing the Bayes' theorem in a fitness function

In an evolutionary programming project I'm working on I thought it could be a useful idea to use the formula in Bayes' theorem. Although I'm not totally sure what that would look like. So the programs that are evolving are attempting to predict the…
HedgepigMatt
  • 190
  • 2
  • 14
2
votes
1 answer

Issue in solving XOR using neural network and genetic algorithm

I'm trying to solve XOR problem using neural network. For training I'm using genetic algorithm. But after a certain number of generations (200), the error stuck in 1. And the outputs are correct except for 1 xor 0 where the output is 0 instead of 1…
1
2 3 4 5 6