Hello and welcome to this tutorial.
So now that we have a brain and a body we can make the AI of course we're going to assemble them and
you're going to see how now things are all going to make sense.
You're going to understand why we had to make some classes or more specifically the purpose of making
these classes.
And mostly you're going to get into it a sense of how you can play with objects to create new objects
bigger objects and as you understood we already created two classes the brain and the body.
So then by creating some objects of these two classes Well we can make a bigger object which will be
the AI.
And that's exactly what we're going to do.
Now we are going to make the AI by assembling the two classes that we created that is the brain and
the body.
So let's do this.
It's going to become super intuitive.
Now I'm going to introduce a new class which of course I'm going to call I because now we're ready to
make the final ai ai.
And right here I'm going to start with the IT function and what is this function going to take it is
right now that things will make a lot of sense.
Well first we get the inevitable self with the object.
But then the two arguments are going to be nothing else than a brain and the body.
That's the two elements that we need to build an AI AI.
We need a brain.
The neural network and a body which will play the action with some snacks.
And so now very simply what we have to do is defining the variables our object.
Because right now brain and body are just arguments so let's do this.
We have to make two variables obviously the first one is self brain which will be called to the brain
argument but which later will be a brain object created from the in class and then the second variable
itself that body which will be called to the body argument right here.
But which in the future will be of course and object of this next class.
And so now as simple as that.
Thanks to this pretty awesome structure that we made here we build an AI that trains yet not intelligent
yet but still we have a brain and a body.
So that's perfect.
And now the only thing that we have to do left is make a big forward function that will do the whole
propagation No since now our AI is assembled Well we're not going to use separately the two forward
functions.
You know the one of the brain and the one of the body we are going to make a big forward function which
will be our next function which will take the images as input then we'll probably get the signals in
the brain.
And for this we will of course use the first forward function and then once we get the output signals
of the brain we will forward these output signals into the body with the forward function here that
will use a certain next technique.
And then eventually we will return the actions to play.
And there is just now that we can make this big food function because we have assembled the brain in
the body.
And so we're not going to call this next function for it.
We're going to use the call function which is kind of like the init function with that we'll call the
two forward functions here from the brain in the body to propagate the signal from the very beginning
with the input images to the very end with the actions of play.
And that's why the next function will make now is this call function that will combine the two for functions
of the brain and the body.
That's the only thing we have to do and then we will have our AI ready.
So let's make this final step in the next tutorial and until then enjoy I.