what's going on everybody welcome to
another part 2 the ml in highlight 3
series in this video what we're gonna be
doing is checking out our distribution
for our you know randomly train or our
model that learned from random movements
but of course we set a threshold and the
question is did the distribution of all
games above I think it was either 40 100
or 40 200 is that distribution after the
models been trained has it improved
we're not expecting to see a huge
improvement but some improvement would
be nice so what we can do is open up
training data distribution this reads
training data which is the one that we
made let me just take this copy/paste so
the old one our original one averaged a
4202
and the new one averages a 42 96 so
quite a bit better almost 100 about 94
better and like a hundred out of a four
thousand would be 2.5% so maybe
somewhere around two-ish
percent is what we got here improvement
over random which sounds a horrendous
but if we can continue to get that kind
of incremental improvement then we would
there's there would be something there
for us and so I think you know this is a
worthy practice to continue doing but
I'd like to make a few changes to our
our actual BOTS here so there's a few
things one is we're only playing for 50
turns still I still want that to be the
case so long as our AI is relatively
dumb there's no benefit I don't think
through running through longer games so
I think we still want to keep at about
50 turns I think that's a pretty good
number or maybe we could raise it to a
hundred or something like that but I
also think I want to start this model
more again from scratch
so because I just wanted to validate my
question so now what we did was we just
went based on total halite collected but
the problem is every game map is random
and it's more likely gonna be the case
that the the a is that did you know
exceptionally better just did better
because there was more highlight on the
map and in general some of the maps just
have less highlight some have more so
what we need to do is come up with a way
to you know handle for that and I think
the best way is to gather the initial
amount of halite and then compare to the
end of the wherever we are in the game
how much highlights plus each ship you
know what is the percentage of how light
this AI has at the end of 50 turns I
think that makes a little more sense so
that's what we're gonna do the way I'm
gonna do that is first we need to gather
all of the highlight in the map and it's
been a while I don't think we actually
have straight halite either as a
highlight map so what I'm going to do is
I'm going to copy and paste a bit of
code if I forget to put this at least
I'll put this in the description I'm
getting way behind on text-based
versions of tutorials and I apologize so
it is but I can definitely put this
snippet in the description so if it's
not there and we're watching this or
whatever especially if you're here for
the premiere let me know because I
forgot it hopefully I'm here for the
premiere and I check right now to see if
I have it anyway what we're gonna do is
I'm gonna copy this code I'm gonna come
into the Wow
true loop here we probably just need
game map as my guest
let's see game map yeah yeah so paste
that in so this is code from Daniel I
didn't write this I would definitely
write it a much better way I would never
use this whole like if none because
we're iterating over a loop I mean
horrible horrible code I'm just kidding
okay so this is our way to figure out
what what did them what what how much
highlight started on the map
we go got it out uh that's my phone
again not yours okay
so so we know how much Hal I started on
the map and then the question is what
percentage of that are we collecting and
this should be a little bit better of a
way to do it so now what we're gonna do
is basically at the end of 50 turns or
question to save do to do to do right I
here is what we're probably looking at
yeah our question to save shouldn't like
save threshold probably isn't the right
answer instead what I would do is
something like me dot halide amount plus
Len me get chips me get chips times
times
constants constants dot ship cost sorry
this is gonna get kind of long I
apologize I'm gonna put this in
parentheses I believe PEMDAS would save
us there and we'd be ok I'm gonna do
that anyways so how much highlight we
have right now and then we're gonna say
each ship is worth a thousand how light
collected so that number and then I'm
going to put all of this in parentheses
if all of that out of initial how light
do do to do let's get back up to this
initial halide amount here divided by
initial halide amount let me just
fullscreen that's no reason not to is
greater than or equal to safe threshold
so this is gonna be some sort of
threshold I don't really know what to go
with first so I'm gonna go with
something really small because I
actually I just don't know so safe
threshold let's just make it really
really small like you know zero point
zero zero zero zero zero one okay
eventually hopefully we can get more of
like a you know ten percent or you know
something like that would be really nice
so we can hope okay now let's make that
say that to a variable so we can save
that in our file actually so let's say a
percent gathered equals this oh no did I
forget oh no I guess I didn't so it's
really all this Boop and then do this
percent gathered paste that there and
that correspond okay cool
if % gathered great and then rather than
saving me dot highlight amount let's
save percents gathered I think that's a
cooler cooler option also just for the
sake of it let's say ships equals and
then I'm gonna take F and you're not
gonna okay so shoot okay this is for the
lens so we're gonna say ships so we'll
call this ship count and then ship count
[Music]
okay and then because I also want to
save percent gathered let's save ship
count as well because later we might
want to use some sort of logic that
balances those like we might want to
incentivize more ships at the end so for
example right now we still don't have
safe navigation so these ships are
highly likely to just run into each
other like idiots so maybe if we see
that's a problem we want Towe rather
than worrying too much about percent
gathered like maybe for a next iteration
we actually want to keep percent
gathered the same we're not gonna try to
raise that bar but instead we're gonna
do is try to incentivize a eyes that
have more than two ships remaining or
one or whatever okay so
[Music]
percent gathered save threshold and we
can always do that after the fact
bt-dubs right so after the fact we can
always parse these files split by - and
go with whichever one we want so so we
don't really have to do it here
eventually we could also make that some
sort of threshold like must have more
than three ships and must have some
certain percent gathered threshold all
right
now before I screw up I just wanna yes
so this is our old data so I'm gonna
make this training data underscore to
underscore - and then we'll make a new
one called training data underscore
three now oops anonymous eventually
we'll call it that but right now it
needs to be just training data cool okay
the next thing is we want to change max
ships so where do we set max okay
wonderful
idiot I'm just going to set that to like
99 I eventually I just don't think we
should have any number of maximum ships
the thing that we'll want to handle for
later is in turns
so usually after about half of the turns
have gone by you want to stop producing
ships and just simply collect highlight
so eventually we'll add that in but
right now as long as we're truncating
the number of turns it doesn't matter so
and in fact it might even be the case
that we should never do it I really
don't know and then only when we
actually submit the bots for the
competition do we stop that process but
would it really hurt to have the model
be trained under that man I'm just not
sure it would make a difference if
anything maybe it makes it better at you
know avoiding its own ships
okay so dare I say we're done so this
might be one of the shorter ones I maybe
I'll clip you know append this to
another bit we'll see so
and devoting the whole life let's see if
it runs
I mean uh CV Python run game let's go
see if we hit some errors that's taking
a while oh well okay there's a couple of
things one is we're probably loading the
model I'm not really sure I want to do
that I don't think it really matters we
could load that model it's not a big
deal yeah so we're gonna load that phase
to model
I don't think it's running though man
let me think about this what else I'm
trying to think of what we hit along the
way so turn 0 0 1 this could suck that's
valid I think we can all agree unless
unless but the VAT the variable hasn't
had been defined so it should ring as a
nun but maybe that's maybe that's been
the problem all along
what a noob okay so I guess I just need
to set it to none initially for some
reason I was under the impression that
you're completely allowed to reference a
variable that doesn't exist and if you
do that it's called none but clearly I'm
not getting away with that curiously
enough okay so the more you know all
right do you need to do okay so now what
we want to do is come into training data
and then let's just delete all this the
first thing was percentage collected
writer is the first thing time that
we're saving Ambu does a-okay percent
gathered ship count blah blah blah blah
blah okay so these are our percentage
gathered we are always ending with one
ship no surprise I am sure we are just
crashing into ourselves constantly that
would be my guess
we can find out go into replays this
over here is let's just it's getting
kind of laggy up in here play yeah
see we're just producing five ships very
quickly and crashing into ourselves look
at the abundance of halide on this map
whoo
this should be a juicy juicy map
unfortunately it's not so I think you
know random will save us and eventually
we will will end with two ships my only
fear is that you know whoever happens to
collect back to it although even
collecting back to a thousand that would
be fine if they do that I I think we're
good with this model over time I'm just
really hoping eventually we will end
with enough samples of two ships I mean
so far we still don't have any and
nowhere near even like one person
collected that's kind of embarrassing
anyway
okay so probably what I'm gonna do is
let this go for a little bit and I'm
gonna see if we get any samples where
some ships are retained because we
really we're you know we're not really
actually setting a limit on anything
else yet so I'm thinking maybe I'll end
up with some sort of you know
yeah percent collected threshold and
ships remaining fresh hold or something
like that but before I can come up with
a good number I need to get a good
sample of data just to see do we ever
randomly retain any ships and if not
then we really need to probably safely
navigate unfortunately I don't want to
do that I don't want to force that on
the model the good news is if we do not
even a vagator
it does return the move that is correct
so then we could still use that to train
the model so we could still feed that in
as training data to the model and
hopefully it could learn to the point
where we could remove the naive navigate
but it's not looking good fella's anyway
okay I'm gonna let this run I'm gonna
have a couple of them or a few of them
running at the same time and we're gonna
see if we can't get any games where we
give any ships retained what a bummer
surely in like fifty thousand samples
though we'll get some we'll see while we
wait let me give a quick shout out to my
recent channel members we've got Jeffery
McGill ski rishabh ananda ravi krishna
and michael Severson thank you guys very
much for your support and I guess I will
see you guys