Results - Python AI in StarCraft II tutorial p.17

sentdex · Beginner ·🛠️ AI Tools & Apps ·7y ago

Key Takeaways

Trains a StarCraft II AI model using Python and the SC2 API to achieve 40% in-sample accuracy

Full Transcript

what is going on everybody welcome to part 17 oh my gosh everything is really degraded at this point now not even copying and pasting he's just going over the text-based version of the tutorial okay so this one I just kind of want to talk about where we stand now with the training and the results and all of that up to this point and what I think should happen moving forward so so so basically if you go to the text-based version of this tutorial this is the script for actually training the model I tried many different models different setups and I ended up kind of going with the same one as what I had before and the only difference in this script is the difference different number of choices on the output layer so there's really not much different in this one we've kind of already gone through you know how to set all this stuff up also let me think here this one doesn't appear so yeah this one doesn't have the out-of-sample data so I'm gonna go ahead and host that as well I'm gonna edit this text based version it's tutorials I was a major issue so I did train this model to about 40% accuracy but that's like in sample accuracy and even the validation accuracy we talked about that before but it wasn't really validation it wasn't like an ad a sample set so what I did was I created a true out-of-sample set and found out it's just it's not actually that great so just for the record random with you know 14 choices is not 0.14 it's actually you should be like point seven one four I think so that's an error anyways moving along and then this is to actually run the model and again I ran I think maybe like 30 40 some games and I didn't be easy once so that's not an improvement over random I definitely be easy more than that on random which is unfortunate because the the first one like the one that just made the attack choices that actually did in it beat it beat easy more than random beat easy and then so the objective was to eventually you know compete against medium and then train a model on that medium and then with that model compete against hard all you need is like a victory once in a great while to create your training data but unfortunately we don't have any so can't can't do anything with that so so what I'd like to talk about is like like for example in the actual data creation I guess we didn't actually go over the choices let me see here because I did I did change let's see if it's on this one and I just didn't talk about it right it is so I don't think I mentioned anything on this let me see if I can get this to pop over come on CSS you can do it yeah alright so what I did here is in the do something method so this is again to create training data is I added in these like weights so like for example we weren't producing nearly enough workers when the when it's just random and everything's weighted the same so what I did is we now we make a random dot choice of choice weights and choice weights is one times however many we want basically you just have an eight times chance to get workers versus you know a 3x chance to get Z a lot and then zel it and then zero I forget what the zeroeth choices does that expand I forget which no build Scout we just in haven't you have to build Scout that often so I think that's probably why I didn't find that to be an issue anyway you can keep adjusting these weights too to build better training data now when the model is done when the neural network model is completed when you actually go to run and test the model so this is a let's see oh this is the out-of-sample testing okay good I'm glad I attached that so it did attach that I will host the both training data and out-of-sample data though for people who want to work with it okay so yeah in self-taught use model we can basically do the exact same thing so all we need to do is create a weights vector and multiply the weights vector by the you know the output array from the neural network now if we do that we can begin to kind of tweak how that model performs but it would be very important that you the weights that you apply you would have to still be you done you can't just make some victories and call it a day you would have to be still better than random but then also as you keep tweaking this it starts to like I don't really mind tweaking a couple of things because it's not working the greatest but when you would like to really start digging in and tweaking these weights you're converting the AI to be more rule-based and I really want to avoid that especially in the early stages that we're in right now I don't want to do it so anyways but regardless through quite a bit of tweaking I still could not get it to do better than just the random model with the weights and again the random model with the weights to create the initial training data isn't as big of a sin as you know trying to get this model to do well by heavily weighting it at the end and like I said I couldn't beat it if you could wait it and you could beat it then all you got to do is okay use that as training data and just keep iterating on that process and that could produce the results unfortunately I just couldn't it doesn't beat even the easy AI which is problematic so what to do from here I mean there's a whole bunch of things one is unfortunately don't actually have the real image what I could do though is I can log in to the actual paper space oh I'm worried let's see so and I can pull that up and the machines already on too and I can show you the training data because it's it's not it's not good enough so a part of me thinks right now the issue is mostly like the the actual model itself I think we could come up with probably something better experiencing some serious lag here okay here we go okay so this is the tensor board of the train data I'll turn on relative and this actually might be you know these are two separate models okay great so so these were just two attempts at using true out-of-sample data and it for the validation that is and as you can see it's not it's not going so hot we're not even really beating random here which is super super unfortunate with enough epochs we do actually begin to get accuracy will go up the problem is validation accuracy does not so you know looking at this I would just say either the data is no good or the model is no good we're just not fitting this data so I mean there's like an infinite combination of models that we could try so that's kind of my next step is just to keep trying a bunch of different models and see does anything train if not then we need to probably reconsider maybe going back to the color method you know using multiple different colors revisiting that kind of drawing and all that because it's really crazy though because like when I run this model I can see it knows how and knows how to do stuff like for example like when we start when we get under attack that's you'll start seeing defend Nexus like it starts coming through and you don't see that other times right so it's definitely like picking something up it just doesn't seem to be good enough so anyways kind of stuck at the moment to be honest so I'm gonna upload the data anyways you guys can play with it I think the biggest thing is just fitting to the data I will upload the model to the model that I have up to this point if someone wants to try to play with weights but I don't think you'll get anywhere but it is interesting I mean it's definitely over fit but the validation accuracy is you know neutral I mean is it's really no different than random so no no real surprise there I guess yeah so anyways that's all for now if I I'm gonna keep working on it but if until I find like a better Ellucian either to better data or whatever a model that trains on basically fourteen or like something like this I probably won't produce an update and it just takes a long long time like this at least right now these two models you know I spent a few days on but the model previously was like days in days like four days or something like that let me see if it's up here here it would be yeah so from the 21st to the 24th I trained that model so anyways it just takes a long time it's kind of like the GTA series so anyways if I come up with any sort of update I will let you guys know if you find something that trains awesome if you think you have an idea for a way that we can work with the model and get it to work you know let me know below anyway that is all for now hopefully that will be the last time I say anyways and if you got questions comments concerns whatever feel free to leave them below otherwise I will see you in the next anyways

