Hello and welcome to this Python tutorial.
All right so we just made the brain.
And now let's make the body.
So as you understood the body is the part where we define how the actions are going to be played like
what happens for real human body.
You know you have the brain that sends signals to the body and then your body plays the action.
Well that's the same we have our signals coming from the brain.
We get the output signal with the Ford function here.
You know first what happens is that we get the images the images go into the eyes of the neural network
composed of the three convolutional layers and then with the fully connected layers we get the output
signal from the brain which contains the values.
But then this output signal should be forwarded to the body and the body will play the action.
And so that's exactly the part that we're going to take right now.
We're going to implement the way the body will play the action and the way it will do it is with a certain
X method exactly like for the Southron car.
I insist that the max method is highly recommended for play in action with the body of the AI and therefore
that's the one we're going to go for.
But as opposed to the sort of income we're going to make in class and this class will of course correspond
to the body of the eye and therefore let's start by introducing a class here that we're going to call
soft next but like this I don't want to call it soft Max only because soughed Max is a class of Pi torch
from the end module.
So it's dangerous to call it this way.
Therefore I'm calling it sucked Maxwellian.
Now it's very clear that our CNN convolutional neural network is the brain and Sephton activity is the
body of the ear.
So Soft next body and let's inherit from the in that module.
I don't think we're going to use it.
But anyway we can still inherit from it.
You know in case you want to improve this stuff maximally class and want to use some tools from the
module Well you will be able to do it with the engine module.
But at this point I don't think we will be using any of the in a module.
So then in and let's go inside the body.
All right so first as usual we are going to start with our innate function to define the variables and
the future.
But.
That is the bodies of the AI AI and actually ask for a human body a parameter that can define it is
the temperature.
And actually that's going to be the only temperature.
So it's a simple body but still using this temperature parameter will do a lot for us.
OK but before the temperature let's not forget the self but the objects for the bodies and now we can
input the temperature see which is the same parameter as the one we use for this car.
OK.
And then Cullen and let's define our variables.
So since we inherit from DNA not Mudgal we're going to use the superfunction again.
And so let's be efficient let's keep Yes and let's face it that's right here.
And of course let's not forget to replace CNN here by soughed next buddy.
There you go.
Now I suppose that might become a reflex for you to use the superfunction at this stage.
And then what do we have to do is of course set are temperature variable with self that T and that will
be equal to the argument that will be input when creating an object at the next very class.
I remind that whenever you create an object of the soft next class you have to put the arguments that
are in the init function and therefore there is t and then the variable of your object attached to objects
self the team will be called to this T which is the argument that you will input.
All right.
And now that said for the function that's actually all we need.
So I guess we're ready to move onto the next function of the soughed maximally class.
And this is going to be the last function there are only two functions in any function.
And the next one that will implement in the next toile which will be the forward function and Whiteford.
That's because right now we have to forward the output signal from the brain.
That is you know the Cuno use content in the output neurons of the output layer to the body which will
play the action.
So we are forwarding the output signal from the brain to the body that will play the action move forward
go left go right turn left turn right or shoot.
All right so let's do that in the next to toile and then some Then I.