My share here's a quick agenda there's another piece of the agenda that I'm missing right now but basically I want to point out that there's a workshop coming up pretty soon it's actually the first one is on Saturday let me get the O once I could just add this models okay we've got lots of good stuff here so tensorflow we have the PI torch we're going to do MX that samples we're also going to show the deep fake challenge Detection challenge this is by facebook FB and AWS once a kegel challenge okay so this is
roughly the agenda here's the link for the workshop coming up and type it in here upcoming workshop the first ones already sold out so I'm sold out for actually quite a while I think we have slots available in February and in March so we'll be doing it once a year so there's a free workshop will be covering lots of stuff coop flow will actually be doing lots of eks which is Amazon the last security service well it's about I think about it's estimated at about seven hours still finalizing the agenda for that it's some of
the same from last year but updated tzk s and the latest coop flow and the like latest and greatest stuff so check that out okay and ks+ to close so that's what we'll be focusing on there's the link for that we're going to be talking about some sage maker models and yeah so quick introduction money It was Christopher grade so introduction post regularly currently working at Amazon Web Services developer advocates for machine learning mission wagons please in San Francisco we also held on the line entre Park she is soon you want to say hello yes
hi everyone so my name is aunty I work basically in the same role as Chris s developer advocate at Emma's on Web Services also focusing on AI machine learning and as he's just riding here I'm based in Dusseldorf in Germany okay great so I'm sure and I have been working together pretty closely the last few months we can't we went to reinvent I think the previous so last month auntie gave a nice overview during this time slot that video is out there all videos are posted to YouTube pipeline AI all the news school two slides
are posted yes there's actually SlideShare okay so that's a little bit about us that's a little bit about the upcoming workshop That'll be on tonight doing that together and over about seven hours it's on Saturdays so hopefully people can make it the other thing I want to point out is this deep fake detection challenge now one thing you could do we have this repo let me put this refilling here it's still in the works okay hub so near github repo called data science on AWS and in there is actually if you click on deep fake
detection challenge this will get you to all the assets that We've created so this is a casual competition you can get to the link here from this you grab that you fakes are those things when you're on Facebook or on you know yes Instagram or doing whatever you do and there's a video that doesn't seem quite right maybe it has some fake news maybe it has the president speaking and it's dubbed over and it just seems kind of strange so if we click into the defect detection challenge here we'll See you can join the competition
by clicking here it's a Facebook challenge I believe it's 1 million dollars for the winner 1 million dollars in total prizes on here so Facebook is sponsoring this we are also sponsoring by giving credits you can contact and follow these links to get to the Amazon credits and we entre and I built this detection challenge did hub repo that's actually pins in the forums of that that challenge within kaggle and you can Click in here and follow the examples and if you want to try to do it at census law High Court John that's not
we're just showing basic ways to use stage maker and to train in a distributed fashion we're not actually solving this for you guys that actually would violate our Terms of the partnership so just know that these examples are just kind of generic examples but they do show how to use and train and use those credits which is Really nice so I imagine quite a lot of people will probably use censor flow care us and this shows you how to start with that thing to point out is yeah there's a nice blog post here that you
can link to and we have all the steps so if you do have to create a new Amazon account you can create it there you can apply the credits there create an s3 bucket to download the datasets review the regions choose the region that support of Ice Age maker essentially get Increases in your limits so that you can maximize those credits and train on font you can use and then how to get a stage maker notebook instance running and tie it to this github repo so all the steps are here for you feel free to
follow that and if you win I would love to hear about it just let us know okay so that's defect detection challenge while preparing for this for the defect detection challenge I decided to also create this kind of More generic Weibo called Amazon stage maker models and looks like how people even have been starring it and forking it so this is common example so these three are actually very similar on accident hydraulic sensor floats are the ones that are in the defect detection challenge repo shows you you know the instance type we are also factoring
in here or we're adding in here this factorization machines like algorithm to do factorization machine based Recommendations collaborative filtering so this is using a very fun data set this is the Amazon reviews such as amazon.com this is the Amazon Prime video these are all the reviews since 1995 I believe and this is a public data set there's about two million Amazon customers in this data set you know this is from a few years ago 160,000 google videos for example so you can go here follow this and we're actually doing some fun stuff where we're creating
Recommendations just like Netflix just like amazon.com and using Amazon search maker on some of the built-in algorithms so not only can you use tons for my torch on next up and you can use built-in algorithms by Sage maker there's this one called blazing text but it's actually based on fast text which is based on word - Beck & Orr is similar to like word to buy and this is actually kind of a clever way to generate recommendations off of textual data and So you can you know go through here I won't have time to go
through the details here but if you follow this notebook you can get this stuff running you know again this is public data set and at the end of the day we're actually training a blazing text or a fast tech word word Tyvek model building in the we're like hurting the embeddings for each of the movies and finding similar movies based on similar by the textual recommendations So kind of cool check that out it's calling like crazy here go back to the agenda all right so let me throw into one of these actually if I go
so this is actually very much the same as the deep a challenge shot I'm just going to go in here and here's the notebook so this is using what's called stage maker script mode now stage maker is very flexible and some would say even too flexible there's actually multiple dimensions to the Amazon stage maker product which is And some so like pretty much all of this is open source all of the code that you need to you know create these jobs on the back end so think of stage maker as a managed training service or
a managed model serving service and so you can even let me put a note in here just so I don't forget you can even do lemmas on Sage deeper plus Q look so I'll show that here in a bit there's something called a stage maker or operator I'm going to vanadis innovation or stage Maker so there's multiple modes you could use kind of pre baked stage maker like tensorflow containers and just put in your tensor flow trained PI and that's that's typically called script mode it's kind of a weird name but think of it like
you just provide the script and stage maker takes care of the rest that's that's the level that we're showing here you can also actually create your own containers with Completely different base containers or like do whatever you want and push it into stage maker and stage maker will run those containers just as long as you obey you know particular style of just calling the trained PI and I think there's like a some bash script hook so yeah this is all this is all documented and but the the more custom that you want to be the
more you're sort of on your own but there is documentation and you can Submit basically any docker container or docker image slightly built into stage maker and it will run this is actually kind of an in-between stage this is where we're reusing the tensorflow container because there already is a pre-baked tensorflow - oh and for the GPUs this has all of like the Nvidia libraries and CUDA kernels installed it's you know cruda 10.2 it's all the latest and all and so all you have to do is actually just give it a this is chaos This
is mms chaos tons flow 2pi file you also give it a requirements txt because it's very likely that you probably have your own their internal libraries that that you have built and and these dependencies are needed by the scripts or you just want to pull in different versions of you know numpy or psych it or whatever so this is what we so this is how you invoke so keep that on the on your like mental stack let me open up the other one here I'll put this Side-by-side this so this is the actual script so
when they talk about script mode this is actually what what they're talking about here yeah actually go to go into a source going to the source directory you'll see there's a requirements txt which actually this one doesn't have any custom requirements it's a pretty straightforward kiosks tensorflow model so this is what what you're used to looking at which is you know here's a Model here's my model compiled this is my care out of building it up tensor floats you lo using the Kaos API these should all look familiar basically loading up numpy arrays the you
know classic parse args very common within Kaos tensorflow loading creating the model printing some things out now this is one thing that's that's a little bit wonky this is for when you're doing distributed tensorflow you really only want one of these nodes There's always going to be args host 0 because no matter what there will be at least one host and if you have two hosts you only want one single hosts actually save the model out to s3 and I believe there's some you know sort of utility functions here to sync to us through them
this is really for tensor board integration so can try to show that a bit later but just know that you can actually embed tensor board into your stage maker notebooks and use all that So I was actually really surprised when I saw that and couldn't believe that actually worked but it did it was pretty slick it opens up a port it builds a proxy into that so you could access it from the public internet if you like ok so here's your scripts that you define here's the requirements txt showed those before and now we're actually
going to take that script and cut and we're going to point to it so I'm gonna zoom in here on this entry point I'm pointing to that Terrace file in this directory this will automatically pick up the requirements txt by the way we're giving it an output path to when it trains the model where to put it that's this of course you got to deal with your eye Emeril's and probably the likely privilege where you only give access to exactly what you need here in this case it'll likely be some s3 buckets you need access
this particular role that you're specifying here should Have access to write to that particular bucket and this particular prefix you also need some quota for these stage maker specific instances so note that ml dot means at the stage maker instance if you just provision a c5 to excel it it will not work and those are actually separate instance types they are fundamentally that the same instance it's just the way that the intern No Amazon accounting and capacity planning so these are ml dot so just Know that you might actually have quarter for a c5 to
Excel but might not have quarter for an ml that's in five to Excel so just like create a support ticket or you know off the deep paid jobs there was a link to contact support and to get those one that's increased here I'm specifying framework version is to oh i'm because it's tensorflow here and this is just a simple import I'm also telling it to turn on sage maker metrics this means push things into Cloud watch skirt mode equals true I think this is actually deprecated I don't think you have to specify this anymore it'll
just detect it tell it what version of Python and when you're doing distributed sensor flow you need to pass this in which is are you are we using parameter server mode and so parameter server is a separate cluster if you'll actually the way it's implemented is each parameter server actually runs on each of the instances Up here that's just something that is an implementation detail at the stage nicotine has chosen but just know that the parameter server is what lets you do distributed training you can do distribute training without like parameter server mode actually with
newer tents for two row in in that case we're using be like all reduce strategy distributed strategy you know probably too many details for this discussion but just know that and here I only have Train instance count as one just so that when people get started they don't like used up too much quota but all you would do is add two up here three up here ten up here whatever you want of course you know good good Amazon practice using Amazon Web Services always key set the key value pairs like that and note that when
you turn on the signature metrics is true you'll actually start to see these logs coming out and you know this is a tiny bit wonky I have to admit when I saw this I was a little bit shocked that it was this monkey but this is how it works basically we're scraping the container logs during training and performing reg X's and whenever we see in the logs something so this is a physical log line being spit out by the tensor for training job and stage maker is is capturing those logs and putting those values into
these metrics okay now these change sometimes from like release to Release I was debugging something recently past couple weeks where we bumped up to I think PI torch 1.3 or 1.2 and all the examples we saw for for a PI torch all these reg axes were bad and so I wasn't seeing any metrics in cloud watch and I want metrics in cloud watch because I want to do experiment tracking and when you know and yes I can compare multiple runs of each training job okay one thing to note is you can call fit now this
is from within a notebook you Could also call this from a cupola pipeline which I'll talk about in a sec you could call from a step function which is sort of the like airflow for like Amazon Web Services they're called step functions so there's lots of ways to actually call this fit if you're doing it from a notebook I would highly recommend that and say wait equals false this means put it in an async mode you would call get the latest job name so that's going to tell you the job name of That run and
then from there you could do you know between this cell and this cell down here you can do a bunch of stuff and then when you're ready to actually reattach to that live running training job you can reattach and then this will start spitting out the logs once training is done we can verify that the data has gotten there and the model has been built from that point we could actually you know just kind of inspect the model it's going to automatically Tar it up and to model that target cheesy of course tensorflow i'm karis
well in this case we're actually using the tensorflow saved model format and you can also use the h5 format of course with care us we then load it up and we can start to inspect that and actually do live predictions here right in the notebook now the other option you know this is just for for kind of ad hoc let's make sure that the model appears you know if we pass in an Image a digits brightly between zero and nine and written digit that it's somewhat close and it seems to be correct and then also
we could then take that model and deploy it as a rest on point so these are the steps to do that you can call deploy tell the number of instances give it the stage maker instance type that you want so typically you would walk the Train like most likely with the P to s or the P threes or the G's those are the GPU instances But when you go to actually deploy the model you can potentially step down to a CPU based instance and still get pretty good performance and here's how we're calling the end
point okay and here we're calling predict this is actually making a rest call beneath the covers and pulling back that prediction so once this and so this works the same way with PI torch and with an X net also you could do scikit-learn basically do anything as long as there's a slash Because I think it's slash invoke or slash implications if there's a restaurant point in there then stage maker can serve it okay so let me go back to the agenda here I'll spare any details of the PI torch and the MX net just know
that it looks exactly the same actually I'll show you guys the PI for each 100 quick just to prove it looks exactly the same as the tensorflow except for one small two importance so when we train there's that dumbness pi Torched a PI file which will have pi torch code in it similar to the tensile across code all the changes is this from stage maker got a torch import PI torch boom will and put that right there and everything else is the same specifying source directory there's requirements exe in there and passing some hybrid parameters
I don't know if I mentioned that on the tensorflow one tell it which version of pi towards the 131 these notes these are a Different red X pattern so I actually looked at the logs which is very easy through the notebook you do the attach or when you run with weight equals true you'll actually see the logs right and they don't work okay so you can kind of scrape it out and figure out the red X you know again you have to do this one time I guess and then double check it whenever you upgrade
Pike origins and these metrics start showing up in cloud watch and you can start building Dashboards to share with your data scientists as to all the models are doing during training ok all the rest is saying we're attaching or looking at the model or then we're testing it inside the notebook and then creating the stage maker endpoint again it's doing the same things called dot deploy how many instances what type of incidents and then beneath the covers you can look into the into the details there's a whole host of containers here So this is the
Sigma Corp I George container there's also times for container all of this stuff if you're interested all of this stuff is open source so I actually didn't know this myself I had assumed that these were not public but they very much are so my torch container those of you that are interested will want the first thing you're in asked is where is the docker file I'll show that to you there's a CPU and for giggles let's pull up the GPU One and you'll see something very similar so they're actually basing this off the Nvidia base
image - that does take care of quite a bit of the pain of the GPU drivers and then so so this is so you can actually copy and paste this and use this as your your base or your docker file and then tweak yes anything in here that you want if you want to try a different version of MPI you want to try python 3/8 I wouldn't recommend it unless you like absolutely know what You're doing these like doctor images get really really hairy very quickly especially with versions of CUDA so it's like that one
and but yeah just know that there is full transparency and these are the actual when someone says I trained a model on stage maker it's it is literally using that docker container now let's find the tenth circle stage maker I had to go into this many times figure out what's going on and work Backwards from here so nice - well I thought - oh is in here anyway let's crack open 1.5 and we can see and you can go in here and look for sensor flow or if you're looking for numpy actually see the exact
versions that are being used cos 2 3 1 okay it's not all the licensing stuff needed to get to the GPUs and those base images alright we'll get back on track here come people I think are interested I know are interested in sage maker kubernetes Operator this actually came out during reinvents - cool blog post here if you're into this kind of thing the business use case here is you have a existing kubernetes cluster and you're building couplet pipelines or you've built your own pipelines maybe add air flow and your Trent you are either training
models and finding yourself you know kind of stuck in and like a lot of Troop entities operations lands when all you really want to do is train a model And then get the results back and then continue on with your pipeline and so yes AWS recently released the stage maker operator for kubernetes now the term operator in kubernetes lands it's kind of a custom data type or like a UDF if you will like user defined function that's a very very gross slight generalization but for those of you familiar with like database technology there and like
api's you can introduce your own types or your own functions And think of this as a way to tell kubernetes how to talk to Sage Maker managed service and do it natively so with this you could actually do creep CTL get sage maker jobs you can look at the logs trying to see if they have an example here it's fully built or it's fully compatible with all the Amazon security so this is so CRD is called custom resource definition that's actually the new name for operators that's kind of a more modern way so get CRD
and win so here we're actually telling so there's code that that lives inside of these these custom resource definitions that knows how to talk to the Amazon Web Services API to create these training jobs to deploy models to run hyper parameter to names to do you know batch transformations and so that's kind of nice that that then is a pathway to actually integrate coop flow pipelines with sage maker which seems kind of weird but if you've ever tried To build your own poop flow pipeline beyond the simple samples you like quickly realize that you're you
know creating docker images for everything and you're right like having to manage yes all these docker files and different so here you could simplify all the model training and push it into stage maker and just treat sage maker like a black box or a white box gray box and call into it and then get the results and everything is all in one place and Saturday will actually dive more into this and have an example so you can create your own on yeah CTV use the Amazon keep learning containers like I was showing before or you
can introduce your own here's an example of the Emmel and for those of you interested in this kind of this level of detail so this blog post I pasted in the chat you can specify the docker image either the Amazon one or your own you can tell it the input Modi their file which is going To or pipe you almost always want to use pipe mode because when you're training you want to try to read it your data is in s3 you want to reuse as threes distributed capabilities - and have all those nodes that
are participating in the job training job to pull from s3 in parallel if you do final mode all of the data gets copied to all of the worker nodes and Men training starts and this could take upwards of an hour or days even depending on file size So always always always if you can use pipe mode TI te you can google that and find it the docks here we're specifying instance count this is all you know very similar to what we're doing through the stage maker API and of course beneath the covers this kubernetes operator
has been built with the sage maker API it's just this is doing it for us with configuration through kubernetes okay so we'll talk more about this later but yeah check this out keep an eye on Aditya I got to meet him at reinvents and super nice guy okay so we got to that one thing Antje and I have been doing so we've got about 30 minutes left I don't think we need that much time but I do want to go through something that that we discovered actually the last couple weeks sensory events which is called
processing jobs so if I go into it's like here I'm going to go into the station tour console if you are fresh to Stage maker you might be a bit overwhelmed here stage maker is kind of the overall term for the Amazon ai well specifically more more the like machine learning side of things versus the AI side of things so this is a tiny bit off-topic here but yes Amazon tends to distinguish AI as who's higher level services that are you know sort of API calls this on they're actually labeled all of them they're always
a machine learning in some of the Like reader and most of the reinvents and sort of recent documentation and slides I see almost all of these are under AI and then sage maker is is sort of the machine learning so said differently you can build your own models and train your own models and have complete flexibility with sage maker but this is also lower level what you like may want to do if you're starting off is give some of these services a try So there's comprehends which is sort of doing natural language recognition which is
doing video and sort of image classification poly which is doing believe this is text-to-speech and there's also speech to text I think transcribe so all of these are higher-level api's and actually I've been using personalise quite a bit recently and this is super slick so instead of doing your own factorization machines within Sage Maker for example Like was one of the examples i was showing before you could just switch and just try personalized so instead of building your own your own sort of recommendation models you can actually reuse personalize which has been trained on and
so you train it with your data you actually just think about your data point personalized to your data and then out comes a model that's actually fairly usable so rightly by this day and age collaborative filtering and like and Like generating recommendations is so commonplace and we've done it you know like five thousand times and there's so many different models that pretty much all do the same thing maybe small little tweaks specific to a particular domain to a video domain or to write like instagram like domain or Pinterest domain but you could really go a
super long way by just using personalized and just pointing it to your data and then getting back items item similarity to Pick that user to item similarity and start servicing these recommendations and not have to deal with docker images and say maker api's and things like that but if you're like me you'd like to get in beneath the covers and see what's going on on dive deep here so let's dive deep and show stage maker at stage this this left navigation is just getting bigger and bigger every single time I look at it so there
so sage maker there's like data Labeling here which is called ground truth you could set up sort of private workhorses to start to label images and you could also do something called augmented a I just kind of skipping down here which is essentially ground truth but you're setting up a workflow that then you can label misclassified predictions and they go back into this workflow and then become part of the map slave one job or sorry become part of the next training job So ground truth is the whole topic on its own that's you know there's
startups out there doing this and yeah so check all that stuff out and then there's notebooks here so this is really what what the sort of entry point for most of us is if I click on this I can go in you can open Jupiter supports jupiter lab as well - i'm i'm gonna do jupiter here because there's some visualizations that i potentially want to show and here's all those these are all of the those Repos from data science on AWS that i have created some of these actually are pretty slim even empty it's because
we haven't gotten a chance yet to copy from our staging area into this but one thing i'll show is the sage maker processing jobs so this is what i'm gonna demo i'm going to do the spark one I think I'm just gonna do psych it or at least talk to it yeah but let me continue on here for a sec so we're the processing jobs oh so processing jobs actually there so Doing that they're not even in the left UI yet the left now so they they came out at reinvents they like really build upon
right like the other base primitives Amazon in a pouch and of course I am rolls and all the goodies that Amazon Web Services gives you but they will show up here soon we'll be showing the API that invokes them and then how to actually look at the running jobs even though we can't see them here in the UI We actually figured that out I think yesterday the day before that they're not even here in the UI but we're still able to use them so the idea of a processing job is to do pre-processing right so
any pipeline that you have the second that your data your raw data comes in and it's not ready to be passed into a machine learning model you have to do some type of transformation or some type of processing note that that there is something called batch Transform jobs as best as I could tell and yes maybe I can correct me here in a bit but that shrimp transform jobs seem to be more on the prediction side more on like inference whereas pre-processing will probably end up as it's or be like processing jobs will likely end
up inside of their own little drop-down as you know feature engineering something like that not quite sure where they plan that these are the algorithms so these are built-in Algorithms I believe or you could create your own algorithms and you could either I can create my own algorithm and import the script and do all that or I can actually purchase somebody else's or borrow somebody else's you know and I could search the algorithm marketplace so this is something that Amazon has been famous for even back in the amazon.com days when they opened up amazon.com marketplace
which seem counterintuitive because why would Amazon open up their platform for others to sell but the idea here this is one of the core amazon.com tenants the whole company actually is offer more services offer more choices and that will then lower prices and you know create a fun experience for for the users so same thing happens here we could search this and actually rent sort of other people's algorithms or you could even create your own and then sell it on the marketplace which is Kind of fun to think about okay these are the list of
training jobs note that when when you call if you did call from coop flow and and said create training job it would actually create the training job here and you can go into the console you can see it you can go into into like cloud watch see the billable time so since 59 seconds see which docker image was used look at any metrics that came out here's all the metrics that came out that's the red X That was used to generate it and here's the hyper parameters that were years so we're starting to see the
experiment tracking right so we'll probably talk more about that next month and we'll definitely talk about it on Saturdays for the workshop but stay tuned for that parasite for parameter tuning jobs this is classic hyper parameter tuning so here we should see the difference runs this also highlights the best training job based on what what you were Trying to optimize there but yeah this is where you would see hyper parameter there's also auto ml now it's called autopilot that was released during reinvents not quite sure where that shows up in the UI but okay and
then there's like the imprint so when we actually do deploy the model we will push it to an end point and these are actually live on points I should I shut these down they're learning for a while I haven't really been using them but you Would would call into these so this these were the result of calling from my notebook when I called dot deploy you know takes like takes a few minutes because it's pulling on the docker image it's spitting up the instance and you can also now deploy multiple endpoints per physical instance so
if you do have hundreds of different models that you're trying you could actually run them on the same physical instance and and have some like cost efficiency there so That's transform jobs again this right now is under inference so you know this is more you instead of creating an end points like a rest endpoint you would point B model to an s3 bucket and then it would it would do batch transformations and then write it back up okay so I think covered everything there the batch processing sorry the processing jobs which are feature engineering don't
show up here but let me go back to this so Here's the notebook I blaringly large here but ya hate the idea so think of it it's pretty it's pretty generic right and that's on purpose processing containers there's going to be inputs to see the outputs there's a standard way to specify these inputs outputs please get mapped in inside of the container to a well-known directory that you could reference from your code so inside the container your data will live up opt ml processing input your Code will will live at opt ml processing code the
output will be optimal costing upward and this is where you would specify the s3 bucket for the input data you give it some some sort of like output bucket probably an empty bucket hopefully and then the that new data will get the processing so no matter what you're doing now typically we're not training models here so typically and we're also not like doing batch predictions here this is simply to Transform the data so let's say I take the Amazon reviews data set and I want to strip out all reviews that have less than 20 characters
because they're because they just say great or good or high or you know something like that so what we wanted to strip all those out that's where this this processing job comes into play so the github for this side we find the github repo custom jobs I'll put the link in the in here the way that we're triggering this is through is Currently through a lambda function and that's just because most people are familiar with lambda functions were actually going through the process of converting everything over to you step functions but for now let's just
look at the notebook here okay so here I'm just setting up the input bucket like I showed up there pulling in some data just to kind of look at it make sure everything's good upload again here we're just going to Use the lawn and garden reviews just it's about 500 Meg but so it's still still pretty sizable but not the full full data set here so this is actually the more complicated one and I'm starting with this because I come from data bricks so I know quite a bit about SPARC so I wanted to tackle
this and make sure that we can actually use SPARC to do our feature engineering so it's very very common people have SPARC based pipelines already in place and I want to Show that you could do this still with stage maker okay so the trick here is we actually have to use a custom docker container now this this docker image already exists and it's under samples so but just know that we're going to reuse this and this has spark two for for the latest spark and but there's still a tiny bit of docker in your stuff
when we show on shows version which is just psych it you can use just the stage maker API but Spark which has always been a little bit wonky when it comes to Amazon Web Services is still still requires a little bit of shim but this framework is flexible enough where you can use your own docker images we've already provided docker I'm just for you to use all you have to all you have to provide is your spark script so think of this like script mode for sage maker processing jobs so this should look for If
you're a PI smart person you'll know sparks session get a create giving it a name setting up some I do configuration stuff here we're actually defining the schema right in line so you see exactly what this we're then reading this is actually 80s via that's just the native format there's also parquet when I was debugging this I wanted readability and this was a small enough filed up I just use TSP here you'll notice at the very bottom I actually have to do the part a So that's coming but reach ESV here where we're filtering and
saying only preserve the reviews were the body size greater than twenty characters it's just a pre-processing thing that we're trying out maybe this will make them the overall model better maybe it won't doing our spark select group by here I'm actually doing a counts so I I'm actually doing multiple side effects from this particular processing job I'm summarizing the data and putting it Under category counts I'm also averaging per category the ratings and yeah this is I probably could make this a separate job but just to keep the code simple I put them all here
in the same job here and now this is really where we would be doing in a more feature engineering stuff here would be filtering and then if we just kind of ignore this sort of aggregations and then we're splitting and training so doing 80% training data 20% poor validation and then writing Each of those data frames to their own subdirectory within the output so somewhere there's a most three bucket that I'm that I passed in and all of this gets wiring up here there's something called script processor I'm giving it a name this is boilerplate
that's specific to the SPARC processing this does not have to be done for the regular psych it one for the for the more native of course giving it a role hopefully this role has Access to those three buckets and here we're actually giving it in our instance so R is RAM so hi Graham very common inspark workloads are 5xl and give it to max run time so therefore after 5 minutes if this thing has not completed then something's wrong until it environment Python mode this is you know again specific to the Spartan limitation so again
I'm showing you guys the most difficult one but to me was the most important to get running because if If we can't do stage maker processing with spark then it's not as useful my personal opinion just because of my experience so I got some areas I was doing stuff right before this but just know that you'll see you can actually run this so this is the alternative to the UI console so this is what is not currently in the UI but list processing jobs in this will show here's a particular job I was running there
and we're getting the output displaying the Output showing and then we could go on and then train a model so again this is using the notebook to sort of spawn these jobs and wait for them to finish and then go on to training on the training job there should be an estimator yep right here if you're using tensorflow you would use sensor for pie charts pie charts is actually appears to be using a custom image here i believe this is a chi boost and then calling fit at some point right here so so this is
Actually doing a pipeline within the notebook so again we're we're converting these over to you step functions and you'll see those popping up in the step function pipelines here which it looks like there's a couple sample ones but we'll be making we'll be polishing these here in a bit okay crap I didn't realize we only have 10 minutes let me convert your hand this over to ancho ancho go underneath yes just up your shirt yes I do redo all right so you just saw the Processing drops example with spark so what I'm going to show
you is a little bit the lighter version with a site key learn so again processing jobs chris has explained for the pre-processing in this use case here we use the census data side so that's basically just a collection of census information from the US and we'll see a sample of the datasets here just in a bit we start again with importing a couple of Libraries so Bordeaux 3 is the Amazon Web Services - SDK to have access to the Amazon the AWS services from the notebook here we import the sage maker Python SDK and then
what you see here is that we're using pre-built container as I could learn processing job container and this we're doing here with sage makers regular in-processing import sq learn processor we're pulling in a little bit of animation our execution role here for sage maker the IM role and then we're also doing a little bit of configuration here right away so we're saying for this second learn processor we're passing the instance type again which one we want to use instance count etc the framework version we want to use etc alright so have a look at the
data set here so as I said it senses information so it's about US citizens here so you see categories of class of worker education wage and what We want to do here in this example is basically do a classification whether the person has an income over 50k or less than 50k in a year all right so um again we're doing some pre-processing that's the whole idea here here's a script so we're basically doing here again a couple of imports getting so I could learn and then we're putting in the columns we want to use also
the labels of the class here as I said like below 50k here more than 50k here and then starting here reading the input data again putting it in data frames making sure we drop any duplicates also we're doing a little bit of transformation here with the numerical um columns and transforming those into categorical features so it's all described here above you can read through that so we're basically doing the transformation in this script we're Writing out the script so we can use it and then what we do here once we have that pre-processing script we're
calling the cycle erm processor run command and we're specifying here as input the Python code we just wrote above and then passing here again where to find the input data which again resides somewhere on our f3 we're putting it to the local container destination folder here which is also like the optimal processing input and we're doing the same here for The outputs that we're specifying where the output goes for the split data set so we're doing the same split here as you can see in the arguments 80% 20% between train and test and we're also
telling it where to save it information so it's gonna be a trained folder and a test folder and then basically we're kicking off the job that again gets translated to this processing job and does the execution and also then it saves out all of that information to f3 And if I go here quickly on the console and check out my f3 on the right it creates folders and basically it's some custom naming you can also change that but basically it creates those folders here's input code where it writes the pre-processing file into and then there's
another processing job wait actually kicks off the script and then you see here for example output where it for example saves the model later and source information so it also like Pushes out that information to f3 and you have access to it to kind of yeah do some processing afterwards alright back to our main script here so the processing job runs in the background you can also see here in the lock the exact folder where it pulls the CSV data from and then basically the local folders and also here the output so if you want
to see like those folders in a3 it's exactly mentioned here in the logs and Then once it finished we can actually have a look at it so we're pulling the pre-processed training data having a look and here you can see that the data has been transformed so this is the training features now and then you can actually kick off the training job so here again we're calling scikit-learn and giving it an entry point in this case we're providing a training script also the instance type and here for example we're putting together a Training Python file
with pretty much no one content I guess so it's not very difficult you're putting pointing it to the training folder here again in the container passing the training features and the labels and then you're basically also dumping out the model that's what we just saw an s3 already I run the jobs before it so we have the output and don't have to wait and then basically you're doing this I could learn fit and Pointing it to that pre process training data and kick off the job so again this is being executed in the background in
this case you actually see the training job in Sage Maker because this is executed as a training job here now and stress roll down what you can also do is then undo some model evaluation so in this case here we put you get an evaluation python file again pointing to the local folders here and in the container image and doing here Loading the test features and labels which we split in the first task and then basically executing here and reporting for example on accuracy metrics and if I run that then as a also as a
processing job and do this and then I read the file so we see here the outcome I just do a quick fast-forward here so with that we kind of see the output like for example if one score a precision recall etc and we can evaluate Our model this way so this was a quick run through the pass I could learn example again also here you can obviously run your customized soccer files and Dockers if you have your own dependencies so basically putting together your docker file in this case just an easy example like put in
like third and pandas and psychic visions and then you can basically also use that docker container you build it you push it and and then you can do the script Process or run commands and you're pointing it to your image URI you just built and then also you're just calling the job exactly the way we did before but this time basically it executes with your custom container that you built so this was really kind of the very easiest I could learn example for processing jobs and Chris already shared the github link here where you can
find the github code so if you want to give it a run for yourself feel free it's really fun to Play around with and yeah great way to get started with those processing jobs to do the data pre and post-processing and also model evaluation with those new sage maker processing jobs and with that I'll hand over back to Chris to wrap it up okay thanks I'm Jeff good stuff I actually learned a couple things on on that one one thing I didn't realize that he made me realize oh cool okay and wrapping up I actually
have a surprise For everyone who stayed on the line I'm going to post this link into the chat here if you can could rate this event you'll get $25 AWS credit so it's I think it's just two questions it's rates also speakers and rates the content that we provided this is so this particular yeah so just to just kind of remind everyone this particular event is really monthly updates on what we're working on and sharing with you kind of the latest and greatest and literally we got these Things working or I got it sort of
working just minutes before just to kind of summarize everything for you guys so this is always kind of a moving target we always mold this play and put things into the Saturday workshop will yeah like once again ask you guys to rate the Saturday one but thanks a lot for taking your time I know it's an hour and it's a Monday but hopefully you found this valuable so grab that link and please ask any questions well I'll Open it up here a couple minutes looks like we had a couple questions about personalized I should take
care of those there's two different algorithms okay and please ask the question to all panelists and attendees okay someone's asking about data bricks versus AWS I would rather not comment on that but I will say that data bricks is a great company and there's lots of space there's lots of room for for competition dataworks has done a really good job Making spark super usable and you know in my opinion I think things could be a little bit easy on the AWS side like again AWS really focuses on building blocks and we're just now starting to
see you know more higher level services coming through and these AI services I am particularly paying really close attention to the SPARC support within Sage maker which is why I was very excited to get the spark example working so spark on the AWS is Getting easier on and in my mind it's flowing through sage Michael the other benefit of having this stuff go through stage maker is that customers when they use right like super large customers when they need to whitelist specific services or like evaluate the services sort of each on their own and it
takes a little while to actually get the white listing and you know get the approval when these things flow under stage and maker they know that everything follows The same stage makers security and the single stage maker powder so yeah there's quite a lot of people using data bricks there's also quite a lot of people that use EMR inclu with spark and yeah plenty of room for competition in that area is there an oak like that uses cube flow and sensor flow on AWS you know I had an operator notebook yeah but I don't have
it off hand but um but yeah I thought I did I'm trying to never wear it is it's somewhere the question is is There a notebook that shows the creep flow and the operator or if they keep oil and let's roll on KS ah do you know what what you can do there's actually chaos which does it get farm.com slash it did alas - there's something called eks Workshop which is pretty slick and here's the here's the link therefore eks workshop you could probably find something in there I think that's where I got it from
this is actually a full workshop and and Pretty cool stuff here's there's the full length there this is actually some of this content is what we'll be doing on Saturday for the free workshop will specifically be focused on the Advanced section and machine learning with coop level so that's specifically the area I believe there's a Jupiter notebook in there I can't remember if it uses tensor for now but that's like great feedback and I'll try to work on that one for next month okay airflow and spark I Don't know of one that uses air flow
and Clark I know of one so I've been focused on these processing jobs which I've got that worth in the Sparkletts II don't know one that uses air flow and spark I'll take that as a note for future something to look for okay yeah yeah I'm sure I found a good link here for using stage maker with air flow any comments vengeance on production of melters in general to fall on TCP azure AWS I work for AWS so I'm going to say use cupola On AWS in fact one of the reason one of the big
reasons I joined like AWS recently was they they are paying attention to coop flow and I was a little worried about that you know probably last year I might not have thought that but then I caught wind of eks workshop and went to kook on and started seeing more and more Amazon people speaking at KU Khan and met with those people and you know sort of discussed what's going on and my Particular role is straddling both stage maker and COO flow having quite gotten me to where I want to yet with with the assets that
that'll be coming on Saturday with the actual contents but this eks workshop is pretty darn close to where I want to be and so I'm building off of that so yeah yeah obviously coop flow started off as a Google project they are very very open I call in to all those meetings all the time so you know Make sure that there's that there is nothing going on that specific to Google they're very conscious of that and I could say from the AWS side there's actually quite a lot more support for ku flow internally than I
thought the listen learned about me before after I joined so yeah Kukla AWS very good combination and that incase workshop actually shows you how to set it up in a nice clean way that supports all the I am roles and even the open IDE Speckies multitude yeah good questions I've actually never used to flow on Azure I will say the one of the creators of coop flow this is public knowledge went to Asher and so you know sort of by default I can imagine that that Asher will start to show more and more support for
a truthful and A to Z but yeah my personal favorite is AWS opposed to club and this weekend we'll be doing a ws+ to play and if I don't see you on Saturday hopefully we'll see you in a future Satury in a future Saturday in the coming months so thank you much yeah I'm sure you still there I'm Solaris thank you everyone for joining today all right I'll post this video to YouTube I was a pipeline which is PS YouTube pipeline ai and we'll see you all soon thanks you