|
Re: Neural Net
It was me that "asked" about NNs in FRC use. Really great post.
A few things I want to add and clarify (in no particular order):
The most common sigmoid function, the logistic growth, has a range of (0,1). I typically use the tanh function to scale my outputs to (-1,1).
Say you want to use a NN to make a value of a sensor x. Let's say that sensor is a gyro and you have tank drive. So you have 1 node in your input layer and 2 nodes in your output layer and n number of nodes for your hidden layer(s). For this problem I would probably do 6 nodes in one hidden layer. Architecture of NNs is sort of a dark art. I'm currently researching rate of convergence of different architectures in the lab, but that is a long term project.
Moving on. In order for you to train your NN, you need to see how your output of your NN does in terms of your goal. But your output is motor values and you surely cannot compare motor values to a distance.
Here is one solution to this problem: wait a finite amount of time for an updated sensor value based on your motor values, then use that updated sensor value to see if what you wanted to happen did, and train accordingly through backprop.
I have a very generic NN program on my computer in the lab written in C++, I'll add it to this post when I go there. My code allows for multiple hidden layers, but anything more than 2 hidden layers I feel would be unnecessary for any machine control loop you need to do for FRC.
__________________
"You're a gentleman," they used to say to him. "You shouldn't have gone murdering people with a hatchet; that's no occupation for a gentleman."
|