Backpropagation Neural Network - How it Works e.g. Counting

  Рет қаралды 202,632

RimstarOrg

RimstarOrg

Күн бұрын

Пікірлер: 334
@carloschau9310
@carloschau9310 8 жыл бұрын
Love your plain language and explaining with a visual example! Thank you!
@AppliedScience
@AppliedScience 8 жыл бұрын
Great explanation!
@RimstarOrg
@RimstarOrg 8 жыл бұрын
+Applied Science Thanks!
@TheMrRedBeard
@TheMrRedBeard 8 жыл бұрын
I have read up on neural networks quite a few times in the past and had only seen them as trivial things until now. Your video provided that epiphany/eureka moment for me. Thanks!
@Soundole
@Soundole 7 жыл бұрын
Thanks so much for producing this video, this has brought me closer to understanding neural networks than any other resource online!
@MatthewBishop64
@MatthewBishop64 7 жыл бұрын
"Do math with all these numbers" - the secret sauce of neural networks. :)
@pawelsberg
@pawelsberg 8 жыл бұрын
Thank you for showing "bias" neurons. I was struggling to get the same effect by constructing part of the network that will always give "1". But it will only work if you have at least one non zero input. "bias" solution is nicer.
@zinebslam5398
@zinebslam5398 8 жыл бұрын
out of all the videos I ve watched it is the only one that gives such a clear and understandable model! thanks
@abhimanyusingh4281
@abhimanyusingh4281 8 жыл бұрын
Best explanation with simplicity so far
@prabuskleo
@prabuskleo 7 жыл бұрын
out of all, This is a best introductory video for NN. ! Thanks prof. :)
@InnovationBlast
@InnovationBlast 8 жыл бұрын
Wow, my friends recently won first place at our school's research symposium with work on neural networks and machine learning. Thanks for teaching me some more, now I can surprise them with my new knowledge!
@favs5286
@favs5286 8 жыл бұрын
Very informative and student-friendly explanation!
@leskuelbs9558
@leskuelbs9558 8 жыл бұрын
Very cool! your explanation makes me want to play with neural networks again. thanks.
@ahamedimad4554
@ahamedimad4554 8 жыл бұрын
Thanks a lot. This looks exactly what I need for my final year research.
@IHAVE1ARM
@IHAVE1ARM 8 жыл бұрын
Great video for people who are just starting out at Neural Networks.
@IamTheTimBecker
@IamTheTimBecker 8 жыл бұрын
Thanks for the simple, visual explanation!! It was exactly what I was looking for
@raresdavid
@raresdavid 7 жыл бұрын
Wow, this is the best explaination on back propagation I've ever seen. Great job!
@RimstarOrg
@RimstarOrg 7 жыл бұрын
Thanks!
@Erodrigufer
@Erodrigufer 8 жыл бұрын
Thanks a lot for making this video. It was really interesting. I would really like to see a video in which you explain your code in detail :) I think I'm not the only one interested on such a video
@bobsmithy3103
@bobsmithy3103 8 жыл бұрын
i finally understand backpropagation now. thx a ton!
@edwardkwartler2647
@edwardkwartler2647 8 жыл бұрын
Excellent and helpful backprop explanation. thx.
@meowmeowmotherpucker
@meowmeowmotherpucker 7 жыл бұрын
Props where props are due, this is just an excellent example for explaining basic neural network functionality and backpropagation. Thanks a whole lot!
@johnmadden9613
@johnmadden9613 8 жыл бұрын
I *FINALLY* understand backpropagation! Thank you!
@MikePorterII
@MikePorterII 8 жыл бұрын
This was a really great video, and even better the total lucid and cogent explanations. THANK YOU!!!
@ericso836
@ericso836 8 жыл бұрын
very clear and packed full of knowledge yet understandable!
@sethsachin86
@sethsachin86 7 жыл бұрын
very good illustration !
@PraveenJose18551
@PraveenJose18551 8 жыл бұрын
Have you thought about making a "how schileren photography works" video? I think that is topic that is right in your alley.
@IncroyablesExperiences
@IncroyablesExperiences 8 жыл бұрын
Great job !
@svsujeet
@svsujeet 8 жыл бұрын
Beautiful. Thanks for the effort.
@NaimaZakaria
@NaimaZakaria 8 жыл бұрын
I love your videos! Please make more on Neutral net and general AI topics. Like what the heck is the difference between all the different frameworks?
@RimstarOrg
@RimstarOrg 8 жыл бұрын
Thanks! I was thinking of doing just that, a comparison about all the different types of neural networks and sample applications.
@NaimaZakaria
@NaimaZakaria 8 жыл бұрын
looking forward to it :)
@karnkraftverk
@karnkraftverk 7 жыл бұрын
Great explanation, I think I understand the basics of it now!
@electronicsNmore
@electronicsNmore 8 жыл бұрын
Excellent video, and excellent animations!
@RimstarOrg
@RimstarOrg 8 жыл бұрын
+electronicsNmore Thanks!
@StoneFlange
@StoneFlange 8 жыл бұрын
Well done, sir :) thanks for the video and explanation! I'm thinking about how I can use this already haha
@carlosgil2691
@carlosgil2691 8 жыл бұрын
Very clear and concise. Thank you!
@mohammadmaniat1040
@mohammadmaniat1040 8 жыл бұрын
thanks for the explanation about ANN
@DkMark-pu8hi
@DkMark-pu8hi 8 жыл бұрын
Great explanation. My teacher's poorly explanation confused everyone in the class.
@malgailany
@malgailany 8 жыл бұрын
Impressive video, Thanks.
@hiphopobenzema
@hiphopobenzema 8 жыл бұрын
Thank you for explaining this! I always wondered how machine learning worked at the base level.
@RimstarOrg
@RimstarOrg 8 жыл бұрын
+hiphopobenzema You're welcome! This is just one type of machine learning, but it's a very flexible one. I've used this same neural network code, just with a different user interface, to do fairly decent character recognition. Sadly it was for a no longer existent GUI, otherwise I would have shown that one too.
@USWaterRockets
@USWaterRockets 8 жыл бұрын
+RimstarOrg What GUI would that be? There are not that many to guess from.
@RimstarOrg
@RimstarOrg 8 жыл бұрын
+USWaterRockets QNX Windows running on the QNX OS. I bet you didn't guess that one! :) I don't think I ever ported it to Photon under QNX, but nowadays QNX seems more focused on GTK and HTML5 for GUIs and I might try it with one of those. I guess I could train it under GTK but also have the trained network on HTML5 for people to try out (I used to be involved with the still awesome QNX OS in various capacities.)
@USWaterRockets
@USWaterRockets 8 жыл бұрын
No, that was not on my short list. Pretty cool!
@gimpau
@gimpau 7 жыл бұрын
Thanks, it's all much clearer now.
@megamef
@megamef 8 жыл бұрын
How are so knowledgeable on such a wide range of subjects?
@RimstarOrg
@RimstarOrg 8 жыл бұрын
+Stephen Methuen Probably not as many subjects as I'd like :), but for what I do know, it's probably because I let my curiosity carry me away.
@boningli7158
@boningli7158 7 жыл бұрын
best one i ever seen, so easy to understand
@realxvrw
@realxvrw 8 жыл бұрын
This tutorial is awesome
@BiranchiNarayanNayak
@BiranchiNarayanNayak 7 жыл бұрын
Excellent tutorial on NN
@niazalikahn5845
@niazalikahn5845 7 жыл бұрын
This video is very help full i got lots of information from this video thank you soo much.
@melvin6228
@melvin6228 5 жыл бұрын
I code in vim! I code in emacs! I code in Wordpad and made a neural net while you were arguing.
@peaceandlove5855
@peaceandlove5855 5 жыл бұрын
In 6 minutes !!. Stop it and don't waste my brain neurals
@nawkwan
@nawkwan 8 жыл бұрын
Hi Steve, thanks for providing us with an overview of how backpropagation works. I understood most of what you presented in the video. Can you explain how the activation function works because that's really where the magic is? While I am new (no prior knowledge) to this topic, this "activation function" appears to serve as a function that normalizes the output values, which are compared to the expected values of the training set.
@minecraftermad
@minecraftermad 7 жыл бұрын
ALL I WANT IS THE MATH IN DETAIL
@jenneh8821
@jenneh8821 6 жыл бұрын
This was very succinct and super helpful! Thanks again!!!
@thebeststooge
@thebeststooge 8 жыл бұрын
Just here having my brain melt with all of this.
@RimstarOrg
@RimstarOrg 8 жыл бұрын
+Dark Alchemist You mean... having your neural networks melt with all of this. :)
@thebeststooge
@thebeststooge 8 жыл бұрын
RimstarOrg Precisely, LOL.
@dfortaeGameReviews
@dfortaeGameReviews 7 жыл бұрын
Nice job. Thanks for sharing!
@GregPerry
@GregPerry 7 жыл бұрын
Artfully done, kudos RimstarOrg.
@arielrisso9632
@arielrisso9632 8 жыл бұрын
Hi, I understand the BIAS like a one dimension more, but is necesary the BIAS neuron to balance the network? why one bias? why no 2, 4, 5, or 1000 bias?
@RimstarOrg
@RimstarOrg 8 жыл бұрын
The use of bias unit is really just a programming trick to make the code simpler. Originally each of the hidden and output units would have a threshold value that would determine if the unit would fire i.e. whether or not you'd do calculations in the next layer based on that unit. To simplify the code, bias units were created that did much the same job. So you still need a threshold of some kind. If you have only one value for the bias then you need only one bias unit. In the example in this video the bias is 1 for all hidden and output units and so only one bias unit is needed. Maybe there are cases where you'd need different bias values for different layers, in which case you'd have a different bias unit for each layer.
@nikkinishant
@nikkinishant 7 жыл бұрын
Hi , I wanted to know how do we select the activation function by seeing the independent variables?. I used SPSS for buidling NN and it either selects logit or tanh? Please help
@nickoutram6939
@nickoutram6939 8 жыл бұрын
This is a good simple start about how a neural network can derive its outputs from a set of weights and functions but I would like to have seen a little more about how the error between what is expected and what is output is 'propagated back' through the network and impacts the weights. Especially wrt how it goes back from the hidden layer that is not itself an output (what is the delta of expected vs actual for a hidden neuron?) As things stand I have to wade through code without really understanding the principle. So its almost perfect but missing an extra minute or two IMO. Anyway, thanks for posting!
@RimstarOrg
@RimstarOrg 8 жыл бұрын
I think making that clear is over a minute or two. But yeah, I agree I should go into that in more detail. There's a lot of interesting stuff there.
@parnabsanyal5750
@parnabsanyal5750 8 жыл бұрын
very clean...
@sunebrian1423
@sunebrian1423 6 жыл бұрын
I suggest you add the library to the code. The gcc compile have error without the time library. BTW good tutorial, thanks
@RimstarOrg
@RimstarOrg 6 жыл бұрын
Thanks. I don't see anything which would require it and I'm not getting any errors. Which file is it having a problem with, backprop.c or testcounting.c? Do you have the error line?
@sunebrian1423
@sunebrian1423 6 жыл бұрын
$ gcc -c backprop.c backprop.c: In function 'bkp_create_network': backprop.c:65:25: warning: implicit declaration of function 'time' [-Wimplicit-function-declaration] srand((unsigned int) time(NULL));
@RimstarOrg
@RimstarOrg 6 жыл бұрын
Oh! I totally forgot about that. I scanned the code looking for things like sleep() and delay() thinking that there was no reason I would have used them. Thanks. I'll fix it.
@user-ed7gm7ol8k
@user-ed7gm7ol8k 8 жыл бұрын
great video
@nikodembartnik
@nikodembartnik 8 жыл бұрын
Amazing explanation, but I can't understand one thing. I already wrote all stuff in c# but I stop on the back propagation. I calculate the errror for outputs and what's next? How to calculate errors for next weights (beetween input and hidden layers)? From where should I know, what the value should be in this place? This is the last thing to get it work :( Anybody can help? Thanks
@RimstarOrg
@RimstarOrg 8 жыл бұрын
Maybe someone else can try but that's too much for me to explain in a comment and too much for a video (which is why I didn't.) All I can suggest is to download the code library from rimstar.org/science_electronics_projects/backpropagation_neural_network_software_3_layer.htm (part way down on the page) and look at the backprop.c file. The bkp_learn() function has the top level part of the learning code. It's in C though. I don't know how close that is to C#. There's also neuralnetworksanddeeplearning.com/chap2.html
@nikodembartnik
@nikodembartnik 8 жыл бұрын
Thanks for answer, I will check it out
@GaryWee111
@GaryWee111 8 жыл бұрын
Thank you for your video!
@Pompiduskus
@Pompiduskus 7 жыл бұрын
Thank you! This is awesome
@VVe11erMichae1
@VVe11erMichae1 8 жыл бұрын
Thanks for the video, it has really helped me understand Backpropagation especially with the simplicity of the counting example. I wonder how this could be used in a deep learning context?
@RimstarOrg
@RimstarOrg 8 жыл бұрын
Deep learning neural networks use the same basic approach but with more layers and slightly different training. They usually also connect some of the layers a little differently in something called a convolutional layer in addition to a few other connection approaches depending on what they want to do with it. Training is sometimes done with two layers at a time initially. For example, for an image recognition deep learning network they might initially train the network two layers at a time with a huge amount of sample data for many iterations. That gives the network basic understanding of image structure (edges, basic shapes, ...). Then they do backpropagation training with they particular images containing the objects they care about, but this time training all layers at the same time like in this video.
@TehFingergunz
@TehFingergunz 7 жыл бұрын
This video is very helpful! Thank you!
@yulianloaiza
@yulianloaiza 6 жыл бұрын
Thank you !! Very clear and understandable
@otomik1
@otomik1 8 жыл бұрын
Beautiful! Can you recommend any sources for further reading about neural networks?
@RimstarOrg
@RimstarOrg 8 жыл бұрын
+Veseyron Thanks! I've been enjoying this online book lately neuralnetworksanddeeplearning.com/chap1.html. If anyone else has suggestions I'd love to hear them.
@TheKobeyaoming01
@TheKobeyaoming01 7 жыл бұрын
wow..this is so GREAAAAAATTT... I take a course in Machine Learning..This is make me more clear for what I do wow..Just wow
@lucamatteobarbieri2493
@lucamatteobarbieri2493 8 жыл бұрын
Very nice!
@Vikasthale
@Vikasthale 8 жыл бұрын
That was useful...!!!thanks for the video..
@houdalmayahi3538
@houdalmayahi3538 5 жыл бұрын
This is a good explanation. Thanks mate!
@krellin
@krellin 8 жыл бұрын
Thank you for the effort this is so far one of the best intros to neural networks i've seen. I wonder if it would be easy to convert this code to java? i'm no C programmer but as far as i know only .c and .h files are the actual sources right?
@RimstarOrg
@RimstarOrg 8 жыл бұрын
Thanks. I've converted comparable C code to java before and based on that, it should be doable. Keep in mind though that since java is an interpreted language (as far as I know, I haven't done a lot of java) it will run slower. And yes, everything's in the .c and .h files. The Makefile just defines how it all goes together and how to build it.
@krellin
@krellin 8 жыл бұрын
Its not interpreted ;) if one has knowledge of L caches and generally how low level of things work then he can produce java code that will be jit compiled to very efficient assembly that will take advantage of all the special cpu instructions, caches etc... So i dont worry about performance, right now i'm trying to compensate my forgotten math knowledge with some practical piece of code.
@krellin
@krellin 8 жыл бұрын
I'm not saying that it will be faster than fine tuned awesome C libraries, but it definitely will outperform R or Python...
@Amacio
@Amacio 8 жыл бұрын
Hey mate, maybe you should check this site: neuroph.sourceforge.net/ They already have a lot of stuff for neural networks in java.
@krellin
@krellin 8 жыл бұрын
thanks
@BGBTech
@BGBTech 8 жыл бұрын
I personally haven't had many interesting results with NN's, but granted generally I had tried doing them with larger cube-shaped networks and typically fixed-point math. it seems like one needs a fairly big net to have much hope of it doing anything useful with an image (such as try to recognize an object in the picture), but then one runs into needing to make it fast enough to evaluate everything at a decent framerate (goal being to try to make it operate in some semblance of real-time, and on reasonably modest hardware, such as reasonably cheap ARM SoC's). getting it both fast enough, and getting useful output, have thus far remained elusive. have had more interesting results with genetic algorithms and genetic programming though, though still with relatively few "actually useful" results. had ok results using GA's to tune parameters for a video codec, if even then it doesn't turn it exactly as I would want it, which requires lots of fiddly with the code to evaluate how "good" the results are. have sort of an issue that it tunes it for "numbers look pretty good but output quality looks kind of like crap". for GP type stuff, I have generally had the best results with doing simplistic ISA'a, typically using fixed-width instructions, word-oriented memory, and "memory mapping" all the inputs and outputs. the advantage of this is, at least theoretically, if it finds something "good" you can convert it into a more efficient native-code program. IME, reg/mem ISA's seem to work better for this than stack-machine ISA's. for most "actually useful" tasks (in a computer vision sense), have had better results writing code to do stuff more directly (using similar strategies to those used in some of my video codecs). a lot of it is simple things, like finding the average and ranges (standard deviation) for blocks of pixels, allowing skipping more expensive (per pixel) checks in the majority of cases. have gotten things like basic spatial perception working (via stereo inference), but tasks like object recognition are a fair bit harder.
@RimstarOrg
@RimstarOrg 8 жыл бұрын
+Brendan Bohannon Interesting path you've been on. I originally wanted to go down a similar path around 20 years ago but got sidetracked. I hadn't run across ISAs before. I'll read up.
@BGBTech
@BGBTech 8 жыл бұрын
RimstarOrg I am not sure how common it is to do it this way (this isn't really a serious sub-project, just idle fiddly thus far). basically, I do something along similar lines to a fairly small/simplistic microcontroller or DSP, and essentially have the genetic algorithms work on what would be the ROM image (generally, ROM space may be around several k-words). my designs typically use word-oriented designs, with a word-oriented ISA (with 16 or 32 bit instructions). sometimes, vector instructions (ex: SIMD) or use-case specific built-in features may be included, such as dealing with 4x4 pixel blocks (typically color-cell technology), which may partially overlap with the SIMD ops. sometimes accommodations are made, like using gray-coding on the instructions, or allowing call/return by label IDs rather than by address (typically ROM addresses don't survive mutation/breeding all that well). I have wondered some about the possibility of adding some NN capabilities to these, with possibly memory-mapped NN IO and a "neuro-ROM" section or similar (probably with 128 or 256 bit neurons or similar), this needing to cooperate somehow with the main ROM. for simulation, behaviors are evaluated, typically working on a points system, with some events having strong penalties (such as crashing the virtual CPU, ...). generally best scores win. the specifics of the simulation depend a bit on the task, anything from sequential evaluation, to running a largish number of virtual agents simultaneously. the goal of such a thing would be to hopefully get something on par with insects, or at least compete well with traditional finite-state-machine AIs. results typically fall short of real-world insect-like skills (not usually that good at responding to surroundings, displaying survival skills, and often better at finding weird/undesirable ways of gaming the simulation, ...). relatively few of these tests have given them 3D rendered visual inputs though, mostly due to the costs of 3D rendering the view for a largish number of virtual agents (as a result, most of these tests have been 2D with top-down sensory perception). as noted before, generally sensory-input is memory mapped, with a small part of the IO space for movement outputs and other things. nothing thus far has really given particularly noteworthy results though. or such...
@ai2221
@ai2221 7 жыл бұрын
Hello Sir, How does back propagation algorithm works with Multilayer feed Forward Neural Network in terms of Recognizing the Image leaf?
@RimstarOrg
@RimstarOrg 7 жыл бұрын
You should look for a convolutional neural network instead. The reason is that a leaf can be in any orientation and at any location in the image and a simple neural network like the one in this video doesn't handle that well. That's why convolutional neural networks were invented. So for images of leafs I'd treat the input units as a rectangular array of pixels. For example, for a 128x128 image, the first row of the image would be input units 0 to 127, the second row of the image would be input units 128 to 255, and so on. If all you're looking for it whether the image is a leaf or not then I'd have two outputs, one for yes and one for no. You might have to train it with things that aren't leafs too.In any case, the neural network in this video is a Multilayer Feed Forward Neutral Network. It might not seem like it because I take the outputs and feed them back to the inputs for one demonstration. But if you're just looking for the next highest binary number, then it's just feed forward.
@freesoul2677
@freesoul2677 7 жыл бұрын
Amazing ! Thank you.
@haroldsu
@haroldsu 7 жыл бұрын
awesome , and Thank you!
@deslomeslager
@deslomeslager 8 жыл бұрын
Roughly 20 years ago I applied the backprop NN to train it with real stock values. Of course with the idea to try and guess the next value. Will the stock rise or go down? Of course there is science behind the NN, and although it could fairly well predict the new stock value, it could not beat a fairly simple rule of thumb. If the value goes up, then anticipate it will go up next day as well. And same for going down. (But if it stays the same that rule of thumb is wrong of course). Training bits and bytes with a known outcome (and a fixed one) is fairly good to do.
@RimstarOrg
@RimstarOrg 8 жыл бұрын
+deslomeslager I gave this same backprop NN code to w friend of mine around 10 years ago who wanted to do the same with the TSX (Toronto Stock Exchange.) He had some sort of subscription that gave him download access to all the historical data. I don't think he ever went far with it though.
@Gary1q2
@Gary1q2 7 жыл бұрын
awesome visuals and well said, everything was explained well except for the how the backpropagation formula worked :'(
@RimstarOrg
@RimstarOrg 7 жыл бұрын
The thing is, there is no one backpropagation formula. Backpropagation is the act of figuring out your error and then propagation back through the network, adjusting the weights using any of a number of different algorithms (e.g. en.wikipedia.org/wiki/Stochastic_gradient_descent#Extensions_and_variants).
@Gary1q2
@Gary1q2 7 жыл бұрын
OHHHHHHH THANKS RIMSTAR
@zy2870
@zy2870 6 жыл бұрын
Would like to hear more about how you set up the hidden layer!
@yummytums6882
@yummytums6882 5 жыл бұрын
Probably it was arbitrary, honestly. You can use any number of 'units' (or nodes, as I like to call them) to train it. You could also have as many hidden layers as you want--he only used one. More nodes presumably make it learn faster, but this comes at a cost of having the network slower and is really not guaranteed to actually have substantial effects.
@vivekchand19
@vivekchand19 7 жыл бұрын
very helpful. thanks a lot!
@ulob
@ulob 7 жыл бұрын
What if you used two hidden layers? Would it learn faster or slower? Also, does it always converge to similar weights when you train with different random seed? Can it fail to learn for some random seed or is it guaranteed to work?
@armouredheart5389
@armouredheart5389 7 жыл бұрын
The hidden layer is actually an arbitrary number of hidden layers, unless hardcoded that is. The more layers, the more operations have to be performed to train it. However I would wager that there is a sweet spot that has the optimum number of layers that lets it learn fast without being slowed down by hardware limitations. Disclaimer; I am still learning so I may be wrong.
@MrSatyavinay
@MrSatyavinay 7 жыл бұрын
Great, got some rough idea on how backpropagation works :D
@Murderface666
@Murderface666 7 жыл бұрын
I see a lot of videos about using this to train programs to do something, but nobody is really going into detail on the process of how to really use the network to perform a task. For example, if I wanted to use it to train a pixel to navigate a maze with street lights to stop on red, slow on yellow and go on green (travelling in a straight line), I wouldn't know where to begin to implement such behavior even after studying various implementations of neural network examples.
@RimstarOrg
@RimstarOrg 7 жыл бұрын
One way to do it is to have the inputs be the low resolution input from a camera and the output would be five neurons, for example: stop, forward, backward, left, right. Those outputs would be commands for the robot's motors. You'd train it by first using a remote control to control the robot as you drive it through the maze. Do it many times. As you do that, you'd record what the camera sees and what you told the motors to do. That creates your training dataset, just like the one I talk about in this video. Then you'd train the neural network using that training dataset. Once it's trained, you'd then bypass the remote control and have the robot use the neural network instead to make its decisions. That's how these ones do it hackaday.com/2017/06/06/self-driving-rc-cars-with-tensorflow-raspberry-pi-or-macbook-onboard/. This is called supervised learning since you train it using a dataset containing inputs and expected outputs.
@rylaczero3740
@rylaczero3740 7 жыл бұрын
Partisan Black read the deep learning book, bro
@dansierra2222
@dansierra2222 7 жыл бұрын
so im at my first year of computer science yet i have been coding for 2 years before ,is this too advacnced for me ? i am really interested
@RimstarOrg
@RimstarOrg 7 жыл бұрын
The programming side of it shouldn't be too advanced. The math side may or may not be depending on how deep you want to go. Most people these days just use the libraries/frameworks instead of writing their own from scratch so there's less math involved.
@erikm9768
@erikm9768 8 жыл бұрын
Great video!!!
@FSXgta
@FSXgta 8 жыл бұрын
I reccomend you check out Sethbling he used this technique to make mario learn to play and complete levels
@veluart
@veluart 7 жыл бұрын
I'm using codeblocks to run your program. When I build it, it creates only the object file, not the executable file. Please help me how to run it?
@RimstarOrg
@RimstarOrg 7 жыл бұрын
Are you getting any error messages? What OS are you using? I can only vouch for the latest version of codeblocks, 16.01. You should be able to go the the Build menu and choose Run. A command line window should pop up with the program already running in it (at least that's what happens in Windows Vista). If that doesn't happen, and you didn't get any errors, then bring up a command line window of some sort (depends on your OS) and go to the testcounting folder/directory. Under there go to the bin folder and then the Release folder. The executable should be there. At a command line you should be able to just type the executable name and it will run. If you're running linux, the current directory may not be in your path, in which case you would have to type ./testcounting to run it.
@veluart
@veluart 7 жыл бұрын
I got it and it's working perfectly :-) If possible can you send me the java or python program for the same?
@RimstarOrg
@RimstarOrg 7 жыл бұрын
Glad to hear it! What was the problem, in case it'll help me help others in the future? Funny that you should ask for a python version. I'm working on a python version using tensorflow (Google's neural network framework, www.tensorflow.org/) as part of learning tensorflow. But I don't currently have any plans for doing straight-up java or python versions.
@dkkoala1
@dkkoala1 8 жыл бұрын
one question; you input the bias value into the activation function as an "x" value (if we say that the activation function looks like y = ax+b) but shouldn't it be used as the b value and therefor added on afterwards? The reason i ask is that i understood the bias as an adjustment value ment to move the function on the x axis. Can it be used for that or is it only used as an adjustment of the input into the function?
@RimstarOrg
@RimstarOrg 8 жыл бұрын
I'm keeping the bias as a separate unit with weights in order to simplify the training. One approach is to do it as I suspect you're describing (if I understand you correctly) and just have a bunch of separate b values. Those values would have to be adjusted during training, which is okay. But an equivalent way is to instead create a separate unit, the bias, whose value is 1 and then have weights connecting that bias unit to the hidden and output units. Then during training we adjust those weights, just like we'd adjust all the other weights in the network. It's a trick to simplify the training. Instead of adjusting all the other weights and also the bias values, we just have a bunch of weights to adjust. That's my understanding from where I originally learned all this in Scientific American magazine, Sept 1992, in the "The Amateur Scientist" article and from which I got my original code base. I didn't point it out in the video, or show it in the animations, but I initialize the values of all the weights to a value between -1 and 1.
@RimstarOrg
@RimstarOrg 8 жыл бұрын
As my other reply stated, the way I'm doing the bias is equivalent to what you're expecting. To answer your second question, I've never thought of it as moving the function on the x axis. I guess I look at it more intuitively. The bias is a replacement for the threshold in the old perceptron model. With perceptrons, after all the input values have been multiplied by the weights, we'd next need to make a decision as whether or not the sum total is high enough to fire the neuron (hidden unit). For that, the sum total is compared to a threshold value and if it's greater than the threshold then the neuron fires, otherwise it doesn't (it's output is 0.) The threshold has long since been replaced by the bias. Instead of testing against a threshold, we add on a bias which adds to or subtracts from the sum total moving is closer to or away from 1. To give you a reference, search for the word "bias" here neuralnetworksanddeeplearning.com/chap1.html
@kirandeepsingh9144
@kirandeepsingh9144 8 жыл бұрын
i feel there is any problem in my college internet. all other website are working well there but your given links are not opening. but thanks i have tried it in my phone and there it is opened and worked well. thanks for your instant reply.
@SinanAkkoyun
@SinanAkkoyun 7 жыл бұрын
Ohh this is amazing!!! Can you explain how to code this source code from scratch?
@marinellovragovic1207
@marinellovragovic1207 8 жыл бұрын
When it is possible to teach a neural network to count in binary (something that can be easily executed on a computer), then in theory it is possible to execute programs/applications/games/hell even a whole operating system with a neural network (when it's max error %age is low enough) and be able to run it on a different device (if that device can handle the network to execute).
@marinellovragovic1207
@marinellovragovic1207 8 жыл бұрын
Take Super Mario Bros. for the NES as an example. You've got to have a training set and now it depends: If you wanna have accuracy in output (so glitches may occur too), then you need every possible RAM state the console can have while executing the game (a cycle accurate NES emulator can generate the savestates to train the net on). If you just wanna have the basic concept of the game itself (only everything that was intended to be in the game/so no glitches or bugs) then you can't use every information in RAM (the only useful things would be the remaining lifes, random number generator and maybe the timer so it doesn't need to be taught to interpret numbers). The network can find out the rest through visual input. And this input has to be taken from someone playing the game and showing enough while doing so, so the network has got enough training data.
@marinellovragovic1207
@marinellovragovic1207 8 жыл бұрын
The second training method however seems to be not too convenient as the training data is heavily based on video footage, which does take up too much storage space. And this footage has to be, if possible, raw footage without compression which is even more bigger data to deal with.
@marinellovragovic1207
@marinellovragovic1207 8 жыл бұрын
Then you would most likely focus on the first training method: The neural network itself would be a recurrent one, because the output of a game is frame wise and thus a sequence of data. The result would be an RNN that takes the input of the controller buttons, (and every frame after the first) the current RAM state. The output would be the image of the game (which resolution I'm not sure of right now). Then just implement the ANN where you want to run it and voilà! Some people are maybe thinking, this is just a normal integrated circuit, which it may be if you'd use perceptrons. I'm thinking of using sigmoids to be able to shrink the number of hidden layers you'd need.
@marinellovragovic1207
@marinellovragovic1207 8 жыл бұрын
Then you would most likely focus on the first training method: The neural network itself would be a recurrent one, because the output of a game is frame wise and thus a sequence of data. The result would be an RNN that takes the input of the controller buttons, (and every frame after the first) the current RAM state. The output would be the image of the game (which resolution I'm not sure of right now). Then just implement the ANN where you want to run it and voilà! Some people are maybe thinking, this is just a normal integrated circuit, which it may be if you'd use perceptrons. I'm thinking of using sigmoids to be able to shrink the number of hidden layers you'd need.
@marinellovragovic1207
@marinellovragovic1207 8 жыл бұрын
I'm just thinking of if every possible RAM state is not even bigger than the raw video footage you would need for the second training method, focusing on the concept rather than accuracy... hmmmhhh.......
@ChamuthChamandana
@ChamuthChamandana 7 жыл бұрын
finally understood
@wassollderscheiss33
@wassollderscheiss33 6 жыл бұрын
Nicely done! Maybe I host a channel like this myself when I am old :-p
@robthorn3910
@robthorn3910 8 жыл бұрын
DLd the backprop.zip to my Linux system. Had to add a line to Makefile ALIB = -lm to get it to compile and run. Very nice. This project raises a question regarding 'deep networks': suppose I wanted to build a network where each unit, instead of being a single perceptron, was a ANN like your? In other worlds, stacking this 3-layer design both in depth and height. Any thoughts on how that might work out? Obviously back propagation would have to ripple through the layers, that would be interesting. Or maybe each sub-layer ANN would just be trained separately to detect certain input patterns.
@RimstarOrg
@RimstarOrg 8 жыл бұрын
Thanks. I'll look into adding -lm. I'm not sure about using ALIB though. Isn't that supposed to be for listing .a files? -lm is using the -l option to tell the linker to link in the math library. It sounds like you're looking for something like a convolutional deep network. I've played with them in the 90s but haven't since. Pretty much every deep network these days have convolutional layers in them.
@tigerresearch2665
@tigerresearch2665 7 жыл бұрын
This is not a counter. It's an adder. It adds the number "1" to whatever the input is. If you took books from a shelf and handed them over to your assistant, whose job is to count them and whenever you hand over a book, the assistant would ask you: "How many books have we had so far?", then takes your answer and adds one to it... would you say, your assistant is counting the books for you?
@RimstarOrg
@RimstarOrg 7 жыл бұрын
I hadn't considered it might be an adder rather than a counter, but thinking on it, I'd still call it more of a counter than an adder. What we're doing is giving it a number and asking what comes next. The 111 to 000 case still works for a counter since a rotary counter also wraps around like that (www.surplussales.com/shafthardware/ShaftH-3.html).
@zakeryclarke2482
@zakeryclarke2482 7 жыл бұрын
RimstarOrg counting is adding by 1 why is this an argument 😂
@rylaczero3740
@rylaczero3740 7 жыл бұрын
Really, is the glass half full or half empty
@voidisyinyangvoidisyinyang885
@voidisyinyangvoidisyinyang885 4 жыл бұрын
@@zakeryclarke2482 the machine isn't thinking - ask Sir Roger Penrose. Calculating isn't consciousness. So the machine is learning an output that the human has already set up for the machine to learn. So it's not real learning and thus not really adding. It's calculating.
@waldemarleise7201
@waldemarleise7201 8 жыл бұрын
Thanks for the video. I am quite new to programming and i have an issue with saving the net. What i do is... right befor you: bkp_destroy_network(net); //in the main function i call : if(bkp_savetofile(net, "savedData.txt") == -1) perror("File not saved"); everything runs without any errors but the content of the file is unreadable. Any Tips? Thx again.
@RimstarOrg
@RimstarOrg 8 жыл бұрын
The file isn't in a readable format. However, I just did some testing and realized that before I made this library available I introduced a bug into the bkp_loadfromfile() function so you wouldn't be able to load it back in afterwards anyway. I'll fix this in the next day or two and upload a new version. I'll let you know when it's there.
@RimstarOrg
@RimstarOrg 8 жыл бұрын
Okay. The fixed version is now tested and on the website (rimstar.org/science_electronics_projects/backpropagation_neural_network_software_3_layer.htm). backprop.c changed since that contains the code for the bkp_savetofile() and bkp_loadfromfile() functions. Note that I changed the file format slightly, adding a file type and the neural network type to the beginning of the file to help with backward compatibility in the future. That means if you've saved one now, you'll have to re-save it with the new code to produce a file in the new format. Let me know if that's a problem. backprop.h did not change. I also added examples of loading and saving to testcounting.c (or main.c if you're using the CodeBlocks version), though it's pretty much what you've already done. The documentation on the webpage also explains it more and contains the examples. Thanks for bringing this up.
@waldemarleise7201
@waldemarleise7201 8 жыл бұрын
RimstarOrg awesome. thanks. whoop whoop :)
@daihesham2302
@daihesham2302 6 жыл бұрын
Very helpful, Thank you .
@nand3kudasai
@nand3kudasai 8 жыл бұрын
awesome!!! coding c in wordpad, thats hardcore. nice explanation great video! i loved it. so much work!!! you even made it on javascript. thats really awesome. try uploading it to bitbucket or git
@RimstarOrg
@RimstarOrg 8 жыл бұрын
+Jerónimo Barraco Mármol Thanks! I haven't done anything in a while that was complex enough to need an IDE, or even a debugger. But in helping +André Gasoli in the comments here he made me aware of CodeBlocks and I might become hooked on it for a while.
@nand3kudasai
@nand3kudasai 8 жыл бұрын
RimstarOrg I seriously recommend QtCreator, i love it.
@RimstarOrg
@RimstarOrg 8 жыл бұрын
+Jerónimo Barraco Mármol Thanks. I'll have a look.
@JGunlimited
@JGunlimited 8 жыл бұрын
+RimstarOrg Can I recommend Sublime Text! It's exceptionally exquisite to use.
@RimstarOrg
@RimstarOrg 8 жыл бұрын
+JG Oh, neat. I just watched their demo on their front page. Lot's of cool features there. Loving that preview on the righthand side. Thanks!
@quaerenz
@quaerenz 8 жыл бұрын
thanks!
@kirandeepsingh9144
@kirandeepsingh9144 8 жыл бұрын
your website is not opening.is there any problem
@RimstarOrg
@RimstarOrg 8 жыл бұрын
I just tried all the links in the video description and they all worked. Maybe there was a temporary problem. If it's still happening let me know where you're clicking and I can see if the link is bad. For the neural network page, here is the link rimstar.org/science_electronics_projects/backpropagation_neural_network_software_3_layer.htm
@MultiJoniboy
@MultiJoniboy 7 жыл бұрын
what's the activation function at 4:05 ? how is it defined? and what does it do? pls help
@RimstarOrg
@RimstarOrg 7 жыл бұрын
The code used for this counting network uses (1.0 / (1.0 + exp(-x))). One thing it does it makes the value be between 0 and 1. I've heard of other reasons for it, one being that if you didn't do it then the whole thing would be linear i.e. there would be many things the neural network couldn't learn. The activation function adds non-linearity. I'm still trying to wrap my head about that explanation. These days there are other formulas used too, a very popular one being to simply set any values that are less than zero to zero and let anything about zero go through unchanged.
@MultiJoniboy
@MultiJoniboy 7 жыл бұрын
thanks for the detailed answer :)
@pcred567
@pcred567 7 жыл бұрын
RimstarOrg Yes, the activation function is for the purpose of non-linearity. If you chose to use no activation function at all (i.e. the identity function), you could collapse the entire network into one layer for essentially the same reason that the linear sum of several linear functions is another linear function (actually in this case more specifically it's the product of several matrices of linear functions being equal to a single matrix). The linear combination of a set of (good) activation functions is, however, basically irreducible. The formula you speak of that uses what is basically a high-pass filter is called the Rectified Linear Unit (ReLU). The only place I'd seen them used before was in convolutional nets. I didn't know this before looking into it, but evidently it has some very useful properties of nonlinearity (since it's mostly a linear function the gradient is constant above zero and it's harder to get stuck in a local minimum, it is scale-invariant, etc.), in addition to being extremely simple to compute.
@Temporelucis
@Temporelucis 7 жыл бұрын
Thanks a lot!
@priyankalokhande4916
@priyankalokhande4916 7 жыл бұрын
Hello sir, your video for back propagation was so helpful. I have a doubt regarding activation function. How do we decide which activation function should we use for a network? and how it works in back propagation?
@RimstarOrg
@RimstarOrg 7 жыл бұрын
I wrote an article for Hackaday (hackaday.com/2017/04/11/introduction-to-tensorflow/) where I rewrote this binary counting neural network in Tensorflow. Search through it for where I talk about relu, sigmoid and softmax. In the article, you'll see that I found that the relu activation function worked much better for the hidden units, instead of sigmoid. But I found that just by testing them both. I did have to set the initial values for the weights to a suitable value to get that to work though. For the activation for the output units, I went with sigmoid instead of relu or softmax. This is also explained in the article. Basically, for this binary counter the outputs should be between 0 and 1 and sigmoid does that, whereas relu just sets anything below 0 to 0 and leaves everything above 0 alone. Softmax was no good for the output because softmax is for doing classification i.e. you want one or a few output units to fire more strongly than all the others, maybe because they represent the types of object in an image. But with the binary counting neural network, all output units were equally important and so I used sigmoid. There's also tanh, which I don't get to, which sets the output to between -1 and 1. So which one you use really depends a little on trial and error but also on what your neural network is trying to do.
@quentinquadrat9389
@quentinquadrat9389 6 жыл бұрын
Hi @RimstarOrg, nice work and well explained. Nothing wrong but just to inform you that in your code your are mixing float and literal double. 1.0 is a double while 1.0f is float. Maybe I'm wrong but intermediate computations are made in double then cast to float instead of directly made in float.
@RimstarOrg
@RimstarOrg 6 жыл бұрын
Thanks! I'll look into it.
@compilatopia
@compilatopia 8 жыл бұрын
i reallyy thank you for this video
@RimstarOrg
@RimstarOrg 8 жыл бұрын
You're very welcome. It's a fascinating area.
Izzy's Improved Object Selection and Compacting
7:13
RimstarOrg
Рет қаралды 1,8 М.
How a Wimshurst Machine Works
10:07
RimstarOrg
Рет қаралды 222 М.
Кто круче, как думаешь?
00:44
МЯТНАЯ ФАНТА
Рет қаралды 2,8 МЛН
Amazing remote control#devil  #lilith #funny #shorts
00:30
Devil Lilith
Рет қаралды 15 МЛН
How to Make Hydrogen Generator Electrolyzer for Balloon
8:32
RimstarOrg
Рет қаралды 40 М.
Pin Headers - soldering, cutting, male, female, etc.
5:47
RimstarOrg
Рет қаралды 269 М.
Izzy's Two-Eyed Robot Object Recognition and Fixation
7:13
RimstarOrg
Рет қаралды 4,9 М.
How to Make Pinhole Camera with Poster Board
5:57
RimstarOrg
Рет қаралды 18 М.
Making Servo Robot Eyes for YoLuke Webcams - Izzy
8:26
RimstarOrg
Рет қаралды 38 М.
Make USB Power Cable
3:13
RimstarOrg
Рет қаралды 237 М.
Кто круче, как думаешь?
00:44
МЯТНАЯ ФАНТА
Рет қаралды 2,8 МЛН