blueteak / unity-neural-network Goto Github PK
View Code? Open in Web Editor NEWSimple neural network implemented in C# for Unity3D
Simple neural network implemented in C# for Unity3D
The jumping test scene doesn't include a prefab (or 2 can't really tell exactly) so it fails to properly run.
I can't be bothered to fix it to make it "work", it's really a minor inconvenience as the actual library is so dang simple figuring out how to use it is straight forward enough, and the bg selection test scene works fine after import. (it may be because im on unity 2017 not unity 5.2 or whatever this scene was created in)
For my own fork I'll likely take the test scene out since it doesn't work, but don't know if you really care about that or not for this repo.
re random nonsense:
Eventually I'm going to be adding a lot of stuff around this little toy nn, for my own use. I doubt most of it would really be all that useful to add to this, since this is so simple adding the stuff I'm interested would probably just bog it down and make it more complicated than it needs to be (genetic evolution training, selection of activation function at nn construction, a network visualizer, serialization of nn for loading, saving, and cross breeding networks, it is currently possible to save and load with adding [System.Serializable] to all the objects, but that doesn't give a serialization that's good for cross breeding)
Actually with the kind of nn i'm going to be looking at for things I want to do, it probably be better for me to build my own nn class that removes the lowlevel class abstraction and replaces it with pure matrix internal for faster learning and calculation, but idk, at this point i probably don't need it and this is a rather nice and simple easy to use nn, which learns well enough and is reasonably fast.
In a video game training is best done by Genetic Algorithms.
It would be nice to implement it.
Does not converge for sample program below.
Why?
private static double MinimumError = 0.1;
private static NeuralNet _network;
private static List<DataSet> _dataSets;
#endregion
static void Main(string[] args)
{
_numInputParameters = 2;
_numOutputParameters = 1;
_numHiddenLayers = _numInputParameters;
_hiddenNeurons = _numInputParameters;
_network = new NeuralNet(_numInputParameters, _hiddenNeurons, _numOutputParameters);
_dataSets = new List<DataSet>();
for(int i=0; i<10; i++)
{
for(int j=0; j<10; j++)
{
double[] inputs = { (double)i/10, (double)j/10 };
double[] targets = { (double)i/10 + (double)j/10 };
var ds = new DataSet(inputs, targets);
_dataSets.Add(ds);
}
}
_network.Train(_dataSets, MinimumError);
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.