Hello welcome to this new tutorial and here we go with the next step.
Gathering all the positive and negative rewards into one same list to compute the standard deviation
of all these rewards.
So here we go.
Let's introduce that huge list.
Well that's list of 32 words containing first the 16 percent reward and then second to 16 negative words.
So basically we're going to do a concatenation of lists and this list which I'm introducing right now
will be called all we want it and we'll get it by taking the non-pay library which has a shortcut and
P and then the trick is to use the array function because this allows to do a concatenation of lists
by just summing these two lists.
So by these two lists I'm talking of course about the list of positive words.
Let's take that first positive words.
Here we go.
And then here's what you can do you can do a plus and then add the other less you want to concatenate
the first list negative rewards.
Here it is.
And pasting here and there we go we have concatenated to previous list into a numb pie array.
So we have to understand that now we don't have a list like before but a number array but of one dimension
and therefore it is like a list.
But we wanted to convert that into a number array because then we're going to use the SDD method to
directly compute the standard deviation of all the values in this list integrated into a number.
Right.
So that's the purpose of doing this.
So I'm going to show you you take all three words and then just add a dot and then this s t d function
which will return you the standard deviation of all the values inside your list of other words positive
ones and negative ones.
And therefore since it returns the standard deviation we're going to introduce a new variable that will
be exactly this Sigma are variable.
That was the variable in the Date function because remember in order to do our one step of in the sense
we were dividing the learning rate here by little number of desperations times this standard deviation
of two words.
That's why we're getting it.
And therefore now that we've made and prepare this Sigma our Very well we'll be able to input it in
the arguments of the update function to make that one step of gray in the sense to update our policy.
All right so perfect.
Newstead done and now we're going to move onto the next step which will be something that we haven't
done yet any time with no function or method.
It is the sorting of the directions by the highest reward whether it is we were in a positive direction
or we were obtained in the opposite direction.
So we have to do it.
It will be quite easy just taking three lines of code and then that will mean that we will have done
everything here you know from 1 to 6.
And so finally we'll be able to make that update step by applying this one step of gray in the center
to update the weights and direction that increases the we want which is the whole purpose of what we're
doing.
So let's do that in the next story all sorting the directions and then we'll make that a data step until
then enjoy.