Original Description

In this part of the StarCraft II artificial intelligence series, we're going to run through the new model, training, and testing. Text tutorials and sample code: https://pythonprogramming.net/stage2-training-starcraft-ii-ai-python-sc2-tutorial/ Chat with us on Discord: https://goo.gl/Q9euv3 Support the content: https://pythonprogramming.net/support-donate/ Twitter: https://twitter.com/sentdex Facebook: https://www.facebook.com/pythonprogramming.net/ Twitch: https://www.twitch.tv/sentdex G+: https://plus.google.com/+sentdex
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from sentdex · sentdex · 0 of 60

← Previous Next →
1 Matplotlib Python Tutorial Part 1: Basics and your first Graph!
Matplotlib Python Tutorial Part 1: Basics and your first Graph!
sentdex
2 Python Encryption Tutorial with PyCrypto
Python Encryption Tutorial with PyCrypto
sentdex
3 Python's Logging Function
Python's Logging Function
sentdex
4 wxPython Tutorials 1: Making Windows GUIs with Python : Installing + 1st window!
wxPython Tutorials 1: Making Windows GUIs with Python : Installing + 1st window!
sentdex
5 wxPython Tutorials 2: Making Windows GUIs with Python: Customizing Window Parameters
wxPython Tutorials 2: Making Windows GUIs with Python: Customizing Window Parameters
sentdex
6 wxPython Programming Tutorial 3: Menu Bar and Menu Button
wxPython Programming Tutorial 3: Menu Bar and Menu Button
sentdex
7 wxPython Programming Tutorial 4: Panels
wxPython Programming Tutorial 4: Panels
sentdex
8 wxPython Programming Tutorial 5: User Input Saved To Variables
wxPython Programming Tutorial 5: User Input Saved To Variables
sentdex
9 wxPython Programming Tutorial 6: Multiple Choice Input
wxPython Programming Tutorial 6: Multiple Choice Input
sentdex
10 wxPython Programming Tutorial 7: Adding Static Text and Colors
wxPython Programming Tutorial 7: Adding Static Text and Colors
sentdex
11 wxPython Programming Tutorial 8: Custom Button Images
wxPython Programming Tutorial 8: Custom Button Images
sentdex
12 wxPython Programming Tutorial 9: Tool Bar Items and Sub Menus!
wxPython Programming Tutorial 9: Tool Bar Items and Sub Menus!
sentdex
13 Basic PHP Tutorial 13: Multi-dimensional Array
Basic PHP Tutorial 13: Multi-dimensional Array
sentdex
14 Basic PHP Tutorial 15: Functions and Global Variables
Basic PHP Tutorial 15: Functions and Global Variables
sentdex
15 Basic PHP Tutorial 12: Associative Array
Basic PHP Tutorial 12: Associative Array
sentdex
16 Basic PHP Tutorial 14: Foreach loop
Basic PHP Tutorial 14: Foreach loop
sentdex
17 Basic PHP Tutorial 16: Include and Require
Basic PHP Tutorial 16: Include and Require
sentdex
18 Basic PHP Tutorial 7: Assignment, comparison and Logical operators
Basic PHP Tutorial 7: Assignment, comparison and Logical operators
sentdex
19 Basic PHP Tutorial 4: Variables and Comments
Basic PHP Tutorial 4: Variables and Comments
sentdex
20 Basic PHP Tutorial 11: Arrays part 1, basic array
Basic PHP Tutorial 11: Arrays part 1, basic array
sentdex
21 Basic PHP Tutorial 6: If else and else if conditionals cont'd
Basic PHP Tutorial 6: If else and else if conditionals cont'd
sentdex
22 Basic PHP Tutorial 1: Intro to PHP
Basic PHP Tutorial 1: Intro to PHP
sentdex
23 Basic PHP Tutorial 3: HTML with PHP
Basic PHP Tutorial 3: HTML with PHP
sentdex
24 Basic PHP Tutorial 9: While Loop
Basic PHP Tutorial 9: While Loop
sentdex
25 Basic PHP Tutorial 10: Switch Statement
Basic PHP Tutorial 10: Switch Statement
sentdex
26 Basic PHP Tutorial 2: Print and Echo
Basic PHP Tutorial 2: Print and Echo
sentdex
27 Basic PHP Tutorial 5: If else and else if conditional statements
Basic PHP Tutorial 5: If else and else if conditional statements
sentdex
28 Basic PHP Tutorial 8: Arithmatic Operators: Doing math with php
Basic PHP Tutorial 8: Arithmatic Operators: Doing math with php
sentdex
29 Basic PHP Tutorial 17: User Input Form Example / String Manipulation
Basic PHP Tutorial 17: User Input Form Example / String Manipulation
sentdex
30 Basic PHP Tutorial 18: HTML Entities and forms cont'd
Basic PHP Tutorial 18: HTML Entities and forms cont'd
sentdex
31 Basic PHP Tutorial 19: Finding words in strings
Basic PHP Tutorial 19: Finding words in strings
sentdex
32 Basic PHP Programming Tutorial 20: Saving to a File / writing and appending
Basic PHP Programming Tutorial 20: Saving to a File / writing and appending
sentdex
33 Basic PHP Programming Tutorial 22: Hashing part 2: salting
Basic PHP Programming Tutorial 22: Hashing part 2: salting
sentdex
34 Basic PHP Programming Tutorial 23: Variables in Strings and tokenizing
Basic PHP Programming Tutorial 23: Variables in Strings and tokenizing
sentdex
35 Basic PHP Programming Tutorial 21: MD5 Hashing For Security
Basic PHP Programming Tutorial 21: MD5 Hashing For Security
sentdex
36 Basic PHP Programming Tutorial 24: String similarity
Basic PHP Programming Tutorial 24: String similarity
sentdex
37 Basic PHP Programming Tutorial 25: Time and Time stamps
Basic PHP Programming Tutorial 25: Time and Time stamps
sentdex
38 Basic PHP Programming Tutorial 26: Die and Exit
Basic PHP Programming Tutorial 26: Die and Exit
sentdex
39 Basic PHP Programming Tutorial 27: MySQL Databases Part 1
Basic PHP Programming Tutorial 27: MySQL Databases Part 1
sentdex
40 Basic PHP Programming Tutorial 28: MySQL Database Part 2: Reading From Database
Basic PHP Programming Tutorial 28: MySQL Database Part 2: Reading From Database
sentdex
41 Basic PHP Programming Tutorial 29: MySQL Database Part 3: Inputting Data
Basic PHP Programming Tutorial 29: MySQL Database Part 3: Inputting Data
sentdex
42 Basic PHP Programming Tutorial 30: MySQL database in Use
Basic PHP Programming Tutorial 30: MySQL database in Use
sentdex
43 Django Tutorial Web Development with Python Part 1: Installing Django
Django Tutorial Web Development with Python Part 1: Installing Django
sentdex
44 Python Tutorial: File Deletion and Folder Deletion / directory deletion
Python Tutorial: File Deletion and Folder Deletion / directory deletion
sentdex
45 Python Tutorial: How to Rename Files and Move Files with Python
Python Tutorial: How to Rename Files and Move Files with Python
sentdex
46 3D Graphs in Matplotlib for Python: Basic 3D Line
3D Graphs in Matplotlib for Python: Basic 3D Line
sentdex
47 3D Plotting in Matplotlib for Python: 3D Scatter Plot
3D Plotting in Matplotlib for Python: 3D Scatter Plot
sentdex
48 3D Charts in Matplotlib for Python: Multiple datasets scatter plot
3D Charts in Matplotlib for Python: Multiple datasets scatter plot
sentdex
49 Sikuli Tutorial 1: Visually programming in python!
Sikuli Tutorial 1: Visually programming in python!
sentdex
50 Sikuli Tutorial 2: Program visually in python!
Sikuli Tutorial 2: Program visually in python!
sentdex
51 Sikuli Tutorial 3: Program visually in python!
Sikuli Tutorial 3: Program visually in python!
sentdex
52 3D Bar Charts in Python and Matplotlib
3D Bar Charts in Python and Matplotlib
sentdex
53 3D Plane wire frame Graph Chart in Python
3D Plane wire frame Graph Chart in Python
sentdex
54 Raspberry Pi Part 1 Introduction
Raspberry Pi Part 1 Introduction
sentdex
55 Raspberry Pi Part 8: First Download and Update! (Firmware)
Raspberry Pi Part 8: First Download and Update! (Firmware)
sentdex
56 Raspberry Pi Part 10: How to set up a Linux Web Server on your Pi
Raspberry Pi Part 10: How to set up a Linux Web Server on your Pi
sentdex
57 Raspberry Pi Part 11: Remote Desktop
Raspberry Pi Part 11: Remote Desktop
sentdex
58 Twitter Analysis: How to rank a user's influence
Twitter Analysis: How to rank a user's influence
sentdex
59 GPIO Tutorial for Pi Part 2 - Programming the GPIO
GPIO Tutorial for Pi Part 2 - Programming the GPIO
sentdex
60 GPIO Tutorial for Raspberry Pi Part 1 - Setting up
GPIO Tutorial for Raspberry Pi Part 1 - Setting up
sentdex

Related Reads

Up next
Routine AI Review 2026: Smart Calendar, Tasks & Notes
DroidCrunch
Watch →