Advertisement Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views


Sign in to follow this  


Here is my C# class for a Multilayer Neural Network (single hidden layer) with example. I haven't tested it much, but it seems to work. The hidden neuron activation functions are 1/(1+exp(-x)) and the output layer neurons are linear, x. You don't have to add a bias term, it will already include one to your input vector. Free for all to use just as long as you don't come back to me with problems hehe.

This differs from the perceptron because the outputs are not simple 0's and 1's. It can be any number. In the example, I train it with -x^2 and sin(x) functions within the interval [0,3.14159]

You might think of how it can be used in a game. For instance, you can train it to provide the correct outputs to a throttle or wheel turn in response to measurements from the road, velocity, etc. I plan to probably use it to train some sprites to move around in response to you shooting it (i.e. train it to be the evaluation function of a GA).

Sign in to follow this  

1 Comment

Recommended Comments

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!