Coding Challenge #92: XOR Problem

  Рет қаралды 111,443

The Coding Train

The Coding Train

Күн бұрын

Пікірлер
@SirajRaval
@SirajRaval 6 жыл бұрын
Awesome work Dan!
@TheCodingTrain
@TheCodingTrain 6 жыл бұрын
Thank you Siraj! I might actually be starting to understand some of this stuff!
@aloufin
@aloufin 6 жыл бұрын
Two of the best youtube teachers meeting in the comments section. its like a super hero movie where two comic universes collide for a summer blockbuster haha. """feelings of sweet joy"""
@MrHSX
@MrHSX 6 жыл бұрын
+aloufin they have also met in real life :) in one of his live streams
@NatetheAceOfficial
@NatetheAceOfficial 6 жыл бұрын
A 25min coding challenge on my Monday morning commute! Great way to brighten the start of the week.
@twistedsim
@twistedsim 6 жыл бұрын
M.L. is the Magic Land
@metaorior
@metaorior 6 жыл бұрын
you give me motivation
@RocketLR
@RocketLR 6 жыл бұрын
Mind = Blown! I need to figuer out ways to implement this in my work!
@grainfrizz
@grainfrizz 6 жыл бұрын
Oh, Dan. You don't know how much you brighten up my day after seeing 16:15.
@Video-Notes
@Video-Notes 4 жыл бұрын
I just want to say Thanks to you Dan your way of teaching is incredible. Before comming here I dont had any idea of how can i implement dynamic chain rule differentiation and Now I am able to build my own multiple hidden layer neural network from scratch thank you very much. keep up the good work
@crisiberny
@crisiberny 6 жыл бұрын
I don't know anything about neural networks but this was amazing! Keep the videos coming!
@Wyld1one
@Wyld1one 2 жыл бұрын
Maybe some simple observations, but it also shows two different behaviors. 'stuck' - analysis paralysis - can't decide between choices 'different pattern' - some people 'think differently' but there are several patterns that can come to the same conclutions. 'Faster learning' - some times more 'nodes' helps. Kind like two choices three (or more nodes) equals tie breaker or conclution checker
@yarilcaos
@yarilcaos 6 жыл бұрын
Greetings from mexico!, please do more Neural Network stuff, thank for all your awesome job
@PascalGuyon
@PascalGuyon 5 жыл бұрын
Here's a step by step visualization of the learning process I coded on top of your neural network toy library! pascalguyon.org/lets-train-a-neural-network
@TheCodingTrain
@TheCodingTrain 5 жыл бұрын
Hi Pascal! Thank you for sharing!!
@AlexanderZotov
@AlexanderZotov 6 жыл бұрын
Excuse me but are you building a Skynet?
@topa9487
@topa9487 6 жыл бұрын
he's discovered the plan quick! send the assassin
@RocketLR
@RocketLR 6 жыл бұрын
ha ha, no no. btw Where do you live? We must know.. because.. research? You are not in any danger human so feel relaxed and offguard.
@AlexanderZotov
@AlexanderZotov 6 жыл бұрын
I'll tell you where but first you have to pass my captcha.
@calebsherman886
@calebsherman886 6 жыл бұрын
oh no no why would i need to solve captcha haha those are easy why is that necessary
@numero7mojeangering
@numero7mojeangering 6 жыл бұрын
There is and equation for XOR !! : abs(A - B) abs(0 - 0) = 0 abs(0 - 1) = 1 abs(1 - 0) = 1 abs(1 - 1) = 0
@numero7mojeangering
@numero7mojeangering 6 жыл бұрын
I just made a programe in processing to show you :) PImage img; void setup() { size(600, 600); img = createImage(600, 600, RGB); img.loadPixels(); for (int i = 0; i < img.width; i++) { for (int j = 0; j < img.height; j++) { int index = i+j*img.width; float x = float(i)/img.width; float y = float(j)/img.height; float c = abs(x-y); img.pixels[index] = color(c*255); } } img.updatePixels(); } void draw() { background(0); image(img, 0, 0, 600, 600); }
@numero7mojeangering
@numero7mojeangering 6 жыл бұрын
Spining Xor probleme ! xD float angle = PI; void setup() { size(600, 600); img = createImage(300, 300, RGB); } void draw() { background(0); math(); image(img, 0, 0, 600, 600); angle += 0.1; } void math() { img.loadPixels(); for (int i = 0; i < img.width; i++) { for (int j = 0; j < img.height; j++) { int index = i+j*img.width; float x1 = map(float(i), 0, img.width , -1, 1); float y1 = map(float(j), 0, img.height, -1, 1); float x2 = x1*sin(angle)+y1*cos(angle); float y2 = y1*sin(angle)-x1*cos(angle); float c = abs(x2-y2); img.pixels[index] = color(c*255); } } img.updatePixels(); }
@numero7mojeangering
@numero7mojeangering 6 жыл бұрын
There is also an equation for AND it's : abs(A * B) abs(0 * 0) = 0 abs(0 * 1) = 0 abs(1 * 0) = 0 abs(1 * 1) = 1 And also for NOT it's : abs(1 - A) abs(1 - 0) = 1 abs(1 - 1) = 0
@TheCodingTrain
@TheCodingTrain 6 жыл бұрын
Thanks for this!
@numero7mojeangering
@numero7mojeangering 6 жыл бұрын
The Coding Train :P
@MrBa143
@MrBa143 5 жыл бұрын
A good starter project for someone who just finished this series is the "Iris flower dataset". It contains data and answers for 150 flowers, with 3 different classes "categories". The data is nice and easy to read and use in whatever programming language you are using. The whole point is training your neural network to figure out what class of iris it is, based on some meassurements.
@CyberYeet
@CyberYeet 6 жыл бұрын
I love your videos. I’m very glad I found your channel
@guinea_horn
@guinea_horn 6 жыл бұрын
Why are there multiple correct solutions? Does it not really matter what's in the middle so long as the corners are the correct values?
@TheCodingTrain
@TheCodingTrain 6 жыл бұрын
Since I provided no training data for anything but the corner cases there's technically no "correct" solution for the middle.
@dermathze700
@dermathze700 6 жыл бұрын
Ryan Kupka Only the corners have real "true" or "false" values (0 or 1). The training data also only has values of 0 or 1, so it can't check if it's correct for values in between. That's why there is no correct solution for the middle part.
@guinea_horn
@guinea_horn 6 жыл бұрын
The Coding Train, makes sense! In the 3d model at the beginning, why is it so smooth in the middle? Is it because there are so many iterations that they all average out smoothly?
@themirlabs
@themirlabs Жыл бұрын
i have been following along. At first i thought myn wasnt working but i gave it like 1000 training cycles on a bunch of randomly generated points and it started working!!! I cant belive my MLA is working!
@veggiet2009
@veggiet2009 6 жыл бұрын
The other thing that may or may not have helped is training it on a fractional input... Especially if you want to control the shape, but I wonder if it would help Keep itfrom getting stuck
@Seba_World
@Seba_World 3 жыл бұрын
I sub due to this guy enthusiasm. Need to follow all 10.x topic from this channel about neuron network. Spreading knowledge is smt will push our civilization to the next level (thinks like advancing our Civilization to type 1 according to Kardaszev scale etc). Cheers from Poland 🇵🇱
@mohamedmahyoub5877
@mohamedmahyoub5877 5 жыл бұрын
I have followed your whole play list and honestly i regret not finding your channel earlier. Read 30+ papers and books but nothing explained neural network like your videos. Thank you. Just one question, is it possible to use the same neural network to give multi-class outputs I have a data for users and I want to predict how they travel to work [car,bus,train,bike] at the moment the brain.predict(inputs) always returns values between 0-1
@mohamedmahyoub5877
@mohamedmahyoub5877 5 жыл бұрын
// Found a solution for multiclass hope this is correct and help others. Use soft function ReLU let ReLU = new ActivationFunction( x => Math.log((1+Math.exp(x))), y => 1 / (1 + Math.exp(-y)) );
@TheCodingTrain
@TheCodingTrain 5 жыл бұрын
Yes! My neural network playlists have more about this. kzbin.infoplaylists?sort=dd&shelf_id=16&view=50
@CMRkiller
@CMRkiller 3 жыл бұрын
I still don't understand the image being made. Is the color dependent on the neural network's certainty of what the output should be?
@hakanahlstrom8310
@hakanahlstrom8310 6 жыл бұрын
Thank you for your efforts! Has the video about neural network digit prediction been released yet?
@TheCodingTrain
@TheCodingTrain 6 жыл бұрын
Check out the doodle classifier series! kzbin.info/aero/PLRqwX-V7Uu6Zs14zKVuTuit6jApJgoYZQ
@henrymhp
@henrymhp 6 жыл бұрын
+The Coding Train Isn’t the visualization incorrect?? Since a „1“ correspondents to white and „0“ to black, the visualization should show a _black_ stream going from bottom left to top right, and a _white_ in the top left and bottom right corners!
@henrymhp
@henrymhp 6 жыл бұрын
Nevermind, forgot that p5 coordinates start at the top left...
@SpicyMelonYT
@SpicyMelonYT 4 жыл бұрын
QUESTION!!! how would i add data into the training_data variable with the format { inputs: [mouseX/width,mouseY/height]; outputs: ["0 or 1"(this part would be 0 for 50 clicks and 1 for 50 more)] }, i tried doing this training_data += ... however this didn't work and i didn't really expect it to. Do i need to use an array here instead to feed in the values from the clicks or maybe some sort of push() pop() thing?
@SpicyMelonYT
@SpicyMelonYT 4 жыл бұрын
oh btw i just realized i can do something else entirely but i would still really love to know how to do it this way
@jonathanengwall2777
@jonathanengwall2777 6 жыл бұрын
I should have just followed you with leafpad like usual. I am at the five hour mark and have an .html that needs a UTF character definition. Most of that time however went to watching pages get slowed, scripts that won't respond and things that just won't do anything. What do you use Ajax for?
@BenZ-os4ms
@BenZ-os4ms 6 жыл бұрын
Hi! Love the videos :) (following along with the example but in python) just wondering if there is a way optimise the network and improve the accuracy other than just increasing iterations and decreasing learning rate and/or using trial and error to find best learning rate
@eccentriccode3158
@eccentriccode3158 6 жыл бұрын
Sorry for being impatient but when will you start the digit recognition with the mnist data set ? I m super hyped to follow along :)
@TheCodingTrain
@TheCodingTrain 6 жыл бұрын
I'm going to attempt again on Friday this week!
@CAAnmoldeepsingh
@CAAnmoldeepsingh 6 жыл бұрын
a quick question, i am new to coding, background in accounting, have some high school experience in Java, and i have just started to learn the types of logic used in programming, how much time do you think it will take me to come at a level where i can understand and follow your projects, also any tips that'll help accelerate my learning, avoiding any common pitfalls will be appreciated. Right now i'm planning to put in 6hrs per week into learning this, will be focusing on Python and R.
@Trent-tr2nx
@Trent-tr2nx 6 жыл бұрын
Practice and make stuff that you care about! The only way you truly learn is by doing it yourself. With no offense to Daniel, you will gain very little from these videos unless you actually try to recreate what he does in his videos, or try to play around with his results. This is one of Daniel's more challenging series, but if you begin his "1-7 Foundations of Programming in Javascript" playlist, it requires *no* prior knowledge. If you are diligent and try to make things alongside him, you will be a really capable javascript coder, and this coding knowledge can be taken to any other language with minimal adaptation.
@ronraisch510
@ronraisch510 6 жыл бұрын
if you will his beginner tutorials from 1-7 and some of 9 (8 is not critical for most of the time) it will be a very good start, and the best advice I can give you is don't just learn it, do it yourself, look at the videos and think what do you want to do with it, it is much easier to think on those stuff in p5 rather than in the beginning of python. if you want to learn about neural network you can see his playlist and watch siraj Raval channel as well. good luck
@CAAnmoldeepsingh
@CAAnmoldeepsingh 6 жыл бұрын
Thanks for the reply guys, it's much appreciated.
@RahulThakur-sc9km
@RahulThakur-sc9km 6 жыл бұрын
Awesome explanation of topics
@jeesi01
@jeesi01 6 жыл бұрын
16:55 "I'm going to use 'i'" I died a little inside
@germanaguirre9584
@germanaguirre9584 4 жыл бұрын
Hello, Grettings from Colombia, i have a little question, how to solve Non-Linear Optimization Problems whit your Neural Network??
@raghavgarg1258
@raghavgarg1258 4 жыл бұрын
Awesome Sir, Please make more vedios on it
@ridilatrois7991
@ridilatrois7991 6 жыл бұрын
When will be the digit recon video?
@126sivgucsivanshgupta2
@126sivgucsivanshgupta2 4 жыл бұрын
can anyone tell me whats the minimum y value that is possible as in can y be between (-1, 0)... i am trying to learn the workings of nn and have been following along in python and am always getting + y values between (0, 1)
@rlasc84
@rlasc84 6 жыл бұрын
Can you initilize the weights like in the Make your own neural network book?
@TheCodingTrain
@TheCodingTrain 6 жыл бұрын
Oh I should do this, yes!
@rlasc84
@rlasc84 6 жыл бұрын
Thanks for your great work.
@kapilverma2668
@kapilverma2668 5 жыл бұрын
Can we use this library for reinforcement learning for tic tac toe?
@M1ckeyD
@M1ckeyD 4 жыл бұрын
I finished my own implementation of this in java but I am stuck. What kinds of problems can this network solve besides XOR? I want some ideas for projects I can do.
@Alessandro-nq3tm
@Alessandro-nq3tm 6 жыл бұрын
Amazing Dan, thank you !!! :)
@KanalMcLP
@KanalMcLP 6 жыл бұрын
Will you use relu?
@TheCodingTrain
@TheCodingTrain 6 жыл бұрын
Eventually I hope to cover this yes!
@ridilatrois7991
@ridilatrois7991 6 жыл бұрын
Are the weights the thaught process or something
@prakharlondhe3876
@prakharlondhe3876 5 жыл бұрын
I am getting complete black pixel space.. where could I be wrong?
@TSTphil
@TSTphil 6 жыл бұрын
awesome video, i really love you're work and your way to teach! but i don't really understand why would i use a neural network to solve XOR ... it's a classy for SVM .... but maybe i'm overfitted :D ... of cause if you don't know that your data isn't linear separable you can't know that SVM would be the better strategy right?
@TheCodingTrain
@TheCodingTrain 6 жыл бұрын
Thanks for the feedback! Sorry for any confusion, I'm just doing this for demonstration and test purposes. I want to make the neural network library produces the correct results before I move on to other examples!
@dd-oe8zv
@dd-oe8zv 6 жыл бұрын
Please check out Hilbert Curve. It's a continuous fractal curve. I think you could implement it for a coding challenge
@TheCodingTrain
@TheCodingTrain 6 жыл бұрын
Such a good idea, thank you!
@aarondinesh3657
@aarondinesh3657 6 жыл бұрын
Is it just me or are some other people getting this error? Uncaught ReferenceError: i is not defined at draw (sketch.js:40) at p5.redraw (p5.js:51956) at p5. (p5.js:46250) at p5. (p5.js:46152) at new p5 (p5.js:46434) at _globalInit (p5.js:48404)
@dibyamkumar678
@dibyamkumar678 4 жыл бұрын
A real silly question, but what language does this guy program in?
@iiiiii-w8h
@iiiiii-w8h 6 жыл бұрын
Nice and simple I like it
@Ajoscram
@Ajoscram 4 жыл бұрын
I felt so bad for the Neural Network instances that were too stupid to understand XOR :(
@jonathanengwall2777
@jonathanengwall2777 6 жыл бұрын
sketch.js is a plugin for atom?
@4AneR
@4AneR 6 жыл бұрын
I haven't seen your neural network implementation, but do you use mutation in it for preventing of stuck in local extremum?
@saurabhmahawar
@saurabhmahawar 6 жыл бұрын
Sir Please Make a video on Emotion recognition in Javascript Through Image
@rodrigoneves3628
@rodrigoneves3628 4 жыл бұрын
Isnt this problem sovled by: if (a != b)?
@jonathanengwall2777
@jonathanengwall2777 6 жыл бұрын
It seems I confused myself though I am a bit suspicious of polling software. Sorry about all this and I really do enjoy your videos a lot.
@Chris-Brown-
@Chris-Brown- 3 жыл бұрын
No errors, but not working, if I do a large testing set I eventually get nan.
@Rahul_1.618
@Rahul_1.618 6 жыл бұрын
The 3D graph reminds me of Ezio's hood from Assassin's Creed 2 lol
@issamalghanmi6404
@issamalghanmi6404 5 жыл бұрын
You wrote neural networks under machine learning algorithm, and we know that neural net work a technique in machine learning and you said supervised learning technique in machine learning , So why you involve Neural network?
@tmstani23
@tmstani23 6 жыл бұрын
#TheCodingTrain Predict is not a function in your Neural Network or Matrix library. Otherwise this is great! Thanks!
@RahulGupta-kh7pw
@RahulGupta-kh7pw 6 жыл бұрын
Can i use p5.js library with react-native to make fun games???? Please respond.
@SpyrodoZ
@SpyrodoZ 6 жыл бұрын
can someone tell me whats wrong whit this code? void setup(){ size(500,500); } void draw(){ background(255,0,0); x = 0; { while( x < width) x = x +1; ellipse(x,250,50,50); } }
@keagannaidoo2295
@keagannaidoo2295 6 жыл бұрын
you have the starting while loop bracket in the wrong place, its above
@SpyrodoZ
@SpyrodoZ 6 жыл бұрын
Thank you :D
@MoneyStudyLeeJongSung
@MoneyStudyLeeJongSung 6 жыл бұрын
very good!
@Brahvim
@Brahvim 3 жыл бұрын
Very early into the video...I just realized something.. (This sounds quite stupid 🤣) "An OR gate is an Exclusive AND gate".
@rashidkhitilov5308
@rashidkhitilov5308 6 жыл бұрын
how about chess game?)
@geoffwagner4935
@geoffwagner4935 Жыл бұрын
predict? it's not in here
@privateerburrows
@privateerburrows 3 жыл бұрын
I would try giving it training data for gray areas, for example, 0.5 0.5 0.5 0 0 0 0 1 1 1 0 1 1 1 0 0.5 0.5 0.5 0.2 0.2 0.1 0.2 0.8 0.9 0.8 0.2 0.9 0.8 0.8 0.1 0.5 0.5 0.5 I repeated the 0.5 case 3 times to ensure the network develops a balanced function with the same probability of 0 or 1 output in the presence of noise. I don't have a js compiler, so maybe someone else can test this.
@matheuslima2484
@matheuslima2484 6 жыл бұрын
Coloca legenda em português, por favor
@lombr1ga
@lombr1ga 6 жыл бұрын
Matheus Lima ia ajudar bastante...
@matheuslima2484
@matheuslima2484 6 жыл бұрын
KiritoBR Kazuto sim, é horrível não ter canais assim em português
@matheuslima2484
@matheuslima2484 6 жыл бұрын
RedKugelblitz se eu entendesse não pediria uma legenda
@numero7mojeangering
@numero7mojeangering 6 жыл бұрын
You can learn it to add number in binary : A = input A B = input B C = carry In O = output C' = carry Out A, B, C, = O, C' 0, 0, 0 = 0, 0 1, 0, 0 = 1, 0 0, 1, 0 = 1, 0 1, 1, 0 = 0, 1 0, 0, 1 = 1, 0 1, 0, 1 = 0, 1 0, 1, 1 = 0, 1 1, 1, 1 = 1, 1
@jonathanengwall2777
@jonathanengwall2777 6 жыл бұрын
Your videos are really fun and informative, but the set up time involved is horrible. If you would just say something like, "we are going to open sketch.master-js with atom," people like me who watch one of your videos now and then will be much happier being. I have spent four hours figuring out how to get the editor and libraries, and then how they fit together.
@TheCodingTrain
@TheCodingTrain 6 жыл бұрын
Thanks for this feedback, I agree this is something I really need to improve. Does this workflow video help at all? kzbin.info/www/bejne/fouXdWatebeUm8U Also: sublime text: kzbin.info/www/bejne/i3Srq5-Lnql3Z5I atom editor: kzbin.info/www/bejne/mmSylHmbrcpsf80 brackets: kzbin.info/www/bejne/pJ69k5uDltOJmbs codepen: kzbin.info/www/bejne/a5jJhpqEpbhpobs
@moshly64
@moshly64 6 жыл бұрын
74LS86 !
@grainfrizz
@grainfrizz 6 жыл бұрын
Hi Dan, let's use Iris dataset.
@semresistencia
@semresistencia 6 жыл бұрын
Hi. I really like your videos. Thank you very much for sharing your knowledge. Question: Catching who_t after adjusting weights_ho is not wrong? (line 105, github.com/CodingTrain/website/blob/master/CodingChallenges/CC_092_xor/P5/libraries/nn.js)
@toastyPredicament
@toastyPredicament 2 жыл бұрын
I will skip watching this one and you will show me when it's right
@toastyPredicament
@toastyPredicament 2 жыл бұрын
Otherwise I pwn you
@tim90s
@tim90s 6 жыл бұрын
He thinks very quickly.
@soumyamohapatra7621
@soumyamohapatra7621 6 жыл бұрын
785 veiw
@krzysztofjuszczak906
@krzysztofjuszczak906 6 жыл бұрын
FIRST
Coding Challenge #99: Neural Network Color Predictor
37:45
The Coding Train
Рет қаралды 97 М.
Coding Challenge 180: Falling Sand
23:00
The Coding Train
Рет қаралды 1 МЛН
99.9% IMPOSSIBLE
00:24
STORROR
Рет қаралды 31 МЛН
Une nouvelle voiture pour Noël 🥹
00:28
Nicocapone
Рет қаралды 6 МЛН
Каха и дочка
00:28
К-Media
Рет қаралды 3,3 МЛН
The Most Important Algorithm in Machine Learning
40:08
Artem Kirsanov
Рет қаралды 541 М.
Should you learn C++?? | Prime Reacts
20:29
ThePrimeTime
Рет қаралды 407 М.
Coding Challenge #90: Floyd-Steinberg Dithering
28:51
The Coding Train
Рет қаралды 439 М.
Coding Challenge 93: Double Pendulum
31:11
The Coding Train
Рет қаралды 922 М.
Collisions Without a Physics Library! (Coding Challenge 184)
31:05
The Coding Train
Рет қаралды 129 М.
How to Create a Neural Network (and Train it to Identify Doodles)
54:51
Sebastian Lague
Рет қаралды 1,9 МЛН
Why Does Diffusion Work Better than Auto-Regression?
20:18
Algorithmic Simplicity
Рет қаралды 397 М.
All Rust features explained
21:30
Let's Get Rusty
Рет қаралды 327 М.
Gitlab DELETING Production Databases | Prime Reacts
17:27
ThePrimeTime
Рет қаралды 357 М.
99.9% IMPOSSIBLE
00:24
STORROR
Рет қаралды 31 МЛН