Very nice video! Only one suggestion to make the network a lot faster! you can combine the countExcessGenes, countDisjointGenes and averageWeightDiff method into one! this way you dont need to make the nodeKey and conKey lists every time and you only need to loop through the indices once! the combined method i made was 31 times faster :) I do recommend still keeping the old ones though for situations where you need one of the three variables. Here is the code: public static float compatibilityDistance(Genome genome1, Genome genome2, float c1, float c2, float c3) { int excessGenes = 0; int disjointGenes = 0; float avgWeightDiff = 0; float weightDifference = 0; int matchingGenes = 0; //nodes List nodeKeys1 = asSortedList(genome1.getNodeGenes().keySet(), tmpList1); List nodeKeys2 = asSortedList(genome2.getNodeGenes().keySet(), tmpList2); int highestInnovation1 = nodeKeys1.get(nodeKeys1.size() - 1); int highestInnovation2 = nodeKeys2.get(nodeKeys2.size() - 1); int indices = Math.max(highestInnovation1, highestInnovation2); for(int i = 0; i
@GrowlingM1ke
5 жыл бұрын
Just do an additional check on calculating avgWeightDiff for matching Genes because there could be a case where there are no matching genes.
@georgechristoforou991
5 жыл бұрын
Nice work. I might be wrong, but if you only count the number of connection genes in the excess and disjoint count functions then you won't need an INNOV number for node genes. Also you can get away with not sorting the arrays over and over, if you maintain them as sorted during mutations, etc
@triularity
2 жыл бұрын
@7:06 - I don't think the nodes need an innovation number for that. Simply take the genome with highest connection innovation, if any, (as you were already doing) and those are the excess. Anything else is disjoint. Though to simplify things, you might have also calculated the minimum of the two highest innovations to give you the division point between disjoint and excess. e.g. disjoint = X < minHighestInno. excess = X > minHighestInno.
@uonliaquat7957
3 жыл бұрын
Why do you need to count both from NodeGenes and ConnectionGenes in countMatchingGenes function. Don't you think it's intuitive to count only from connection Gene?
@bullymaguire2061
6 жыл бұрын
Keep it up MAAAN!!! U r amazing and I wanna learn how to implement this in a real game!
@uonliaquat7957
3 жыл бұрын
In your mutation function, you are just checking if conenction exists in a List what if the connection doesn't exist there but it exists somewhere in another Gene, why aren't you using the same instead of creating a new one?
@felixschildorfer1160
6 жыл бұрын
Great Work! Really helped me understand a lot about NEAT implementation. Could you put the source code up somewhere?
@joaogui1
4 жыл бұрын
github.com/hydrozoa-yt/hydroneat
@liwaiyip1769
4 жыл бұрын
I am a little confused about the innovation number. If every gene uses the same innovation generator, then why will there be a matching gene? Shouldn't every gene have a different innovation number? Edit: I understand now. There will still be matching genes if two children from the same parent crossover.
@tsukuyomu2313
5 жыл бұрын
can u explain it, why u give innovation number to node genes? u mentioned that it would not be possible to count the matching. disjoint and excesses if u don't give innovation numbers to node genes. but why? it seems really that neat just measures the matched and unmatched connection genes, also if theres a node that not included in one parent the connection also not exist, i consider this situation as 1 disjoint/excess, but if i count the node genes, it would become 2 disjoint/excess. Am i misunderstanding something?
@FrankSquirel
4 жыл бұрын
My understanding is that NEAT only cares about the disjoint/excess connection genes. But if you wanted to count the matching/disjoint/excess node genes, and you don't have an innovation number associated with nodes, (i.e. node id is based on index) you could have a case where gene 1's node 3 does not match gene 2's node 3. In this case, with innovation numbers, one of the nodes would have innovation number 4. Sorry if that's confusing, if that doesn't make sense just let me know - it would be easier to explain with a diagram.
@tsukuyomu2313
4 жыл бұрын
@@FrankSquirel thx for the reply, but since it was too long ago. I dont really remember which part i meant. However, if i understood it correct, for each unique node, neat gives a unique identifer to each of the unique nodes like an innovation number. But,during the mutation or crossover, it only need to check the connection, for instance, parent A has a connection says node 2 connected with node 3, but parent B don't have this connection (may be disnabled) but a connection shows 2 and 4 are connected, then its just one disjoint. Thats my understanding after abount one year. Maybe it's also what u means with the innovation numbers?
@FrankSquirel
4 жыл бұрын
@@tsukuyomu2313 Your understanding is right :D I was just explaining how innovation numbers would work for NodeGenes, if they were needed. (They're not)
@mhatreaditya
6 жыл бұрын
When is the next part coming ?
@alexxis246
5 жыл бұрын
Is there a difference between the "DISABLED" label and Weight = 0?
@adrianroed2178
5 жыл бұрын
There is a difference in the speciation function, where they are considered separate things, but a network would act the same if you switched one for the other.
@WalrusDesign
6 жыл бұрын
Holy shit you are really smart, I can barely keep up. It's still really interesting tho, even if I'm not good enough at math to understand half of it. Cool vid :D
@Hydrozoa
6 жыл бұрын
+peaches Thanks man, I appreciate it. I agree this video in particular is a bit hard to follow. I'll try to explain better in the future :D
@WalrusDesign
6 жыл бұрын
Hey, I was really bored, and made you some channel art: imgur.com/a/iyNRN
@Hydrozoa
6 жыл бұрын
That's really cool, thanks a lot. I've changed my banner now. Beautiful.
@Infinity7111
5 жыл бұрын
Amazing guide...
@philippg6023
5 жыл бұрын
why do I need the compatibility distance exactly?
@philippg6023
5 жыл бұрын
ah okay to protect new genes and small species
@rohanasokan7338
4 жыл бұрын
@@philippg6023 Or more like niche specialization. Quite literally how nature works, water animals live and water and evolve, then we have land animals that evolve too, but on land. If nature worked without the "compatibility distance", then if it considered water animals to be superior, land animals would never have risen. It basically protects all species that are generated.
Пікірлер: 29