NEAT - Java Implementation 5 - Mutations

Поделиться
HTML-код
  • Опубликовано: 20 дек 2024
  • Full source code: mega.nz/#!WjRW...
    Only frame classses: mega.nz/#!jzRS...
    add_sorted method:
    mega.nz/#!u7ZG...

Комментарии • 31

  • @maxbas2018
    @maxbas2018 4 года назад

    the links for the download aren't available anymore and I dont have any knowledge about AWT yet, would be nice of you if you can reuploud them for now. Thanks ;)
    just saw you already did it in the comment below xD

  • @georgechristoforou991
    @georgechristoforou991 5 лет назад

    How do you prevent an add node creating a new node if that new node has been created before between node a and node b. Would it be possible to check if there is a link from node a to node b that has been "hidden" before to avoid repetition.

    • @finneggers6612
      @finneggers6612  5 лет назад +1

      good question. yes i check if that connection exists. furthermore, if it does not exist for this genome but maybe for another one, there is a hashmap to ensure that a link from node a to node b has always the same ID for any genome

    • @qzdoiqzdkhqzdkjhg
      @qzdoiqzdkhqzdkjhg 2 месяца назад

      @@finneggers6612 if a connection from a to b already exists in another genome its set with the same innovation number ? i saw somewhere that it was not, to find out how close 2 different genomes's historical are but maybe i didnt understand what they said

  • @nyume815
    @nyume815 5 лет назад

    Input nodes won't connect to other input nodes, just hidden and output nodes, is this a correct statement?

    • @finneggers6612
      @finneggers6612  5 лет назад

      the way i implement this, yes.
      I do not know if other implementations did this but i dont think so because it doesnt make any sense at all.

  • @2yaya123
    @2yaya123 5 лет назад

    Wowwwww AMAZING VIDEO!!! That works was so well!!!!!!! Thank you so much

  • @nckjnsn
    @nckjnsn 5 лет назад

    Great video series!!
    When i implement your add_sorted function, the compiler gives me a note/error
    Note: .\data_structures\RandomHashSet.java uses unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    What can i do to fix that :/ It has something to do with that TypeCasting
    -----Error----
    .\data_structures\RandomHashSet.java:54: warning: [unchecked] unchecked cast
    data.add(i, (T)object);
    ^
    required: T
    found: Gene
    where T is a type-variable:
    T extends Object declared in class RandomHashSet
    .\data_structures\RandomHashSet.java:55: warning: [unchecked] unchecked cast
    set.add((T)object);
    ^
    required: T
    found: Gene
    where T is a type-variable:
    T extends Object declared in class RandomHashSet
    .\data_structures\RandomHashSet.java:59: warning: [unchecked] unchecked cast
    data.add((T)object);
    ^
    required: T
    found: Gene
    where T is a type-variable:
    T extends Object declared in class RandomHashSet
    .\data_structures\RandomHashSet.java:60: warning: [unchecked] unchecked cast
    set.add((T)object);
    ^
    required: T
    found: Gene
    where T is a type-variable:
    T extends Object declared in class RandomHashSet
    4 warnings

    • @finneggers6612
      @finneggers6612  5 лет назад +2

      Nick Janßen you can put everything in a if Clause:
      If(objectName instanceof Gene){.... Rest of the Body}
      But even with that warning it should be compiling...

    • @nckjnsn
      @nckjnsn 5 лет назад

      Thanks! Yes It did compile but I thought it was maybe a bigger Problem in the ongoing series😄

    • @finneggers6612
      @finneggers6612  5 лет назад +1

      Nick Janßen well yeah there shouldn’t anything happen because we only that method for genes but java doesn’t know that. So if the generic type is not an instance of Gene, it could not typecast that

    • @nckjnsn
      @nckjnsn 5 лет назад

      Ok, thanks!👍

    • @finneggers6612
      @finneggers6612  5 лет назад

      @@nckjnsn I can point that out in the next video. prob doing it today :)

  • @afrodisco2655
    @afrodisco2655 5 лет назад

    Can you put this on GitHub or PasteBin ? It's more developer friendly. ;)

    • @finneggers6612
      @finneggers6612  5 лет назад

      I can do that if you like. I am not home for the weekend so I will upload everything on Sunday (as long as I do not forget it)
      ;)

    • @finneggers6612
      @finneggers6612  5 лет назад

      The thing about GitHub is that I can only upload the final code, right?

    • @afrodisco2655
      @afrodisco2655 5 лет назад

      @@finneggers6612 Actually you may upload any part at any state, even if its not working (but not recommended).
      The best way to do is to update the code after each episode with the current working code.

    • @finneggers6612
      @finneggers6612  5 лет назад

      @@afrodisco2655 sure yeah but assuming that someone watches the first video in, let's say, 2 months, he will find the full code and might get confused about that. Or am I wrong?

    • @finneggers6612
      @finneggers6612  5 лет назад

      I am probably gonna do both. GitHub with the full code and the mega.nz files for each video.

  • @bennidasbrot
    @bennidasbrot 5 лет назад

    Thanks for the great work! love the videos! sadly I can't open the rar files. they are "destroyed" and I can't repair them. git would be realy great. if you would have shown the code in the video for a second I could continue ;)

    • @finneggers6612
      @finneggers6612  5 лет назад +1

      Benjamin Schmitter I an sorry for that.
      I am not on my pc so I don’t know if I still have those files but I have got a repo based on it.
      github.com/Luecx/AILibrary/tree/master/src/genetic_algorithm/neat
      The could should be95% similar. I don’t know if there a actually differences.
      If this does not help, I can later also check the files on my pc. Just let me know

    • @bennidasbrot
      @bennidasbrot 5 лет назад

      ​@@finneggers6612 thanks for the fast reply. so there are a few differences, like you are using different data structures. I tryed to adapt them but it doesn't work for now - I'm not sure why. but probably the repo content is the final result of the playlist? or is it the content of another video? so I'm gonna continue and should be able to make it work on my own ;).
      thanks again. I let you know if I'd still need the files after the playlist.

    • @finneggers6612
      @finneggers6612  5 лет назад

      @@bennidasbrot What do you mean with different dats structures?
      In terms of the created lists, maps etc, it should be the same afaik.
      Or isnt it?

    • @bennidasbrot
      @bennidasbrot 5 лет назад

      in this link for example in the neat class you are using java util hashmaps and not the selfmade randomhashset, which wasn't working with the implementet panel functions. but in the later videos you have a different link github.com/Luecx/NEAT/tree/master/vid%205/src to the specific code for the videos. this is working fine. should have found those :D. so, all fine, thanks! perhaps you could just add the specific link to vid 5 in the description.

    • @peebiButtaJelli
      @peebiButtaJelli 3 года назад

      @@finneggers6612 currious how this function is working
      public ConnectionGene getConnection(NodeGene node1, NodeGene node2){
      ConnectionGene connectionGene = new ConnectionGene(node1, node2);
      if(all_connections.containsKey(connectionGene)){
      connectionGene.setInnovation_number(all_connections.get(connectionGene).getInnovation_number());
      }else{
      connectionGene.setInnovation_number(all_connections.size() + 1);
      all_connections.put(connectionGene, connectionGene);
      }
      return connectionGene;
      if when a new gene is made it saves from, to, and innovation as a key and value but when checking if its already made you check for the key but never change the innovation number so its just 0 by default which should mean this code should look at all connections as new