Search Unity

ANN&TOOLS

Discussion in 'Assets and Asset Store' started by VirtualSUN, Sep 21, 2018.

  1. VirtualSUN

    VirtualSUN

    Joined:
    Jan 29, 2013
    Posts:
    57

    ANN&TOOLS
    A set of scripts for creating and learning your own artificial neural network.
    Creating your own artificial neural network (ANN) is not a big issue. But to teach the ANN to do certain tasks is a real challenge. In order to ease the task of creating and teaching the ANN, I wrote a set of scripts, that will do everything for you. The only thing that is needed from you is to “explain” the ANN properly, what information is needed to be learned.







    Requires Unity 5.6.1 or higher.

    Asset has:
    1. Perceptron's and Artificial Neural Network (ANN) generator/constructor.
    2. Two main methods of learning for Perceptron:
      • BackPropagation
      • Random generation
    3. One method of learning for ANN:
      • Neuroevolution of augmenting topologies (NEAT) and random generation.
    4. For basic demonstrations:
      • Self-learning car (for Perceptron and ANN)
      • Self-learning "Car2D" (for Perceptron and ANN)
      • Tennis (for Perceptron and ANN)
      • XOR (for Perceptron)
    5. Four lessons and demonstrations to them.
    Links:
    Contact:
    P.S.:
    If you have already purchased the ANN Perceptron and want to get a demonstration from the first video, then you will find it in the attached files to this post.
     

    Attached Files:

    Last edited: Dec 21, 2019
  2. VirtualSUN

    VirtualSUN

    Joined:
    Jan 29, 2013
    Posts:
    57
    A learned brain of tennis-stick. ANN Perceptron on the left and simple bot on the right.

    GIF
     
  3. VirtualSUN

    VirtualSUN

    Joined:
    Jan 29, 2013
    Posts:
    57
    "Cyber week mega sale" (11/26/2018-12/07/2018) gives you a 50% discount on ANNPerceptron : http://u3d.as/1aSY
     
  4. LoveIsGentle

    LoveIsGentle

    Joined:
    Apr 25, 2018
    Posts:
    8
    I've been using your asset for awhile and it's really great and user friendly! :D
    Wanted to ask, Been having some trouble training an AI in a particular way.
    I need to create two AI's, and have them learn at the same time.

    As an example.
    I have two robots that shoot lasers at eachother. They can use a shield to block lasers.
    I want to have them learn by fighting eachother.
    After the AI learns by fighting itself, i plan on adding that as an enemy for the player to fight.


    How would i go about doing that?
     
  5. VirtualSUN

    VirtualSUN

    Joined:
    Jan 29, 2013
    Posts:
    57
    What are the input/output data? Do you want every robot to have a different behavior? As I understand it, you use the "PerceptronLernByRandomGeneration" type of training.
     
  6. LoveIsGentle

    LoveIsGentle

    Joined:
    Apr 25, 2018
    Posts:
    8
    The Input is moving forward and backward,
    And The enemy robot's Input(Forward Backward, XY Position)

    Output is Moving Forward Backward.
    And shoot.

    And yeah, I'm trying to run two robots at the same time with a seperate behavior. And have them learn at the same time by fighting eachother using Random Generation.

    EDIT: Something allot like this
     
    Enumerator_T likes this.
  7. VirtualSUN

    VirtualSUN

    Joined:
    Jan 29, 2013
    Posts:
    57
    So. After several days of different approaches, I came to the conclusion that it would not be possible to normally learn 2 networks at the same time. For now. But you can easily learn the network on itself.

    A demo file is attached. The file "Test.ann" is the 1999 generation.

    I think that in the near future I will make an update for the network. More precisely, it will be a series of updates. I almost finished a new "ANN NEAT". Some updates will be associated with a new one.

    I am very glad that you ask questions. This allows me to develop. :)
     

    Attached Files:

    Last edited: Jan 17, 2019
    Enumerator_T likes this.
  8. LoveIsGentle

    LoveIsGentle

    Joined:
    Apr 25, 2018
    Posts:
    8
    Thankyou so much! :D I've just opened the project and i'm looking into it and it's pretty dang close to what i'm trying to work with :).

    I'm gonna take a week to work with it and see what i can develop and I'll get back to you :).
     
    VirtualSUN likes this.
  9. VirtualSUN

    VirtualSUN

    Joined:
    Jan 29, 2013
    Posts:
    57
    "ANN Perceptron" updated to version 1.051.

    Update for correctly work "ANN NEAT" with "ANN Perceptron".
    - Updated interface scripts.
    Updates regarding learning by random generation:
    - Updated menu interface random generation.
    Added settings to random generation:
    - The possibility learning by waves in the generation (constant maximum number or a certain amount in the wave).
    - Chance to change the sign of the weight to the opposite after the influence of generation on it.
    - The possibility of auto-saving perceptron during training.
    - No more need to reset the "longevity" of the "student" in the scripts.
    - Correction "crash" when resuming training.
    - Fixed the chance to choose the current worst generation when stopping training for not the best generation.
    Easy changes to the demonstrations.
     
  10. StevenPicard

    StevenPicard

    Joined:
    Mar 7, 2016
    Posts:
    859
    How feasible would it be to integrate something like this into a general purpose AI like Eliot AI? It would be great to have an ML AI like this integrated with an asset that handles all the other aspects.
     
  11. VirtualSUN

    VirtualSUN

    Joined:
    Jan 29, 2013
    Posts:
    57
    I do not see problems in integration. And what exactly is in the plans?
     
  12. VirtualSUN

    VirtualSUN

    Joined:
    Jan 29, 2013
    Posts:
    57
    "ANN Perceptron" updated to version 1.053:
    - The calculation of the best generation was fixed.
    - Fixed number of generation for new training.
    - Fixed previous update (the previous update was not updated correctly).
    - Changing the position of scripts in folders.
     
  13. VirtualSUN

    VirtualSUN

    Joined:
    Jan 29, 2013
    Posts:
    57
    "ANN Perceptron" updated to version 1.055:
    - Fixed visualization of weights.
    - Internal and external links are created in the instruction.
     
  14. VirtualSUN

    VirtualSUN

    Joined:
    Jan 29, 2013
    Posts:
    57
    "ANN&TOOLS" you can get here::https://assetstore.unity.com/packages/add-ons/machinelearning/ann-tools-138836

    Ver. 1.0661:
    - Minor cleaning scripts from the garbage.

    Ver. 1.066:
    - Fixed signatures in scripts.
    - Fixed update visualization of the activation function in the interfaces.
    - Correction in the instructions.
    - Added ability to save / load learning settings.
    - Added demonstration "Car2D".
    - Perceptron update:
    - In PerceptronLernByBackPropagation, “LearningSpeed” is limited to 1 second to avoid freezes. "LearningSpeed" continues to work in the next frame.
    - Fixed errors associated with the creation of a perceptron by scripting.
    - Minor changes in the perceptron interface.
    - ANN update:
    - Added the ability to add "memory connections" between neurons (except for input neurons) during training.
    - The neurons of the hidden layer can now get the connection between themselves in the form of "memory connections".
    - Added the ability to obtain "memory" from neurons.
    - Removed "Bias" in ANN.cs and ANNInterface.cs as unnecessary. Now the presence of Bias in neurons will depend on learning.
    - Additions in the visualization of weights.
    - Minor ANN solution optimization.
    - Reworked algorithm for calculating possible links.
    - Add-on interfaces related to NEAT.
    - Added "TennisANN" demo for ANN.
    - Added the ability for neurons to use different activation functions during training.
    - Fixed ANN solution after loading from the perceptron file.

     
    AthrunVLokiz likes this.
  15. VirtualSUN

    VirtualSUN

    Joined:
    Jan 29, 2013
    Posts:
    57
    ANN&TOOLS updated to version 1.0662:
    - Fixed a hang in the demo "Car2D" (Need specific settings for "Physics2D". The fix applies only to the "Car2DControl.cs" file).
     
  16. VirtualSUN

    VirtualSUN

    Joined:
    Jan 29, 2013
    Posts:
    57
    Hello!
    I think that here it will be necessary to combine two ANNs.
    The first ANN must have learned to recognize the meaning of words / images. For example: "long nose" = Output [0], "big" = Output [1], "smart" = Output [2].
    The second ANN will have to have as many input neurons as the first. And already the second should learn to search.
    In this case, the second ANN will be easier to teach search, as the words / images will be ordered by the first.

    One way or another, in large samples, the training time will be long.

    I think that in the next month I will be freed from my main job and will continue to improve ANN. Then I can draw attention to this issue in more detail.
     
  17. VirtualSUN

    VirtualSUN

    Joined:
    Jan 29, 2013
    Posts:
    57
    Unfortunately, at the moment I can’t say anything concrete.
    But if the input values are ordered, then learning will be quite easy (From my previous post, this is the second ANN). That is, it will work.
    I have not tried teaching ANN text / image recognition yet (1st ANN). It will be in the near future.
     
  18. blueskined

    blueskined

    Joined:
    Aug 9, 2015
    Posts:
    5
    cool, I would very much like to have a try of the text/image version of your tools, looking forward.
     
  19. blueskined

    blueskined

    Joined:
    Aug 9, 2015
    Posts:
    5
    Hello VirtualSun, when do u think we can try the texte/image version?
     
  20. VirtualSUN

    VirtualSUN

    Joined:
    Jan 29, 2013
    Posts:
    57
    At the moment, I can’t say anything for sure. I have not finished with the main work. For further development, I will return somewhere in 2 - 3 weeks.
     
  21. blueskined

    blueskined

    Joined:
    Aug 9, 2015
    Posts:
    5
    ok, sounds good.
     
  22. VirtualSUN

    VirtualSUN

    Joined:
    Jan 29, 2013
    Posts:
    57
    Hello!
    "ANN & TOOLS" and "ANNPerceptron" are on "Cyber Week Mega Sale" at Unity Asset Store!
    Discount 50%

    And updates are just around the corner. :)
     
  23. VirtualSUN

    VirtualSUN

    Joined:
    Jan 29, 2013
    Posts:
    57
    "Cyber Week Mega Sale" is over.

    Coming days I will continue to work on improving asset.
    What is your wishes?
     
  24. TacticalDan

    TacticalDan

    Joined:
    Jan 1, 2013
    Posts:
    35
    I'm considering using this asset to help me iteratively build a 1v1 fighting game, would it be possible to see the results of the TennisRNN demo or the RobotFight zip in a video? It'd be nice to see what kind of results were attained with a larger set of inputs and outputs.
     
  25. VirtualSUN

    VirtualSUN

    Joined:
    Jan 29, 2013
    Posts:
    57
    I will try to prepare in the near future.
     
  26. VirtualSUN

    VirtualSUN

    Joined:
    Jan 29, 2013
    Posts:
    57
    ANN&TOOLS updated to version 1.0681:
    - Updated visualization of neural networks.
    - Added file "InterfaceStyle.cs". Needed for visualization.
    - When manually stopping learning by random generation using the interface, the chance of the best of the generation and crossing are not used.
    - Simplified track-road for Car2D.
    - Fixed minor bugs.
     
  27. VirtualSUN

    VirtualSUN

    Joined:
    Jan 29, 2013
    Posts:
    57
    Here is a Tennis demo:


    In the first half of the video "ANN". In the second half - is the "ANN Perceptron" in the form of a Christmas tree. :)
     
  28. VirtualSUN

    VirtualSUN

    Joined:
    Jan 29, 2013
    Posts:
    57
    I did some tests. Text-character recognition is not a problem. When I finish the example, I will post it here. I will try to finish soon.
     
    Last edited: Jan 8, 2020
  29. VirtualSUN

    VirtualSUN

    Joined:
    Jan 29, 2013
    Posts:
    57
    Here is a test project for image recognition. In this case, the numbers.
    Also a little later I will add this demo to the asset.

    And for those who have not yet purchased the ANN&Tools, I suggest watching a video:
     

    Attached Files:

  30. VirtualSUN

    VirtualSUN

    Joined:
    Jan 29, 2013
    Posts:
    57
    I decided to think about future updates for #ANNandTools.
    Different people ask for different things. :)
    So, I decided to make a small task plan:
    1. Different diagrams.
    2. The new architecture for building ANN.
    3. ANN editor.
    4. Calculation with GPU (I need a new graphics card).
    5...
     
  31. Westy

    Westy

    Joined:
    Mar 9, 2014
    Posts:
    3
  32. VirtualSUN

    VirtualSUN

    Joined:
    Jan 29, 2013
    Posts:
    57
  33. Westy

    Westy

    Joined:
    Mar 9, 2014
    Posts:
    3
    And maybe an easier way to save and load networks. So once a network is designed with different activation function neurons and the ability to disconnect neurons from different weights. https://images.app.goo.gl/6SL7YYmFtEf4rSnW6 Be able to change between different teaching algorithms to teach to different parameters.
     
  34. VirtualSUN

    VirtualSUN

    Joined:
    Jan 29, 2013
    Posts:
    57
    The ready-made "designers" of neural networks in the asset do not allow this yet. Therefore, there is an idea of how to transform them so that it is possible to do the manipulations you describe.
    Because of this, I will have to make a new architecture for building networks. Point 4 of my list. :)
     
  35. VirtualSUN

    VirtualSUN

    Joined:
    Jan 29, 2013
    Posts:
    57
    ANN&TOOLS updated to version 1.0694:
    - Fixed visualization for the output layer at the perceptron.
    - Fixed visualization of the activation function when loading the perceptron.
    - Added diagrams of maximum error and accuracy for the backpropagation learning interface.
    - Some minor fixes.
     
  36. VirtualSUN

    VirtualSUN

    Joined:
    Jan 29, 2013
    Posts:
    57
    I think it will not be soon, but there will be a global update... Or a new asset. I'll look at the circumstances.
    Artificial Neural Network Editor.gif
     
    VanillaOasis and AthrunVLokiz like this.
  37. stanislavdol

    stanislavdol

    Joined:
    Aug 3, 2013
    Posts:
    282
    Hi, does it run on mobile devices?
    (I saw another ANN asset in the assetstore specifying that it only works on PC)
     
  38. VirtualSUN

    VirtualSUN

    Joined:
    Jan 29, 2013
    Posts:
    57
    Yes, it is quite. I just checked it myself. :)
    Asset algorithms use standard Unity commands.
     
  39. Enumerator_T

    Enumerator_T

    Joined:
    Nov 5, 2014
    Posts:
    16
    How long for this? Holy entities i can't wait!
    I hope it's included in anntools, i just bought it! I really love it! I really hoped there would be the graph in it already but this will aid me so much better, don't make it another product like some makers, that's just mean! improve your product and increase the price for newcomers otherwise it's unfair to the people who paid to have your product so early on in its development!
     
    VirtualSUN likes this.
  40. Enumerator_T

    Enumerator_T

    Joined:
    Nov 5, 2014
    Posts:
    16
    Can you give us a 'manual' selection of "best generation" by 'selected best learner child' at the end of each round? I would like to train with a more hands on approach if you can do it?

    Also, can we have a button to reset best longevity?
     
    Last edited: Apr 8, 2020
  41. VirtualSUN

    VirtualSUN

    Joined:
    Jan 29, 2013
    Posts:
    57
    Due to personal problems, and then “worldwide quarantine”, the work was postponed.

    But work will continue in the near future (I think from next week). And I will try to continue at an accelerated pace.
     
  42. VirtualSUN

    VirtualSUN

    Joined:
    Jan 29, 2013
    Posts:
    57

    It's been two weeks since I returned to work on a new version of "ANN & Tools". At the moment, almost finished the editor. There is still a lot of work ahead, but there is progress. :)
    In fact, the most difficult was to implement the "undo" functional. I rewrote everything at least 2 times.
    So far, it can create nodes and the relationships between them, move nodes, delete them, and change the node's type. It can also move freely along the work plane. And all this supports "undo" functional.
     
    AthrunVLokiz likes this.
  43. lyndontroy

    lyndontroy

    Joined:
    Dec 12, 2012
    Posts:
    31
    In the videos on the Unity Store site, you copy and paste C# code. Do you own the rights to the code? If so, when buying the assets from you, what rights to game developers are conveyed?
     
  44. VirtualSUN

    VirtualSUN

    Joined:
    Jan 29, 2013
    Posts:
    57
    I can’t remember the video wherever I copied and pasted code. Please specify in which video this is.
    The code in the asset is completely mine, I wrote it from scratch.
    And what rights are transferred to developers when purchasing other assets? I think this is a question for the store. :) But I think that you can freely use this asset, well, except for resale and remakes from copy/paste. :)
     
  45. VirtualSUN

    VirtualSUN

    Joined:
    Jan 29, 2013
    Posts:
    57

    A little more and I can move on to the tests. I hope so.

    I think in a few days and the editor will be ready, at least it will work. :) I still have many ideas, but I can’t put everything into practice right away.

    Probably, when everything is operational, there will be a beta-type update.
    Anyone wanting to test this in the future?
     
    Enumerator_T and AthrunVLokiz like this.
  46. VirtualSUN

    VirtualSUN

    Joined:
    Jan 29, 2013
    Posts:
    57
    Testing the correctness of creating a neural network.
     
    Enumerator_T likes this.
  47. VirtualSUN

    VirtualSUN

    Joined:
    Jan 29, 2013
    Posts:
    57
    I was again distracted by work and not only. :)
    But, I continue to work on this project. And here are some tests. Validation seems to work correctly. :)

    ANN and Tools.gif
     
    Enumerator_T and AthrunVLokiz like this.
  48. VirtualSUN

    VirtualSUN

    Joined:
    Jan 29, 2013
    Posts:
    57
    And here the ability to save and load the neural network has come. :)
    ANN&Tools.gif
     
    Enumerator_T likes this.
  49. VirtualSUN

    VirtualSUN

    Joined:
    Jan 29, 2013
    Posts:
    57
    Good day to all. At the moment the new neural network algorithm works well and I am preparing a random generation learning method (it is easier for me). There will be other methods in the future. But this product turned out to be radically different from previous versions. There will be support for "ann" files from previous versions. And here's my question: How advisable is it to provide scripting support for previous versions?
     
    Enumerator_T likes this.
  50. AizakuGaming

    AizakuGaming

    Joined:
    Feb 18, 2019
    Posts:
    1
    Hi Sergey. Got a project in mind where I need a mechanism that would analyze live data (a big set of vector3 and possibly some more) and in the end it should output 1 value that (basically naming what it sees). It is something similar to one of your examples with number recognition but way more data and input values may differ and change live.
    Is it possible for this tool and are there any challenges with this? Would like to talk about this more directly if possible. Do you have other means of communication?