Placeholder Image

字幕表 動画を再生する

  • What's going on?

  • Everybody welcome to part six of our antics with neural networks Tutorial Siri's in this video.

  • What were we doing is I'm just gonna run through basically the opposite of what we've been doing so far where we're generating a classification based on a number input to.

  • Now what we're gonna do is we're gonna have the actual classifications being the input and the number is going to be generated.

  • So basically, what we want to be able to dio is input a five and have the neural network draw us a five.

  • So I'm gonna go over the code that I used to do just that.

  • Really, This is all code that should look very familiar to you guys.

  • Just a few slight changes.

  • So I don't really see any benefit in us writing it out.

  • So, um, for the input, basically, we're just doing 15 rows of, um encased in Coghlan's 20 versions of whatever the number is that we want for the label.

  • And I'll show that to you in a minute.

  • So that's basically gonna look like this.

  • So the so that the training data is like this.

  • So it says, hey, draw me eight.

  • Boom.

  • Here's an eight and then it's Here's the input.

  • Please draw me to draw me another two, a nine and so on in.

  • Our goal is to win when the user enters a nine.

  • Use this as the primer and then do your generation.

  • And the hope is that based on this, this primer, it generates this.

  • Now The reason why I changed the classifier or the classifications generator code is because actually, as I was doing this tutorial on doing the right up, I was think I was working with one hotter Ray and then I flipped it around and said, Okay, can we draw a number based on the one hotter Ray?

  • Because the classification didn't really work.

  • And then I thought, Well, it's probably really challenging when you have, like, a one hotter ray because eventually, you know, first of all, if you get that one hotter rate, you only have one opportunity to get that number right, Especially in the classifications, you only have one opportunity to get it right.

  • Whereas you have many opportunities if you give it something like this.

  • Like many, many rose basically of data, and I think the same is true when you're drawing something where if you just have the 11 hot array or vector whatever you wanna call it, um, as you begin to, like, slide your window down because the way that we've done this to you can almost think of it as like like, think of it as, like, this window here and as you slide it down your window.

  • Now, for the generative model is like this just at this point.

  • Like what if What if at this point, it just had one vector here, right?

  • It would have to get that one vector, right?

  • And that one number that was like in that vector, there's only one tiny difference between the different classifications.

  • And in my opinion, that was prime making it really challenging, I think toe learn.

  • So, anyways, that's when I started doing this.

  • And then, as you saw in the beginning, I already knew that this would be successful as I was filling this.

  • Obviously, I didn't know that was gonna be successful at the time when I built this.

  • Um, but as we've seen also with the classifications generator, that else was also seems toe work or at least help.

  • Now, this model's been trained for about 90,000 steps.

  • So, um, at least I wantto let that other one the classifier trained for the same amount.

  • Anyway, that's the input data.

  • This is the code to make it again.

  • You can go to the tax base version, this tutorial to get it.

  • Then we have the sample number drawer.

  • This one's even more challenging for us to determine, you know, some sort of accuracy percentage because, um, really, you would need an m n'est classifier to classify the output, Would you could totally d'oh.

  • Um, I just didn't really feel like doing it.

  • I was just gonna eyeball it.

  • So anyways, um, this is the code that I've written to actually just generate the number.

  • So you just take the input is just straight up an input.

  • The primers empty right now for, you know, nothing that matters.

  • In the range of 15.

  • We generate this same as we basically did it right here.

  • Um and then I'm actually gonna just clear this like that.

  • And then, while true, we just start iterating through here.

  • Now, um, in this case, basically what we're trying to do this is using a regular expression to attempt to find the drawn number.

  • So it's just looking for instances where you have two brackets.

  • So, um, bracket number one bracket number two and then this is actually a regular expression.

  • So So take note.

  • I'm sorry.

  • This is the regular expression that we're hunting for.

  • So take note of the back slash bracket versus no back slash bracket brackets.

  • Ah, you know, part of a regular expression syntax now, Um, so that's what we're doing.

  • We're looking for two brackets, followed by literally anything in between those two brackets.

  • So again, um, in this case, these are encased by Coghlan's.

  • But then the whole number is in case by two brackets and another two brackets.

  • So our regular expression is hunting for that once it finds that if it doesn't find that it's gonna actually just continue this loop, it's gonna attempt to make another prediction.

  • But once it does find that it's gonna go ahead and break, it's gonna print it out to the screen for us, and then we're gonna convert it because obviously this can't be drawn in Matt pot lid.

  • So just like we had to convert it to a very simplified in condensed array.

  • This way, we actually have to convert it back out to something that we can actually graph.

  • So that's what we're doing here.

  • And then we go ahead and just run an E Val on it.

  • Ooh, scary evil.

  • And then, um, in show, and then we show it.

  • So that's that code there.

  • And then I've actually already got it running here.

  • It looks like I've hit some keys.

  • Let's just see if the two works.

  • So because sometimes there is no number.

  • The regular expression doesn't find anything with two brackets.

  • Sometimes it takes a really long time.

  • So one of the numbers I found that's really slow, isn't nine.

  • Ah, to, however, appears to be very, very quick.

  • So nice.

  • Uh, let's do our No.

  • Four.

  • At least the 1st 1 was successful.

  • Eventually, we're gonna find one.

  • That is a mistake.

  • It does make mistakes that draws some weird things.

  • Sometimes that's just it's a generative model.

  • That's what it's gonna do.

  • Ah, the training window.

  • I guess I should probably mention what we did while this for is actually taken awhile.

  • Um, basically, I trained this This was a sequence length of 800 it was a 1 28 by three.

  • Um whoa.

  • I've never seen this air before.

  • Image data can't convert float, huh?

  • I wonder I wonder what was there.

  • I wish I output what?

  • That waas.

  • Unless that was it above it.

  • Nine.

  • No.

  • Yeah, that was it.

  • Shoot.

  • I wonder what didn't convert.

  • It looked like it was actually gonna draw us the number.

  • What a bummer.

  • Something was wrong, though.

  • Maybe it didn't.

  • I don't know.

  • I don't know what would have caused that.

  • To be honest, it looked like it was about right.

  • I wish we could have had more, more of a window there.

  • Anyway, let's see if it can draw.

  • So for this time apparently affords a really challenging number.

  • Maybe I should go.

  • There goes your paws.

  • All right.

  • So, um yes.

  • So the four works.

  • Awesome.

  • Um, you get the idea.

  • I could draw a 1,000,000,000 other numbers, but I don't think I'm going to sew from here.

  • There's a few things we could do.

  • One is I could continue training this model.

  • I could also go further with, um m nus data.

  • So for example, there's e m nist, which is actually all numbers and then all letters upper and lower case, eh?

  • So we could do something like that.

  • We could also just taking a little further.

  • I was kind of thinking of doing something with imagery.

  • So the first thing that came to my mind was like the cat servers dogs.

  • So tell it, draw me a cat, and then it just draws a cat.

  • I think that's gonna be ultimately probably too challenging.

  • I'm gonna kind of play around with pictures of cats and see if I threshold them and decrease their size significantly.

  • If we can come to some sort of like a 28 by 20 eights, probably too small after a threshold to really notice that something is a cat or a dog.

  • Um, but something maybe a 50 by 50 which is, you know, quite a bit larger, but yes.

  • Oh, so I'm still trying to figure out what I want to do.

  • There is for us continuing on with this because this appears to me to be relatively solved, where you can have it draw you a unique number and all that.

  • So, anyways, that's pretty interesting to me.

  • Like I said, I think it's pretty cool, cause it's like, always a new and unique number that it draws, which is just interesting, Um, to me.

  • So anyways, um, I think that's it for now.

  • And I'll probably the next video.

  • We'll probably have to wait a little bit because I'm going to let that other model train and finish and see if we can get the classifications generator to work as well.

  • So using a generative model to do classification, uh, is still kind of interesting to me.

  • So anyways, that's gonna be it for now.

  • If you've got questions, comments, concerns, whatever feel for you, leave them below.

  • Otherwise I will see you in another video.

What's going on?

字幕と単語

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

A2 初級

生成モデルを用いたリクエストによる数字の描画 -型破りなニューラルネットワーク p.6 (Drawing a Number by Request with Generative Model - Unconventional Neural Networks p.6)

  • 0 0
    林宜悉 に公開 2021 年 01 月 14 日
動画の中の単語