what's going on everybody and welcome to
part 5 of our shenanigans with the
neural networks tutorial series in this
part what we're gonna talk about is the
results from training the gener the call
it a classification generator so let's
talk about it so as you can see what I'm
running right here is actually the let's
see you can I guess you can't see this
on the screen let me pull this up a
little bit if I can come on there we go
so basically what it's doing is every
time it gets the classification right
like that was a 1 it predicted it was a
1 this was a 7 I'm guessing this is a 2
it's a 0 and so on so these are all
incorrect and correct and correct and
then eventually it might get a correct
one like here 0 correct
so not a 7 anyways I've been running
this for a while about 316 tests 317 now
and it's about 22 percent accurate also
I'm still training this model this is
actually still very young model so
moving over here this is the model still
in training as you can see it has
leveled out quite a bit but if I do
smooth this out you should see that it's
still slowly tapering down still so I'd
like to actually let it keep going in
fact it's still it's like less than 10%
done with at least the 50 epochs that we
wanted to go through so I kind of wanted
to let it continue going but I didn't
want to do that if it was just a waste
of time so I actually did not know if
this was going to be successful my first
attempt was unsuccessful completely and
then I wondered if we gave it a little
more of an opportunity to get things
right if that would help
and sure enough it has so what I'd like
to do now is go over at least the code
that I use to get this I don't think
it's wise there's really no point for us
to write it so I just kind of want to
show you the logic that I'm doing to
detect whether or not we got something
right and also we should probably talk
about what the chances of getting it
right are so for example with a regular
classifier you would say the classifier
is better than random if it
makes a makes the prediction right in
the case of M misters 10 predictions so
anything over 10 percent is your better
than random now with a generative model
though I mean it could it's like an
infinite number of things that could
generate so we'd still like to see
something over 10 percent accuracy but
really any accuracy is pretty good
because it could have generated anything
as we can see it seems to get zeros
pretty well probably because it just
over predicts for a zero very frequently
but as you saw there it got the 3 right
and so on and the 9 anyways it's on it's
on a roll
that did look like a 4 come on man
anyway here is the code that I just kind
of changed up that's which this is
what's running right at this moment let
me just fit it to the screen so I don't
talk about something that you can't
actually see and not too much here that
is different as you can see it's the
same kind of logic that we've seen
before and again if you want this code
you can go to the text-based version of
the tutorial and it's I'll put it in
there it's actually not there right now
because I've made some changes anyway
yeah there we have that and basically
all it's doing is just gonna it's just
gonna iterate through the X's which in
this case yeah right there the
validation so these are numbers it's
never seen before so it's gonna iterate
through those and then it's going to
make a classification and output it now
our logic for doing this isn't
necessarily the greatest logic I'm still
very much in the development stage but
for example what constitutes and our
logic is whether whether we got it right
or not is wait I'm sorry this is not
updated hold on let me pull up the
updated one I feel I commented out this
logic but not shown the other logic one
moment okay take two yeah here's the new
logic so so yeah if Arg max of the label
is just in sample decode my you know for
the last 90 elements we just say yeah we
did did a good job but obviously there's
a few reasons why
why did it do that I'm not sure we must
have hit quit or something anyway we
were in 400 in two tests that's enough
tests I say anyway and that was on a
model with 18,000 steps and now we're
already at 21,000 actually so I'll
probably transfer over again in a little
bit anyway what I just wanted to do is
you see like is it worth me continuing
to train this model for a couple of days
or not and I think it is so I'm gonna
actually let this one continue I think
we'll continue with the next topic on
the tutorial and we'll probably come
back to this one for the results so
you'll have to stay tuned it's gonna be
a cliffhanger but right now getting
about 23 percent accuracy it's pretty
good but anyways as I was saying so in
the case of like a zero for example
there's frequently zeros so a lot of
times to just starts predicting another
number like this is a perfect example
where I mean it got the colons and it
started to soar to make that prediction
but then it just starts drawing another
zero basically or just who knows what
it's doing
but that's not totally right right and
we're classifying that as being correct
so take that with a grain of salt our
accuracy but just from running it and
visually inspecting it as well I I think
we're doing pretty good I'll worry about
making something a little more official
we'll probably use something like a
regular expression or something to find
something that fits the correct format
and then decide is this correct is it
not do we have a large group of like in
this case is it like a bunch of sevens
not just one seven or in this case like
it says five well if the prediction was
a five and all we had was just this I
would say no that's wrong
so anyways I'll do that but like I said
this was just just a really quick test
just sees anything here at all and I
think there is something here so that's
interesting so I'm gonna let this one
continue to run the other thing I'll
just show you too is if we do just run a
Python sample dot pi and equals let's do
five thousand and then let's just send
it to out dot text
if we do this it's actually really good
at oh the primer so hold on let's so the
primers of space and obviously we don't
have any spaces so let's do I think she
is it - - or is it
I can't move as prime or primer let's
check a - - prime yeah - - for the full
words
so anyway prime equals I don't know we
could just do like a bracket anything
really and wow that's going let me pull
up let's see this the one yes I already
have an out dot txt hopefully it'll get
replaced it's not the right time stamp
okay it says it's done looks good let's
open that up hmm okay I guess it's just
appended - it's okay well anyway as we
can see though this is like it should
get these really well so the ones that
it generates we should expect it that's
a goof you look in five like come on
it's getting these wrong okay let me do
a bigger one you're making me look bad
at least from what I've seen generally
it does a really good job of like
because in the one case we're doing a
general Asif occation and then the other
one it's doing generation which is like
stuff it's seen before so it should be a
it's a slightly easier task to get the
numbers right that it has generated it's
a much harder task to get the numbers
right that it's not generating so I
think I might I don't know this should
go pretty quick but I might have to
pause this one off we while we wait you
can also just check out this it looks
like it's starting to tick up here but
on a long enough time line it'll it
should just continue to at least level
out I don't think we're going to make
any more big changes but
I wouldn't mind letting it iterate a few
more times through its own data set
though still go and maybe I'll pause it
I'll just going to pause this until it's
done so it core don't I can't decide it
is that my fault is that like me hitting
a key that does that or or does that
just do that let's see do we have an out
text we at least have that's empty damn
it
okay let's do let's just do twenty five
thousand five twenty five okay
pausing okay it's definitely me hitting
control for that is my pause button that
is causing a core dump interesting I'd
noted thank you sir alright I'm gonna
pause now and I'm gonna run this all
right so now it is done let's see how
we've done ourselves
let's see out dot txt should be this one
so hopefully this will look a little
better than the other one so three
correct not a five one should be a six
one should be a nine seven four four
good good good I'm not actually sure if
that's a seven or a one I'm gonna give
it to him though so interestingly enough
this one actually he's doing worse at
generating the the classification part
during just a straight-up big big sample
than when it was just a one hot array it
did much better the other one but I'm
not really interested in in doing that
I'm not interested in the
classifications being right in the
generation where it just generates a
bunch I'm more interested in how
accurate it can be on things that's
never seen and stuff anyways but not bad
it's it's definitely better than it is
on numbers it's never seen but before it
was like perfect anyways yeah so that's
just that's just generation that's a
little easier than generating class
occasions on the validation set just to
be clear okay so what I'm gonna do is
I'm gonna leave this model training for
the couple of days that it needs to
train for in order to be fully done with
50 epochs I'll probably check in again
maybe about at epoch 10 or something
like that or maybe tomorrow I'll see
where we're at probably be like e buck
like 20-something or more so maybe we'll
check it again otherwise I'm going to
start us working on the next thing which
is rather than generating the
classification generating the number
based on the input that we want to put
in instead so it's very much like what
we've actually just been doing up to
this point just with a couple little
tweaks at least the way that I did it so
that's what we're gonna be doing in the
coming videos as always if you've got
questions comments concerns whatever
feel free to leave them below you can
support this content at Python permanet
slash support till next time