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.

104 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
  • 936
  • 1
  • 10
  • 27
11
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…
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…
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

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…
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
  • 213,210
  • 22
  • 193
  • 313
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

Service account authentication for Google Fit API

I am quite a beginner and I am trying to write a standalone Node/JS application that will run on a raspberry pi, without any GUI. I need to retrieve physical activity data from the Google Fitness REST API without using oauth2. I understand it can be…
Lorenzo Sandini
  • 117
  • 1
  • 8
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,398
  • 1
  • 14
  • 20
2
votes
0 answers

Android Wear OS with Google Fitness API

I have an application with package name: com.x, and I created a module wear OS with package name com.x.watch. I created a separate project for each on firebase linked to Google API console. I enabled the Fitness API, added the correct Sha-1, and…
2
votes
1 answer

Migrating Samsung Health data without Samsung Cloud account

I am currently migrating to a new phone and would like to sync the Samsung Health data. I don't have a Samsung Cloud account and don't want to sync my stuffs anywhere except my new phone. There was a solution for this I used it a few years ago (when…
Gábor Héja
  • 458
  • 7
  • 17
2
votes
1 answer

Using firebase google auth and google fit api with single OAuth2 token

I am currently working on a simple web app that will make an GET call to a user's google fit data. To reduce the complexity of the app, I plan to host it on firebase and take full advantage of cloud functions, firestore and the authentication…
William Chou
  • 752
  • 5
  • 16
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…
1
2 3 4 5 6 7