Placeholder Image

字幕列表 影片播放

  • Hello.

  • Good afternoon.

  • On a Wednesday.

  • It is the coating trade.

  • Oh, and why Why might you be asking?

  • Do I have to train whistles today?

  • First of all, why should any grown person on the Internet have train whistles?

  • I'm not really so sure, but apparently this is what I'm doing with my life.

  • And so there it is.

  • I am a person on the Internet with not just one train whistle, but a second train whistle, albeit a slightly Satur train whistle.

  • Let's give this one a try.

  • Well, actually, that's not so bad.

  • So you might be asking Why do you have multiple train whistles?

  • Well, thanks for asking.

  • I am going to embark on a new adventure in working on learning how to use a laser cutter in particular, I want to learn how to do laser etching, and I have this YouTube membership thing on.

  • I'm about to re launch all of the membership rewards, and one of which will be your very own laser etched coding train trade whistle, which you can only get exclusively.

  • Oh, the other thing that's quite exciting.

  • Here is I have some new tricks.

  • I'm gonna let's see if this works, uh, have a new camera here.

  • You can see my stream deck and iPad.

  • But mostly I have this year because I could show you this train whistle.

  • So this is what I've been using for all these years purchased off Amazon on.

  • Now, I have about 100 and 50 of these in a box in my office.

  • And I will be laser etching my own coating train train onto here and mailing them out with the help of Sai, who is the coding trade community manager in 2020.

  • So if you had never had a reason to join, has a member today, Uh uh, before you conjoined today.

  • I also thought, you know, I could do some or cubing coding cubing with my beginner's method of solving a Rubik's Cube.

  • Maybe I could talk.

  • You think I could talk and solve the cube at the same time?

  • Can you even see what I'm doing here?

  • Um, I suppose this probably isn't what I should be doing right now, but I I am an amateur.

  • I have, ah, have a love, a love and affection for Rubik's Cubes.

  • I'm not sure why exactly.

  • I just can't help myself.

  • What am I doing here?

  • I'm trying to solve.

  • It cannot apparently solve and talk at the same time.

  • It's much too difficult for me to do that.

  • And all of you are actual.

  • Cuba is out there probably in so much pain right now, watching me do this with my methodology, that is, You know, I've spent not too much time in my life studying how to solve a Rubik's Cube.

  • I wish I had more time because, honestly, I would like to spend all of my time doing that, which might just be kind of an escapist fantasy, a reason toe like completely leave the world in universe that we're in right now, which feels like I often want to do.

  • But I shouldn't.

  • I want to stay here.

  • I want to be with you, the people, the people of the coat, the passengers, if you will, of the coding train.

  • Um, and you know, I want to enjoy this Earth planet.

  • Things that were on I can't even talk when I'm not solving a Rubik's Cube.

  • And apparently while I am solving a Rubik's Cube is a much harder.

  • It is very hard for me to put words together.

  • Do you think I could code and solved the Rubik's Cube the same time?

  • I feel like I just have to finish this now.

  • But I can't stop talking.

  • We could play music.

  • 000!

  • Cubing in the cabana.

  • Coming soon Know maybe.

  • Oh, what now?

  • Unless you think that's exciting, I will show you.

  • Now what I've been working on, I will show you what I've been working on, which is my new nine by nine Cube, which I am attempting to turn into a three by three.

  • You can see that so far I've solved the white center, the yellow center, the green center.

  • And this morning, when I was having my tea in the morning, I was working on the red centre.

  • Uh, I have solved this before.

  • It took me about a week.

  • You know, the little pockets of times here and there.

  • So, you know, maybe maybe a little later today we'll work on this a little bit more.

  • Uh, all right.

  • Now I just want to show you my new overhead camera in case we have more things like this train, whistle and stuff for me to show you.

  • I have that.

  • I also have up here in the top left.

  • How come that didn't go away?

  • There we go.

  • I have up here in the top, left of the screen, a stream labs alert box.

  • So I don't know if this is a useful, interesting thing to do, but I'm learning about the world.

  • I'm like the old man live streamer.

  • You learning about all the young people's fancy tricks.

  • And so supposedly, if somebody subscribes to my YouTube channel called the Coded green right now, their name will appear right here.

  • If they join us, remember, their name will appear right here.

  • And, um, I believe a super chat.

  • But I don't know how I feel about the super chats.

  • That's a little Those make me uncomfortable.

  • You know, I'm very grateful and thankful for everyone Support.

  • Some people were asking me about the mouse pad.

  • How do I get this back up here?

  • Uh, overhead.

  • There we go.

  • So this mouse pad is, uh, drawing of house made by my daughter, who is now eight years old.

  • I I think she might have been younger when she made this.

  • It doesn't say on the back so we could stay on the back with one of those things When your kids make an art project at school, and then there's a fundraiser for the school.

  • You could buy their art on, like, a mouse pad.

  • And so I did, uh, okay, over, head off, overhead off.

  • So Kevin writes, I subscribed five minutes ago, and it did not show while five minutes ago.

  • It should show instantaneously.

  • So if you subscribe five minutes ago was I live streaming wasn't up there?

  • I don't know.

  • Uh, all right.

  • All right, everybody relax.

  • Let me test my banner here.

  • I'm gonna make a little test of it.

  • I've got a little test going.

  • I'm gonna test subscription.

  • Oh, you're right.

  • It's not working.

  • Let's fix this.

  • This is this is the important thing that I must work on today.

  • Oh, I turned off subscribers.

  • I turned off subscribers because it seemed like a lot of noise.

  • Let me turn that back on.

  • Copy.

  • Whoa.

  • Somebody just subscribe.

  • It appeared.

  • I don't know what I just did, but it worked.

  • Now I don't know what I did, but it happened.

  • Somebody subscribed, and it appeared That was very exciting.

  • so maybe I don't need to fix it.

  • Hold on.

  • Let me look at this.

  • Here.

  • Just everybody just just just a free sponsors.

  • Super.

  • Hold on.

  • Hold on.

  • There.

  • Oh, yes.

  • So I think it's working.

  • All right.

  • Thank you.

  • Ox shy are for subscribing to my channel.

  • What's this from?

  • I think maybe like, uh, Futurama quote.

  • I'm not sure I like your ideas.

  • And I would like to subscribe to your newsletter way.

  • That's just from The Simpsons.

  • I don't know.

  • I'm just I'm getting a very loud uh, I'm hearing like a ding dong when somebody subscribes.

  • Do you hear that?

  • Or they're just coming out party.

  • Just coming out of the monitor of this computer down here?

  • Um, yes.

  • So I think I agree.

  • I think I'm probably going thio turn off the subscriber.

  • Uh oh.

  • But new member, let's see if that happens in school.

  • Foe.

  • Remember, Maybe you, depending on your membership level, you might get a train whistle.

  • It didn't show up.

  • All right, I'm gonna fix this.

  • Everybody hold on and all right, if I've done everything correctly now, it should show up any more.

  • People subscribe, but only if they join as a member.

  • We'll see.

  • We'll see if that works.

  • Oh, technology.

  • Okay, let's see.

  • Uh, okay.

  • So I should really get to the business at hand, which is that I am here today to do one thing and one thing only.

  • I am going to attempt to implement the mini max algorithm to create a A I I don't know if that's really sometimes you say the word Aye.

  • Aye.

  • And it sounds like, oh, this, like, fancy artificial intelligence robot thing.

  • We're really It's just an algorithm to pick the optimal move.

  • But a I ittle it's correctly Bates.

  • So I put it in the title on a I bought to Play Against Me and Tick Tack Toe.

  • And as you saw from my Rubik's cube solving prowess, I'm probably very good at tic tac toe.

  • Um, new members are joining.

  • Are they?

  • Are they popping up?

  • Did the did the alert pop up?

  • I don't actually see it.

  • No.

  • So no so far.

  • No overlay.

  • I guess I'm just destined to never have this overlay thing work.

  • Well done.

  • Uh, thanks for showing my email.

  • Oh, wait a second.

  • Wait a second.

  • I am not logged.

  • in as the coding train.

  • Oh, I'm so dumb.

  • Dumb.

  • Okay, hold on, everybody.

  • We'll fix this.

  • Um, it's showing you an overlay for some other YouTube channel.

  • Associative Don't know associated with my Google account.

  • I will fix this Now I now know what the issue is.

  • I am the coating train.

  • That is me.

  • I'm logging in.

  • I'm going to my dashboard.

  • I'm going to my alert box.

  • I do not want to join Stream Labs University.

  • Thank you very much.

  • Alert box.

  • Think, think, Think, Dink.

  • I think copy.

  • I'm going now to open broadcast studio into the alerts property pasting in a New York.

  • Well hitting.

  • OK, I am going to refresh automatically.

  • I'm gonna press this button.

  • There we go coating Spain has become a member coding train has donated super chat.

  • And you don't see a subscriber because I have that turned off.

  • Okay, you So now?

  • Now it should really work, I hope.

  • Thank you, Humpty Dumpty for joining.

  • Where is my bell?

  • Will ring the bell for year Joined.

  • Don't fall off the wall.

  • The boat.

  • It's in front of my face.

  • This is the thing that I have a very special talent, which is to not see things that are right in front of Thank you, Humpty Dumpty.

  • And thank you, Thio New member E M s Co Fall.

  • Welcome.

  • You have the nice, lovely little bit, this dot Uh, I got okay.

  • Um So what else do I want to talk about?

  • So before I do the mini Max algorithm and talk about what Mini Max is, let me of revisit the most recent video tutorial published on the channel, which was the ml five Jazz train, your own neural network.

  • Now, if you watched the live stream where I made this tutorial but did not watch the actual tutorial video you might This is one of the rare cases where you might actually want to watch this video.

  • Because after the lifestream re recorded it, the edited versions of things that are lifestream always have not always but often have a little extra bits or some light editing to speed through and skip things.

  • But sometimes I will actually come back and re record an entire thing our entire section if I got it really wrong.

  • Um, hand uh, David Snyder's.

  • It's like testing.

  • I didn't throw up, didn't show up didn't show up.

  • I want to know because I wasn't looking.

  • I didn't hear the ding.

  • I think I would've heard the ding.

  • Um oh, it did.

  • It did.

  • It just was late.

  • It did.

  • It showed up late.

  • So you haven't seen it yet?

  • You mean you've seen it?

  • Now, if you're hearing me talk, But you have to remember that I'm on the 33rd.

  • There's, like, a big delay here.

  • Okay, so check this out if you're interested.

  • I also so in addition to doing these live streams like you're watching right now, I will often live stream to members My different recording sessions if I'm doing extra material, some extra tutorials, not part of a live stream.

  • And just yesterday, in fact, I had a members live stream where I recorded three more videos.

  • All follow ups of this one.

  • So this in this particular example, I did the data collection, training and inference, and then the videos that will be coming out, our, um, the videos will be coming out are looking how to save the data that you've collected, how to save the model that you've trained and then also how to implement regression.

  • So how to change this into a regression?

  • Okay, so take a look at those.

  • Let's take a few minutes to look at some of these community contributions.

  • I should also mention speaking of things I have this keyboard that I'm using today because my butterfly, I think it's called The Butterfly Keyboard on this Mac is just, you know, it's dead.

  • It's like it just it's, like, completely unusable.

  • So I'm also I'm attempting to use a external mouse and external keyboard today, and hopefully that will improve things in terms of my coding and all of that.

  • All right, overhead off.

  • Um, so let's take a look at some of these first.

  • I haven't actually looked at these, so this is a surprise to me.

  • Um, turn my screen brightness up a little bit so I can see it.

  • Let's look at the self learning neural network by Vlad.

  • Okay.

  • Uh oh.

  • Whoa, wait a second.

  • So this is interesting because this looks like it is based off of my car's neuro evolution example, which I built during a different life stream, Um, and only for windows.

  • So I guess it's just the execute a bowl and we could run it.

  • Is this using Emma five of lad, if you happen to be in the chat, have a bunch of questions about this for you that I'm curious about.

  • But I will move on right now to the next one.

  • Neural network visualization after training.

  • Wait awhile by Charlotte.

  • Okay.

  • I'm excited about this.

  • Um, so let's take a look at that.

  • A B C D.

  • Also, this looks like it's just like my example.

  • So I'm gonna do some training here.

  • Can you hear that?

  • Are we hearing anything?

  • Maybe there's no sound in this one.

  • It's using color instead of sound.

  • So they do a bunch of bees, a bunch of seas.

  • I would love a community contribution that thinks about a more elegant interface or doing this data collection.

  • Um, but let me do this.

  • And I'm going now.

  • Hit t for training.

  • Wait for the model, the tree.

  • So Simon is letting me know that I missed showing contributions for interactive drawing and teachable machine.

  • Um, and I would be glad to look at those.

  • Maybe I look at those at the end if I have time because I want to make sure I get this train.

  • Okay, So Charlotte's instructions say, Oh, Charlotte did what I was s So we see, like a heat map or decision map of all the different colors based on the training data.

  • And it's kind of amazing how it actually ends up producing this, like foreign oil like desolation.

  • I should really try this again with a less obviously clustered data set if you'll oblige.

  • If you'll humor me, I would like to do this one more time.

  • So I'm gonna put I'm gonna make the data much noisier in terms of where it ISS Look, I'm still gonna kind of cluster it, but I'm gonna spread out.

  • Some make it a little bit more chaotic, you know, Traditionally, you would do something like what we're looking at here with an algorithm like K means are clustering kind of algorithm.

  • It's interesting that we're using a neural network here to ultimately kind of perform the same kind of idea.

  • Now I expect the loss won't be as low because there's gonna be a lot more errors, is gonna be a lot trickier for it to figure out how to train this model.

  • But let's give it a try.

  • Loss is definitely going down.

  • That's a good sign.

  • Interesting.

  • Wait, how do I do my zoom thing?

  • I sought to use this.

  • Are we seeing?

  • It's interesting.

  • It really is very consistent.

  • Still so I'd be curious.

  • You know, I don't.

  • I wish I had hours to unpack and do a deep dive into every single one of these examples.

  • I'm curious why this took so long.

  • It's a very slow process.

  • If every single pixel was passed in the neural network and classified one of the time Ml five will allow you to pass in a batch of data and get the classic Asians for all of them.

  • So, Charlotte, if you're watching, I don't know that you are.

  • Take a look at that.

  • That might improve this speed.

  • But this this is ah, tricky one, Um, or maybe using promises and some kind of like asynchronous something or other could help to, um all right, let me close this.

  • What else we got here?

  • We have now regression based on note frequency and color predictor.

  • Okay, so let's see what not tra vis us to be.

  • Oh, I like this.

  • I can paint with it.

  • That's really nice.

  • I can paint.

  • So this is a nice improvement on the interface.

  • I don't know how many options there are.

  • Let's try this and it t train this model.

  • Mmm.

  • Is a little weird, but I don't see a graph it all Mmm.

  • Oh, yes.

  • Oh, Simon makes a good point.

  • I said K means in the sense that K means will find the clusters without the labels.

  • So I think I was conflating some concepts there and just sort of like thinking about the visual relationship between that example on k means example, but that it actually is quite a different thing.

  • So thank you for correcting me there.

  • Um all right.

  • What's just happened?

  • I don't know.

  • So something has gone wrong here.

  • This example s o.

  • I don't think I'm able Thio effectively debug this right now, But thank you for the submission and Dar Sean, have you happened to be in the chat?

  • Let me know.

  • Oh, so much discussion about Mini Max and to learning.

  • And which should I use with the spade lot?

  • So much good stuff to come.

  • Okay, So thank you for these submissions.

  • Stay tuned.

  • Hopefully sometime next week, we follow up videos for this will be released on.

  • And but now I'm going to move on to the main task of today.

  • And before I get started with that, what I would like to do and hello to Zul from Indonesia.

  • Thanks for watching.

  • And CJ is here.

  • Hello, CJ Uh, c j from from the host could see the coating drain garden, but that's not it.

  • It's the coded garden.

  • Ah, wonderful YouTube a channel.

  • Um, I would like to download this code and get myself set up with it.

  • I think I'm gonna work.

  • Excuse me outside of the p five web editor, because this is gonna be a pretty complex a problem for me to solve.

  • So let me download this p five code.

  • And so, for any reason you want to follow along, you should you could You could start with this starter code them about to use, um, going here.

  • Let me call this looks.

  • We call this who?

  • I don't know what he was a computer with a mouse.

  • It's like my hand is all the way over here.

  • Look at this is crazy.

  • My hand is all the way over here operating the computer.

  • Look, I can type one character to time, and they appear one character of time Go away Overhead Desktop.

  • And then let's open this with visual studio code.

  • Uh, okay, let's go over here.

  • Um, and let me run my terminal and I'm going to go Thio That's top tick tack toe.

  • I'm gonna run a server and load that up in the browser.

  • There we go.

  • That's the example from before.

  • Um, let's go here.

  • Um, and no.

  • Okay.

  • All right.

  • So here's the thing.

  • What I would like to do is I want to make some adjustments to this tick tack toe example that I won't include in the final edit of the coding challenge.

  • But I will do with you here right now.

  • In a way, I want to simplify some things about it, uh, just to make.

  • I think the but I really want to focus on is the core mini Max algorithm.

  • And I don't wantto add a lot of complexity related to the game mechanics themselves.

  • So I'm going to assume that there's only ever two players and I'm going to say there's going to be an aye aye player, which will be the ex and a human player, which will be in o um And then I am going to.

  • What I'm gonna do is let's get rid of this, like, available stuff for a second on this, like picking a random current player that could be useful.

  • Let's keep the current player and will say that current player is starts with as the human, for example, I'm gonna get rid of this idea of an available array just to simplify this check winner thing could be the same next turn.

  • So this was picking a random turn.

  • So let me do this.

  • Gonna leave.

  • Let me make the okay.

  • So what I'm gonna do is I'm gonna add a mouse pressed function.

  • And if the human player you know, if the current player is a human, let's get um ah, let's get the index into the board.

  • Let's get with Mouse X divided by with mouse.

  • Why divided by height, I'm gonna floor these so that their index What I'm trying to do right now is just create a quick interaction where, as I click the mouse, if where I click, the mouse is an empty spot on the board.

  • Then I'm going to fill it in with my human marking my human marking, which is an O.

  • And, um, otherwise, if the cume human player is a is it If the current player is the guy, actually, you know what?

  • I'm just gonna I'm just going to make my turn and then immediately Well, this is silly.

  • So every time I click the mouse, I'm trying to think through this what I'm actually doing.

  • I'll leave the extra some extra stuff wraps in here.

  • So if it's a valid spot, then the next thing I want is for the a i to make its turn So human make turn.

  • Then if it's a valid turn, then the AI I should make its turn.

  • And right now, I just have it be random, so I shouldn't have gotten rid of that available thing, but I think I could just rewrite that by saying I can, uh, just look through all of the spots.

  • Um, this is silly because I already used I and J, Okay.

  • A B C d e f g h i j k l I don't want to use l don't ever use l huh?

  • X goes first, that is.

  • Thank you, Simon.

  • I will correct that, cause I will have the I go first.

  • Eventually.

  • Andi, I'm here to break the rules.

  • I'm gonna use an l.

  • By golly, has my index.

  • Uh, and oh, this is so now I'm writing a whole extra algorithm that I don't want to write.

  • Um, available push.

  • I is K.

  • Jay is l I want a little object.

  • No.

  • Well, no, no.

  • Let's just do this.

  • Uh, okay.

  • L make a little object, and then I want to This is so silly what I'm doing.

  • I should just do it in order.

  • It's fine.

  • Then I'm going to say move equals random available and then board.

  • Oh, what?

  • Only if it's available.

  • If board kay l is blank.

  • This is so silly that I'm doing I did not intend to write a whole new algorithm here as like a random Aye, aye, but it's what I'm doing.

  • Um, and then move is random, and then board move dot k.

  • Uh uh, Moved on.

  • L equals, um, equals the Aye.

  • Aye.

  • And then the current player is the human.

  • I think this current player thing is completely unnecessary, but that's fine.

  • And once the humans made a valid move, the current player is tthe ee Ay, ay.

  • And let's see if this does what I want to dok What players is not defined Sketched out Js 109 If spot equals what I say human was Oh, even though I'm doing it wrong According to Simon and A I is x available is on to find sketch 49 because I got rid of that concept and then added it back in again.

  • Oh.

  • Huh?

  • I needed it for something else.

  • It it it it, uh that's just to this, uh, let open spots is wait zero.

  • And then if the board I can use I j here if the board I didn't really think I was gonna change very much about this example.

  • Uh, I j if the board is empty, um, increase the number of open spots.

  • I will explain what I'm doing.

  • Second more, uh, in more detail.

  • Then as long as there are no open spots, you can break out of the loop there, too.

  • So if there is no winner and they're no open spots, it's a tie.

  • Otherwise, there's a winner.

  • Boy, this algorithm is ridiculous.

  • I should also re factor that, but I'm not going to.

  • Let's see.

  • Next turn 1 39 I'm not doing a turn in the draw loop.

  • I shouldn't use the draw.

  • Loop it all, but I'm gonna be lazy.

  • Uh, 1 39 I'm missing and curly bracket w is not defined.

  • Ah, I made up this variable called w, which somewhere I must use Thought I created it because I use it everywhere, like in draw.

  • Ah, here it is.

  • It's not a global variable.

  • So we make this a global variable.

  • Uh, but I'm going to have Thio create it and set up because, um, the width and height don't exist.

  • And also, it's a square, so I don't need separate within heights, but what you gonna d'oh?

  • Oh!

  • Oh, I win.

  • Went again, by the way, the optimum move.

  • I think it's to go in the corner.

  • Ex winds.

  • What?

  • No, I would There's a bug.

  • We'll fix that another time.

  • Ha, ha.

  • I won again.

  • Okay, so this is this is what I wanted, except there is an issue of, um Okay, So I have a let me do this.

  • Let me do this.

  • Uh, hey, I, uh a I move.

  • You make that a separate function, everything's gonna be fine on.

  • Then we call this.

  • Hey, I move.

  • Which was actually called, like, next turn before.

  • So I don't know why I'm changing it on.

  • And then this I could have my trusty I and J back.

  • Uh, thank goodness.

  • Uh, then I'm gonna do something even better.

  • But in case you're wondering, the whole point of this is I'm going to change this to Mini Max.

  • So I want to start the tutorial or the coding challenge from an Aye Aye.

  • That just picks a random move and then have it picked the optimal move.

  • That's what I'm doing here today.

  • So if that interests you stick around.

  • If I can get this to work, I'm gonna be quite shocked, right?

  • This was it right here.

  • I already have.

  • This was called next turn so I could just call this next turn.

  • That's what I had before.

  • And you know, I'm gonna do I'm gonna put this in a separate job.

  • Script file.

  • I'm gonna call this mini max dot Js.

  • Um, I'm gonna have it there I'm gonna add this Mini Max.

  • I don't like having these CSS files for no reason.

  • Um, just extra noise.

  • Um, And so now And it should be next turn.

  • And then so that X really goes first.

  • We'll have been set up X Go first.

  • Now we will now have an official competition.

  • Oh, you remember Goober genius.

  • I just It's called a good I just watched into the spider verse.

  • Sorry.

  • This is, like, totally non sequitur, which I absolutely loved.

  • One of my favorite.

  • I did not expect to love it as much as I loved it.

  • But isn't the thing called like a boob?

  • A goober?

  • No goog.

  • Can't remember their 512 people watching me about to attempt Thio play tic tac toe against the computer.

  • All right, I'm gonna get you X.

  • Ah, Good move.

  • Good move.

  • Mmm.

  • Go here.

  • Oh, but but there's a bug.

  • The bug.

  • If X goes after me and wins, then exes told it wins.

  • Let's try it again.

  • Go here.

  • Here, huh?

  • Yeah.

  • In your X X.

  • Aye aye, man.

  • Ho New member.

  • Thank you.

  • Welcome.

  • Thank you for joining.

  • Boy.

  • This thing overlay thing.

  • Really?

  • Really brings on the new members.

  • Or maybe it's just you're excited about this train whistle.

  • I'll be mailing Thio.

  • Okay.

  • Um, do you already have a method to check of someone?

  • One?

  • Yes, I do.

  • I will not be doing so.

  • I do love.

  • I do wonder if ticked If I do this particular coding challenge with Mini Max, if that will lay the groundwork for future videos as I look at Maur, um, learning styles and cue learning be one of them for reinforcement Learning.

  • Okay.

  • Could you check?

  • Yes.

  • I certainly could check the wind condition after you.

  • I don't feel like correcting that right now.

  • That's just gonna be a bug, that I'm gonna leave in there.

  • And But I am now going to, um, get started, and I'm going to need heavy use of the white board.

  • So let me just test in the year.

  • I also I think, diagramming the mini Max algorithm.

  • I'm going to want to use multiple colors, so I have not coated this before.

  • But I did do some reading on it and thinking about it, and I drew some diagrams on a white board in my office.

  • I I'm somewhat prepared for this, which I'm sure it will all go horribly wrong.

  • Anyway, I'm just writing on the white board up where you can't see it to see if these markers work.

  • Have a blue have a black.

  • This is probably gonna be somewhat of a long one.

  • And I have a green.

  • Okay.

  • These all work.

  • I want a red also.

  • Look, the Reds.

  • Okay, let's try this red better.

  • All right.

  • Um, all right.

  • I'm gonna turn the overlay off because on deep pockets suggesting there's a number file video about tick tack toe.

  • They did not.

  • I realize that, um, I will have to take a look at that.

  • Q shroud is asking.

  • Won't you need to fix the winning condition?

  • Because that might mess with the training.

  • Um, I think it's gonna be okay.

  • The issue is that I'm allowing two moves to happen at once.

  • And when I'm not, actually, there's no training going on here.

  • I'm just doing a search basically for the optimal move, and I assume I won't have that problem at a set time out to next turn.

  • All of these things are very good ideas.

  • I like that a little delay.

  • Okay, I'll think about that.

  • But I'm not gonna do that right now.

  • So here's the thing.

  • I want to stick to the pieces of this that are relevant for Mini Max.

  • And in that sense, I'm not gonna worry about the interface and how the game is actually played in that kind of thing.

  • All right, give me a minute here.

  • I'm about to start.

  • Uh huh.

  • But before I begin, I'm going to tell you about today.

  • Sponsor the random numbers.

  • No, that's something.

  • I don't have a sponsor for years like street.

  • So nice opportunity for me to just, like goof off and I'm gonna tell you about today.

  • Sponsor numbers.

  • Today's quoting train is brought to you by 91,242.

  • 53,474 and 34,963.

  • Thank you.

  • Random numbers.

  • So Armour writes in the shot.

  • I was hoping to apply this algorithm for more challenging games like chess.

  • And you can, um uh maybe we could have a little discussion about that after I get through this very basic scenario.

  • But I'm gonna do hopefully What is a fairly simple about simple but basic scenario.

  • Wait.

  • 1 45 Really?

  • 45 into this.

  • Oh, my God.

  • 45 minutes into this.

  • Okay.

  • All right.

  • Okay.

  • What's going on?

  • Here we go.

  • Oh, alphabet Uprooting.

  • Yeah.

  • Juristic.

  • Oh, boy.

  • So many things to discuss.

  • I'll come back at the end to talk about those things, All right?

  • Hello and welcome to a coding challenge.

  • Tito again.

  • But no, wait, wait, no, no, no.

  • I live streaming.

  • So I'm yet I've kind of this thing has happened where sometimes I have these recording sessions, where are which are member only live streams where I really allow myself to start over like 15 times.

  • And part of my reason for doing that was so that I would stop doing that so much during what's more public life stream.

  • Unfortunately, I I I'm not able to switch that muscle off.

  • And what I really want to attempt to not stop certain stop so many times, but just go with it.

  • And, um, Macha, coating train editor extraordinaire, will hopefully make this all wonderful and easy to watch in about 30 to 45 minutes, which I think it's my target for this ending up.

  • Um, usual coating just wants me to see their comment.

  • I see you.

  • I see you.

  • Hello and welcome to coding challenge.

  • Tick tack toe the mini max algorithm.

  • So you might remember me from my Cockney challenge Number 1 49 tic tack toe where I made a very basic somewhat.

  • What's the word?

  • I'm looking for Messi and spaghetti.

  • Like where I made a very sort of like a big best out of tick tack toe.

  • But I need a working version of the game, which I have running here in the browser.

  • Now, I made some very slight adjustments to where I left off in that last video.

  • So if you haven't watched it, you could go back and watch it.

  • But it's a basic version of tic tac toe.

  • I want to start over so badly.

  • Rocket landing simulation.

  • I totally want to do that.

  • DT six.

  • No more starting over.

  • No more, no more Starting over just by last time.

  • Please, please, please.

  • I will put my overhead camera on and I will look at you from close up if you let me do it.

  • Well, I guess Got kind of dizzy.

  • All right?

  • because I just want to code this, and I have to stop doing this.

  • Last time last time, I swear it.

  • Swear you're very kind.

  • You are nice people.

  • All right.

  • Hello and welcome to a Cody Challenge.

  • Tick tack toe with the mini Max Heller of them.

  • That's why I'm here.

  • Because I made this other coding challenge tick tack toe where I created a kind of a big It was kinda messed if I'm being brutally honest.

  • But I made a working version of the tic tac toe game that just played with two players picking random spots.

  • So since then on, you could check one of my life streams If you want to find where did this?

  • I made some adjustments to it so that I could as a human being, played the game.

  • So right now I'm gonna play the random computer picker.

  • I'm gonna go here, and then I'm gonna block X go here I win wins.

  • So what I have the adjustment that I made is that I added a mouse pressed function where I find where did I click?

  • And I put my human, uh, variable, which is the letter o onto the board.

  • And then I call next turn where next turn picks a random spot in the board and makes that the A I spot or excess spot.

  • So the whole point of this video is for me to implement something called Mini Max, which is an algorithm, a search algorithm, if you will, to find the optimal next move for the A.

  • I mean, I could find it for myself, and then I could implement it.

  • But the idea is, I want this player, the computer player to beat me at the game or at least Ty to play a perfect game.

  • And tic tac toe is admittedly an incredible simple.

  • This will be an edit tick tack toe.

  • Tic tac toe is admittedly an incredibly simple scenario, and we don't necessarily need many.

  • Maksim probably just memorize a few key principles of how to play.

  • But I think it's a good demonstration of the Mini Max algorithm, and if I could get it working, which I'm really open again, then at the end of this video, I'm going to discuss how you might take that into Maur complex scenarios.

  • Even something like chess potentially is a game that you could use the money Max algorithm with Okay, YouTube reminder fail.

  • What's that?

  • I don't know what that means.

  • Probably something that I did.

  • Okay.

  • Um oh, that's just TMC joining if the reminder Probably.

  • All right, So we go here, go here.

  • All right.

  • Um, Matt, you maybe we can, um we can replace these later with clips, but I'm just going to No, this is geeks for geeks is the one.

  • Is this a reputable psych that I should feel happily?

  • Um, you stop?

  • I'm not interested.

  • Okay, uh, we go hear one.

  • There we go.

  • Okay.

  • No, go away.

  • Add stop.

  • Go away.

  • All you ads you're not paying me.

  • You need to show up on my lifestream, okay?

  • Actually, Lou node is technically not of today, but a sponsor.

  • Go Delino dot com slash coating trade 20 for your $20 off coupon.

  • You know, not a sponsor of today's life Street, but a previous one.

  • All right.

  • Um, I just want a reference these, um if you want to learn more about the mini max algorithm, I would suggest to resource is that you could look at that.

  • I actually looked at before beginning this coating.

  • Johns haven't programmed this before, but I watched this video by Sebastian Leg.

  • That explains the mini Max algorithm.

  • Also something called Alfa beta pruning, which I'm not going to implement but could be a good exercise.

  • Next step for you.

  • And I also found this article on the Geeks for Geeks tot Orde website, which has eyes three part series about the mini max algorithm and how to apply it to tick tack toe.

  • Um, now those.

  • Yeah, those resource is if I'm being honest or probably better than what I'm about to attempt to do.

  • But I'm also gonna take about a portion of this video to try to explain the algorithm in my own words and diagram it out, which hopefully will help me figure out what code I need to write.

  • I don't know.

  • So I think I want to try to do this twice once with just a very general scenario.

  • And I'm going to say that they're gonna draw what is wrong with this marker?

  • I had such a good one before.

  • I thought that was so good.

  • Real better.

  • All right.

  • Um, am I doing here?

  • Mini Max algorithm is typically expressed or visualized as a tree so we can think of the root of the tree as the current state of the gate.

  • Oh, you can't see that, can you?

  • I usually put these little things.

  • There's a little magnet to tell me where the top of the board is, but they were a little bit too high of the camera position.

  • Oh, is it till thank you for telling me that it's tilted.

  • Um, let me try to fix that.

  • I thought maybe it wouldn't be noticeable.

  • Fortunately, I do have a level.

  • I need to tighten this camera.

  • Let's see.

  • How about it?

  • ISS?

  • Not as bad as you would think.

  • Oh, it's bad.

  • It's way off.

  • Okay, that's better.

  • Loose is the problem to tighten it, but I think I think that's better.

  • Looks better.

  • Yeah, it'll just be tilted for that beginning explanation.

  • Matt, you can always probably I mean, that that's gonna be might be like a super annoying thing to do, but could fix it a little bit.

  • All right.

  • The Mini Max algorithm is typically visualized as a tree, and the roots of the tree is you could think of as the current state of the game.

  • So in this case, it's tick tack toe.

  • And so this is the state of tic tac toe.

  • Now, whose turn is it?

  • Let's say in this case it is.

  • The computers turn.

  • Okay, wait, I Let's think about this for a second.

  • Um, better Thank you.

  • Give me one more try here at this was thrown off there for a second.

  • The Mini Max algorithm is typically visualized as a tree and the root of the tree you could think of as the current state of the game.

  • So let's say I'm just gonna draw a box here.

  • This is the current state of the game, and maybe all in a moment, I'll fill this in with a tic tac toe board.

  • But the idea here is that there is a player, the player that's trying to pick the optimal score.

  • You can call that the maximizing player, so the maximizing players trying to maximize their score to the game, um, is going to make the next turn.

  • So let's say that player just has two options in TIC tac toe.

  • Started the game there.

  • Nine options.

  • But let's say there are just two options that means we can have a tree going to the next state.

  • Now this Mini Max algorithm is useful for a turn based game.

  • I don't know why that's there.

  • This Mini Max album is useful for a turn based game.

  • So if this was the Players X's turn now it's the players.

  • This In this stage, it's the player owes turn and the player.

  • Oh, if X made this turn than oh, now has two options.

  • And if x made this turn that Ohio has two options.

  • So I said that X is the maximizing player, and I erased that.

  • I'm gonna put it back.

  • Oh, is the minimizing player.

  • This whole system is designed to pick X's next turn, but we have to play out the future and the future has oh, making turns as well, then x.

  • Finally, it's X's turn.

  • So once again we have the maximizing player going, and then those turn and so on and so forth.

  • Now this on Lee works if the game.

  • But Dutton not only works with a game like tic tack toe that you'll see, it's simple enough we can actually have this tree play out all the possible scenarios until one of the players wins or there's a tie.

  • In other scenarios, you have to just use some kind of heuristic to make a guess as to like weather won't know.

  • What am I saying here?

  • Oh, I'm waiting in the territory don't wanna wait into yet.

  • This is very important.

  • Um, so let me let me rephrase that.

  • So in the case of tick tack toe, So in the case of tick tack toe, it's a simple enough game where, at any given point, we could actually computational e play out every possible scenario until one player wins or there's a tie.

  • In other games like chess, for example, there's too many possible outcomes, and we have to use some other methodology to figure out.

  • When do we stop this tree?

  • How far into the future do we look?

  • But fortunately for us right now, that's not an issue we have to deal with.

  • So eventually, at some point there, after one of these moves, the game is going to be over.

  • And so we need to establish at any point when the game is over, when we want to stop going out through this tree, what is the score.

  • So for us, we could do this very easily.

  • We can say, if X winds, we're gonna give it a plus one score If Why?

  • Winds were going to give it a negative one score.

  • And if there's a tie, we're going to give it a zero score.

  • So let's say in this scenario here, I probably should use, like, fun explaining that show.

  • I just use more like generic scores.

  • This is fine.

  • I'm gonna I'm gonna stick with what I'm doing.

  • Yeah.

  • Um, that's a nice tip, Simon, To draw these as different.

  • It's usually what's done.

  • Draw these different icons, but I'm not gonna worry about that.

  • Rance was use colors for, um Okay, So using these scores, let's say so using the scores.

  • Let's say if X makes this move Oh, makes this moon than X made this move Ex winds.

  • So there's a plus one.

  • But if X makes this move, X makes this move, and X makes this move.

  • Oh, makes this movement.

  • X makes this move.

  • It's a tie.

  • So if that's the case, so if that's the case, I see what to make this a bit more legible.

  • Let me actually make these blue.

  • So when it's owes turn, I'm gonna draw these squares as blue.

  • That will help us see, And we don't have too many levels here.

  • But this will help us see

Hello.

字幕與單字

單字即點即查 點擊單字可以查詢單字解釋

B1 中級

嘀嘀打車人工智能與Minimax的合作 (Tic Tac Toe AI with Minimax)

  • 0 0
    林宜悉 發佈於 2021 年 01 月 14 日
影片單字