Placeholder Image

字幕表 動画を再生する

  • what is going Everybody.

  • Welcome to part 12 of the artificial intelligences in Starcraft two with python tutorial.

  • Siri's in the previous tutorials we built and trained on old Network.

  • And now we want to put it to use.

  • So in order to do that, it's not too difficult.

  • All we're gonna do is I'm headed to part nine, uh, and scrolling on down to the very bottom where I post the full script and I'm going Teoh, copy that, Paste.

  • So this was the one that we used to actually build the data.

  • Now all we want to do is, rather than randomly attack, use the model to choose to attack.

  • So basically, we just want choice equals two rather than be random, be the model.

  • So not too many changes need to be done in order for that to happen.

  • But we do have to make some changes.

  • So, uh, first of all, we're gonna come up to the tippy top and we're going to import caress.

  • Then what we're gonna do is, um I guess we could I think the first thing I'll do is we'll load in the model or so.

  • So maybe Lou to go through testing.

  • We want to be able to use this model.

  • Both still is random, but also as the neural network.

  • So the way that I thought about doing that is to just have, like, a flag.

  • So like in in itself, after self, we'll have a used model.

  • And for now, I'll set the default to false Let's get rid of that space there, and then we're gonna say is if self dot use model.

  • So if that is the case, let's go ahead and just print out some information using model and then self top model equals Carrie.

  • Stop models dot load underscored model.

  • And then in here, you'll put whatever model you're gonna load.

  • So again, the model the link is in part 11.

  • Um, you can come here and just download this model that's already trained.

  • Feel free to train your own if you want to try like a different model or something like that and see how you can do or you want to do more e pox or whatever have at it.

  • Um, I hosted all the data, hosted the models, do what you want, So anyways, this is the name of the model so I'm gonna hopefully highlight it.

  • Copy and get lost for a second.

  • We're all here.

  • Okay, So, um so now we've got the model itself.

  • Now, uh, now, what I want to do is at least I think before we start copy pasta thing, I'm gonna at least get the usage of the model in, so we'll come down here and then basically, what we need to do is have, like, an if statement here as well.

  • So if self dot use model, um, then we want Thio, you know, use the model.

  • Um else the choice is just take a random action.

  • Now, if we want to use the model, how would we have to do that?

  • Well, we would have to say something like that.

  • It's like prediction equals self dot model whoops, self, that model.

  • And then you use dot predict notation, and then to pass least the way predict works as you pass a an array or a list of things that you want to be predicted.

  • So no matter what, it has to be a list.

  • So then what we're gonna wanna pass is that, like, flipped?

  • That flips input.

  • But one day, I'll find it.

  • Oh, it is already solved off lips.

  • I can't.

  • I copied and pasted this for part nine.

  • So I'm gonna assume I heard already made that change.

  • That was the change.

  • I had to make it.

  • Someone don't measure one anyways.

  • Um, okay, so we want to predict self dot flipped.

  • So that's actually pretty simple.

  • Um, but we also need to reshape it with that whole negative one.

  • Then 1 76 then 200.

  • And then the three channels, then?

  • Are you kidding me?

  • I don't actually think I mean, it's a parameter, but if the parameter is a list, these still Pepe have information on that anyway.

  • OK, so that's our prediction.

  • And then our choice would be numb pied a Argh.

  • Max Prediction.

  • Prediction.

  • Um, not just prediction, but zero with prediction, because again, we have to pass a list, and then it returns you a list of predictions, then, um at least in the text based version Editorial.

  • I did this little thing, and I really just did it for debugging.

  • So I'm Michigan copy and paste it in.

  • So then we just have this little dictionary here.

  • Really?

  • I wonder why the spacing looks, okay.

  • And the text based tutorial, but not here.

  • Anyway, Um, here.

  • I'm just simply outputting what the choice happened to be.

  • The next thing is, even if so, in this case, it was if you had, I'd avoid raise.

  • But the other question is, if, um so, like, we kind of want to do this like, cut here, and then let's pick.

  • That's why it wasn't that's why.

  • Sounded line.

  • Because I did this in the text.

  • Based her tour.

  • Oh.

  • Okay.

  • Um, I think this is working out.

  • Right.

  • Okay, so So we definitely like we don't need to be using our gpu to make predictions if we haven't met this if statement.

  • So I wanted to move that down.

  • By that same token, we didn't mean need to be making the choice before.

  • It didn't really make logical sense.

  • Like, if we can't make the choice, we can't make a choice.

  • Uh, is happening there.

  • I appreciate that.

  • Um, so why this didn't stay in line?

  • I don't know.

  • Okay, that was That's a lot of spaghetti going on.

  • Hopefully, hopefully we're gonna be all right.

  • Okay, So that should Well, so the default when we run center, but is actually off.

  • So what we'd want to say is, use model equals true.

  • And now we should use the model.

  • So I'm gonna go ahead and run that, and we're gonna see that it fails.

  • And the reason it feels Let's see why he says these models falls if youse model has no attributes if self doubt use model.

  • Oh, okay.

  • So so really use model.

  • That does not necessarily.

  • Yeah.

  • So self die used model.

  • We're gonna set that to use model because not only do we want a reference it here, but we want a reference it everywhere in this object.

  • At least right now, we just have, like, the one spot that we're trying to reference that, but we are referencing it outside of this innit method to Okay, Try again.

  • All right.

  • Game is at least loading up.

  • Come on, you can do it.

  • So at least in the last one, my video and audio didn't seem to be chopping out despite it was lagging an O.

  • B.

  • S.

  • So hopefully that doesn't happen here.

  • But if it does, I apologize.

  • Actually, our GP you should not be in use at all until we produce void raise.

  • So while we wait on thank you to my recent sponsors slash members Donelly LeBron, No, I'll do that right, Oliver halls, Ex Storm 78 Moses.

  • You guys are spectacular.

  • Thank you very much for your support.

  • So we are still waiting.

  • We have our We do have a gateway.

  • We got her cybernetics core over here.

  • What we got going on over here?

  • Okay, we got a stargate coming up.

  • We do have an observer heading off on to his doing his objective.

  • So one of the things that, um I guess we can talk about now is like, what?

  • What are we kind of wanting to do in the future?

  • Wow, we already sent.

  • Okay, so it's already making choices to attack the enemy.

  • Um, which is interesting.

  • So I guess now we'll talk about how this model actually did so in my testing.

  • The trained model.

  • Um, are we running?

  • Who are we running against here?

  • Is this harder?

  • Medium?

  • Okay, it's just meeting him here, but, um wow, we rushed in, demolished this gentleman CIA.

  • Um, we're always that lucky.

  • So?

  • So in at least with 100 games each.

  • The random model defeated the media.

  • May I?

  • 44% of the time.

  • And the trained model defeated the media.

  • May I?

  • 66% of the time.

  • We just accept this.

  • Um great.

  • Thank you.

  • Uh, are we gonna hang here?

  • I can't remember if we get a raid.

  • No.

  • So, um, so the model definitely does better.

  • So with this, I'm pretty confident that I'm I can spend a little more time trying to actually make a quality.

  • Aye.

  • Aye.

  • That isn't as bad as this one.

  • So this one has a lot of mistakes.

  • A lot of spaghetti code going on.

  • Not to say that the next one won't have horrible code, too.

  • But but there's, like, a lot of little stuff that's just wrong here and then some stuff I've learned over the over the course of making this series.

  • So lots of people have suggested, for example, that the initial scout probably shouldn't be like the observer.

  • It should just be like a worker unit.

  • Right?

  • That's the first thing that you send.

  • Also, the way I'm doing, scout, is it, like flies around.

  • Apparently you set the scout, and then the radius gets bigger.

  • So probably Maur.

  • What you'd want to do is produce a scout, sent it to the main base area, set up shop there and then probably go to the next to at least resource areas.

  • And then also, if you aren't fun and then probably wait there and then, if you aren't finding if you don't see any enemies in those first, like three locations start to look like go to all the other resource areas, guys pray where they are because one of the biggest issues I had is the way I clearly is winning.

  • It's doing really, really well, but it doesn't finish off the enemy because it doesn't seek them out.

  • It only goes to the enemy start location.

  • So if there's no enemies there, we have to wait until the enemy builds up again and then maybe attacks us.

  • And then maybe we happen to find their locate their new location.

  • But that's not working.

  • And eventually we throw an error or some like that, and then we lose the game.

  • But we didn't really lose the game.

  • We should have won.

  • So stuff like that has to be fixed.

  • Um, trying.

  • Think What else?

  • Uh, there There's a discord.

  • I forget what the Discord channel is.

  • But anyways, um, there's the actual ladder for Python s.

  • Where's the SC to a i dot net.

  • Yeah, If you go here, you go to the discord and stuff.

  • And some of the people have been pretty helpful in there.

  • And one of the guys are Kaya tress, I think, is the name, um anyway, suggest two things.

  • One is like, we're just kind of like pulling radius out of thin air when you can actually just reference the radius of the actual object, Which makes way more sense.

  • Um And then also, he shared the way to actually acquire game time like, really game time, which is so much better than you know, estimating it orations per minute.

  • So stuff like that, there's there's a bunch of other things.

  • I've just made a huge list of all the stuff that I kind of want to fix here.

  • Also, we want a more complex Aye Aye.

  • We want an Aye Aye, that decides.

  • When do we build the scout?

  • Right?

  • And then if we have a scout scout, just follow some rules.

  • But when do we build scouts.

  • Should we build a worker?

  • Should we?

  • Um, And then again, when we build, workers will still use, Probably distribute workers.

  • But when do we build a worker?

  • Um, when should we maybe expand So any of the off any of the choices that are made Any one of the four choices that we made prior to, like, uh, release in this script, I think that you average was, like, 10 or 11 actions per game.

  • And we average somewhere between 30 and, like, 50 choice is a game.

  • So So you only need like, whatever the thing is, wherever the action is that you might want to take, you just want to be around 11 of them per game, as long as you can have that many.

  • Um, it's a choice that you could probably throw in.

  • So anyway, stuff like that, which, you know, like building scouts, building workers, building void, raise what to attack, better scouting better.

  • Um, Price, some other attack options.

  • We might change those around.

  • Anyways, there's a whole lot of things we've got to fix here.

  • So So anyways, um, in the coming tutorials probably Maur at least maybe the base code will pry just run through whatever I end up coming up with.

  • Um, but we'll see.

  • So if you have any other suggestions about things that you've seen that I haven't mentioned here also supply Depot.

  • This was never the correct naming.

  • It should have been command center I For the record, I need that.

  • But I just typed the wrong thing.

  • Um, anyways, um, yeah.

  • So there was that.

  • I think there was some other things too.

  • Oh, someone else pointed out in the scout.

  • I think I fixed it before this was our scout.

  • Um, where's the Okay, so no, I didn't even fix this one either.

  • I swear I fix this, but I guess I thought I copied it from part nine.

  • I fix it on my own code, but this was also problematic.

  • And doing a random variance of the enemy start location doesn't make any sense.

  • You should do random variance of, um, you know, the game map size.

  • So this never made any sense on four.

  • We're gonna toss this anyways, but there were other errors.

  • Thio just are slipping my mind, but anyway, it's anything else you want to improve or you think should be done better that haven't brought up.

  • Or if you want to kind of reiterate something you've said before, Uh, now would be the time.

  • Anyways, that's it for now.

  • Questions, comments, concerns, whatever feels really Melo.

  • Otherwise I will see you in another video.

what is going Everybody.

字幕と単語

動画の操作 ここで「動画」の調整と「字幕」の表示を設定することができます

B1 中級

ニューラルネットワークのテスト - Python AI in StarCraft II チュートリアル p.12 (Testing Neural Network - Python AI in StarCraft II tutorial p.12)

  • 0 0
    林宜悉 に公開 2021 年 01 月 14 日