Comments (3)
You are a right, the goal of all distance/error functions is to minimize their value. The built-in Network.prototype.evolve
function tries to minimize the error on a certain dataset. A simple workaround is used:
return -sum;
As negative fitnesses are supported by Neataptic. From my perspective, I think it is quite logical that a 'fitness function' should return a higher value if a genome performs better (thus is 'fitter').
I think this is just a matter of personal preference. If more people bring this up then I will reverse the sort function, but still, this would create some problems with selection.FITNESS_PROPORTIONATE
.
I could also create a seperate option when constructing the Neat
instance where you can specify if you want to minimize or maximize the value of the fitness function.
from neataptic.
Thanks for the work around suggestion! I didn't even think about negating the absolute sum result. Thank you for dedicating your time towards working on this project.
I think your argument makes sense. For example, let's say you want to write a fitness function which maximizes the amount made in a stock market trade. You want the network which has the greatest value. But, in another example, let's say you want a network to predict a position on an image; it would make sense to have your fitness function sum to zero be the maximum.
At the very least, I'd say document that the current implementation of the fitness function expects a maximum value to be the "most fit". (maybe I just skipped over that part in the docs, but I didn't read anything like that)
from neataptic.
Exactly. It depends on the problem. For some problems it is easy to define a maximum score (e.g. distance = 0) but not a minimum score and for some problems it is easy to define a minimum score (e.g. goals scored = 0) but not a maximum score.
I have added this extra info in the develop
branch (7fc2cb4) and it will be build soon. I hope that makes a little clearer. I still might implement an option that allows the choice for minimize/maximize score. Thanks for the appreciation 😄
from neataptic.
Related Issues (20)
- question #2 about agar.io AI?
- Neat's input and output parameters are useless if a network is provided HOT 1
- NEAT breaks with provenance with if no template network is provided
- No multithread on Neat.evolve()?
- neataptic LSTM bool sequence tunning
- XOR problem without hidden layer
- Not Found: @types/neataptic HOT 1
- Instinct or NEAT algorithm? HOT 1
- How to define output for evolve without target in game. HOT 4
- Multiple Crossover Methods HOT 2
- Cuda? HOT 5
- Handling dynamic data
- Softclip activation function
- Neataptic4J HOT 1
- Issue with multiple inputs and multiple outputs always returning NAN
- mutate() must skip elitist genomes
- Calculating ERROR THRESHOLD from propagation
- Copy a network? HOT 2
- neataptic from NPM version >=1.4.0 not working
- Copied network using fromJSON is returning outputs different from the original network
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neataptic.