unity-web-neural-network
is a .NET library implementing a simple multi-layer feed forward neural network with supervised learning.
It's currently just an ad-hoc library for an AI demo project, and is geared towards use within Unity 3D. Particularly for the WebGL target, which ultimately converts the IL to JavaScript. It uses very few allocations, bare arrays instead of lists, loops instead of iterators, no LINQ, and targets only the .NET 2.0 framework.
I would consider this pre-alpha. It works, but has no tests, probably has edge cases, and could use an API redesign. I did some initial profiling with Unity's built-in profiler, and found that the script execution time was quite reasonable. I was calling FeedForward() on 20 4-layer networks with 400+ weights each, every 1/60th of a second. That CPU time was much lower than the time spent doing physics raycasts for distance checking. So qualitatively it seems pretty good, and will probably be developed further.
An AI steering and obstacle avoidance demo using this library.
- Write tests
- Reduce heap allocation, use arrays of structs instead of classes
- Allow for topologies more complex than just: inputs -> n hidden layers w/ m neurons each -> outputs.
- Backpropgation learning
- Whatever its use cases demand