colgreen / sharpneat

SharpNEAT - Evolution of Neural Networks. A C# .NET Framework.
https://sharpneat.sourceforge.io/
Other
375 stars 96 forks source link

your commit of connectionweight seems to be wrong(this commit wont effect anything) #9

Closed mentaman closed 7 years ago

mentaman commented 7 years ago

Hey, I've seen that you added this connectionWeight calculation. https://github.com/colgreen/sharpneat/commit/0645b9aef10b7b7fd00d4d989805a608dac3fb84

double connectionWeight = _genomeFactory.GenerateRandomConnectionWeight(); if(_genomeFactory.Rng.NextBool()) { connectionWeight *= 0.01; }

but you dont use it. you just generate a new one after..

newConnectionGene = new ConnectionGene(existingConnectionId.Value, sourceId, targetId, _genomeFactory.GenerateRandomConnectionWeight());

instead of newConnectionGene = new ConnectionGene(existingConnectionId.Value, sourceId, targetId, connectionWeight);

also I think that this behaviour should be in the GenerateRandomConnectionWeight function itself.

colgreen commented 7 years ago

Thanks. Fixed in #36072d0

I think that this behaviour should be in the GenerateRandomConnectionWeight function itself.

I haven't done this because that function is also used when doing a reset weight mutation, which probably should use the full range. The whole area probably needs a rethink so I'll leave it for the time being.