accord-net / framework

Machine learning, computer vision, statistics and general scientific computing for .NET
http://accord-framework.net
GNU Lesser General Public License v2.1
4.48k stars 1.99k forks source link

QLearning With Infinite Number of states(attached completed code) #367

Open mentaman opened 7 years ago

mentaman commented 7 years ago

Why Inspired by this tutorial https://www.nervanasys.com/demystifying-deep-reinforcement-learning/ working on my game, I needed QLearning that will work with any number of states. thought it might be useful for you too 👍 I've used this BigInteger library: https://biginteger.codeplex.com/ There is another library that comes with c# that you can use instead, but I couldn't use it because it isn't supported in unity.

The code: QLearning.zip My code might require some refactoring, but hope it'll be useful to you anyway. All you have to do is replace my QLearning.cs with yours and add BigInteger somewhere(or replace to the default c# BigInteger). There are some useful functions in BigIntegerExtensions, if you want to combine QLearning with neural network.

Also I'm not sure that my way is the best way to accomplish infinite of states, but it sure works.

cesarsouza commented 7 years ago

Many thanks! I am sure this should be a good addition to the framework and many users will find it useful!

cesarsouza commented 6 years ago

Hi @mentaman!

Thanks again for the contribution back in January! Before I can finally integrate it in the framework, may I ask whether you whether you agree to share your code under the MIT license, and which name/contact information should I put in the copyright header?

Regards, Cesar

mentaman commented 6 years ago

Agree sure :) I would be glad to. Sorry I havent seen your message.

Im just not sure I've implented it correctly. Should I send it as a pull request?