Тёмный

Single-Layer Perceptron: Background & Python Code 

Brian Faure
Подписаться 13 тыс.
Просмотров 90 тыс.
50% 1

In this video we'll introduce the Single-Layer Perceptron (aka "Neuron" or simply "Perceptron"), the most fundamental element of nearly all modern neural network and machine learning models. We'll begin by covering the history and main idea, then open up a coding editor and actually implement the element from scratch.
Machine Learning textbook (mentioned in video): www.deeplearningbook.org/
Github repo: github.com/bfaure/AI_Project_...
If you'd like to learn about Python data structures, check out my video series starting with: • Python Data Structures...
Video series covering GUI development in Python: • Python GUI Development...
References:
[1] - en.wikipedia.org/wiki/Perceptron
In machine learning, the perceptron is an algorithm for supervised learning of binary classifiers (functions that can decide whether an input, represented by a vector of numbers, belongs to some specific class or not). It is a type of linear classifier, i.e. a classification algorithm that makes its predictions based on a linear predictor function combining a set of weights with the feature vector. The algorithm allows for online learning, in that it processes elements in the training set one at a time.

Опубликовано:

 

10 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 46   
@CSERohitKartik
@CSERohitKartik 5 лет назад
Honestly this was amazing, Really well explained , used time efficiently ! I would love to watch more of your amazing videos :)
@crazy4drumming
@crazy4drumming 6 лет назад
Awesome video man. The first half of your video really helped me understand the concept of how data can be divided up. Then seeing the whole thing coded up (pretty much) from scratch is super helpful. I felt like I was a little lost with the terminology you introduced ("activation", "weights" etc) in the second half that weren't really talked about in the cars/plane example, but other then that this is the best vid for getting from concept to implementation that I've seen so far.
@BrianFaure1
@BrianFaure1 6 лет назад
Thanks Reed! I'll try to add in some more explanation of the math behind the weights/activation when I finally get around to finishing up the multi-layer perceptron video. In the meantime if you'd like some more info, Grant over at 3Blue1Brown has a pretty amazing video series covering neural networks (first video here: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-aircAruvnKk.html ). It's a bit more complex because he covers a model with 4 layers but he does talk about how the weights are calculated and their overall purpose.
@mickmickymick6927
@mickmickymick6927 3 года назад
Wow, making a tutorial video while flying a jet airliner, amazing!
@hritikdj
@hritikdj 3 года назад
That's an amazing and very insightful video :) Thanks for sharing your knowledge
@bruce3239
@bruce3239 6 лет назад
You explained so well! Applause!
@kagesawamasaki6431
@kagesawamasaki6431 6 лет назад
This is a great video. Thanks!
@maryambanoo7
@maryambanoo7 2 года назад
it was very clear and useful. thank you
@frankribery3362
@frankribery3362 5 лет назад
Thanks man brian
@ClickDay-oi4lz
@ClickDay-oi4lz 5 лет назад
It would be amazing if you start from this code and develop a multi-layers architecture.
@alibalouchi1496
@alibalouchi1496 2 года назад
very good.Thanks❤
@philtoa334
@philtoa334 3 года назад
Very Good.
@yxor
@yxor 6 лет назад
Hey, great video. Do you really type that fast ?
@saahithj5073
@saahithj5073 6 лет назад
Hi Brian, Thanks for the video. Very informative! In another source, I read that if you are using a learning rate in your perceptron implementation, then you should not initialize your weights to zero. Can you please explain why this is the case?
@BrianFaure1
@BrianFaure1 6 лет назад
Thanks for watching! I haven't heard of this specifically with relation to the learning rate but I know that in general you shouldn't initialize all weights to the same number (in this case zero) because then, no matter how many epochs you train for the weights will always remain the same. Here's some useful links if you'd like to learn more... datascience.stackexchange.com/questions/22093/why-should-the-initialization-of-weights-and-bias-be-chosen-around-0 stackoverflow.com/questions/20027598/why-should-weights-of-neural-networks-be-initialized-to-random-numbers stats.stackexchange.com/questions/45087/why-doesnt-backpropagation-work-when-you-initialize-the-weights-the-same-value
@ispeakforthebeans
@ispeakforthebeans 5 лет назад
the fans on that machine are goals
@tartorizaldi9923
@tartorizaldi9923 3 года назад
Your code save me
@aalaahabib3540
@aalaahabib3540 5 лет назад
I have only one Gui when I implement the code what should I do to see all probability ?
@blasttrash
@blasttrash 5 лет назад
how can we modify this so that we have live matplotlib graph? like the graph should dynamically update without closing off and turning on again.
@EverythingYouNeedToKnowEYN2K
@EverythingYouNeedToKnowEYN2K 6 лет назад
Hey bro, awesome video, though @ 4:40 shouldn't it be if "output = 1 if a > 0.5 else 0", sigmoid squishes between 0 and 1?
@BrianFaure1
@BrianFaure1 6 лет назад
Thanks! Yeah if it was a true sigmoid that would be the case. This is just more of a step function with an arbitrary boundary of 1.
@crazymelvin19
@crazymelvin19 6 лет назад
Hey , Awesome Video. Helped me learn the concept. U have a hardcoded data set. Is it possible to generate a linearly separable data set instead of hardcoding it?
@BrianFaure1
@BrianFaure1 6 лет назад
Thanks! Ya you could definitely generate some linearly separable data yourself. I think an easy way would be to first randomly generate 'm' and 'b' values for the equation y=m*x+b, then go on generating datapoints, adding them to either of the two groupings based on whether they are above or below the line (or to the left or right) created by the y=m*x+b equation. To generate random integers I'd use the randint function of the random module ('from random import randint') because you can pass two integer bounds to bound the random number between.
@crazymelvin19
@crazymelvin19 6 лет назад
Thanks. Trying that out now.This would be for 2 dimensional data. Could you also maybe give an idea on how i can generate points for N dimesnional data ? Maybe points to one side of a hyperplane are classified as positive and to the other as negative?
@BrianFaure1
@BrianFaure1 6 лет назад
Sorry, it's been awhile since I took linear algebra but I believe you can take a similar approach where you first randomly generate the hyperplane (for example a 3d hyperplane would have equation Ax+By+Cz+D=0) parameters, then you would have to randomly generate the n-dimensional points. You would then be able to classify the points into groups based on whether or not they were 'above' or 'below' the plane by plugging in the (x,y,z) coordinates (assuming 3d) into the generated equation, then points with the same sign output (+/-) would be above/below the plane, respectively. You could also handle the equation generation and point assessment (for above/below) using matrices, there's some info on that here math.stackexchange.com/questions/7931/point-below-a-plane and here math.stackexchange.com/questions/1870619/finding-the-vector-equation-of-a-plane-from-cartesian , let me know if you have any other questions.
@mahery_ranaivoson
@mahery_ranaivoson 5 лет назад
could you please make another video to explain how you get the decision boundary line?
@b.f.skinner4383
@b.f.skinner4383 4 года назад
This is 1 year late, but in case anyone else is curious: the output of the simplified dot product of the weight vector (w) and the input vector (x) results in a linear inequality, which is the equation that forms the hyperplane/decision boundary.
@comeinwiththerain19
@comeinwiththerain19 6 лет назад
Hi, this was super helpful, could you also do a video about multi layer perceptron?
@BrianFaure1
@BrianFaure1 6 лет назад
Hello Baingani thanks for watching and commenting! Yes I will get around to doing the multi-layer perceptron I've just been very busy lately but it is certainly on the queue.
@spacedustpi
@spacedustpi 6 лет назад
Thanks for the video. It is very helpful. Now, I am trying to understand the code. This is probably a dumb question, but what is going on with "if __name__ == '__main__': " before you call the function? Is it necessary?
@BrianFaure1
@BrianFaure1 6 лет назад
What's up Ben. Definitely not a dumb question, 'if _name_ == '_main_'' is a statement you'll see a lot of in Python. Basically the if statement will only be triggered if the Python file is being executed directly, so by calling 'python your_file_name.py' for example. It will _not_ be satisfied in any other instance, so a common example would be importing the code into another python file (in this case the code inside the 'if _name_=='_main_' would not be run). Here's someone explaining it better than I ever could, if you'd like to learn more stackoverflow.com/questions/419163/what-does-if-name-main-do
@spacedustpi
@spacedustpi 6 лет назад
Thanks for the link. I see its utility now.
@magnuswootton6181
@magnuswootton6181 Год назад
as u can see a single neuron in a neural network is one complete output on a single layer. so a single layer with one output is just one single neuron.
@mitchbregs
@mitchbregs 5 лет назад
go Rutgers baby
@TM-vg2mt
@TM-vg2mt 6 лет назад
hello brian how to install the matplotlib in windows? thankyou
@BrianFaure1
@BrianFaure1 6 лет назад
Normally you can call "pip install matplotlib" from your Command Prompt application, if that doesn't work try "python -m pip install matplotlib". If you can run your Python code from Command Prompt, either of those should work, but if not, post your error and I'll try to help you out. Thanks for the comment!
@BrianFaure1
@BrianFaure1 6 лет назад
Another thing that might help is running the Windows Command Prompt application as the admin profile (just right-click the Command Prompt application and select "Run as Administrator"), this should prevent you from getting privilege errors when you try to run "python -m pip install matplotlib".
@borgestheborg
@borgestheborg 6 лет назад
Just install Anaconda
@ludphineroseann
@ludphineroseann 5 лет назад
what was the data set source?
@mahery_ranaivoson
@mahery_ranaivoson 5 лет назад
I think this is an arbitrary dataset he has defined.
@brotherlui5956
@brotherlui5956 6 лет назад
Hi Brian, the presented content and the video quality is good but, i'm sorry to say, the audio is the worst. This terrible background noise makes it hard to understand you. What kind of microphone are you using? If it's an external one, throw it away and buy a better one. If it's your laptop internal, boy you definitely need an external one with noise reduction. Just a hint, no hate.
@BrianFaure1
@BrianFaure1 6 лет назад
Thanks! Yeah my mic is pretty terrible I'm actually using the input on my gaming headset. I've been shopping around and found a couple decent ones on Amazon I'm currently considering, just waiting on my first payment from RU-vid to order, should be in a week or so since I'm right about at the payout threshold. In my most recent video on the Graham Scan algorithm I was able to slightly improve the audio using some effects in my video editing software but new hardware is really what will fix the problem (I hope).
@brotherlui5956
@brotherlui5956 6 лет назад
Brian Faure you have my sub and my thumb up on every vid i watch. Although you are quite rushing through the matter. Sometimes I need to rewind and watch and listen again to understand. Please keep in mind that imho your audience watches your vids cause they want to learn from what you are presenting. Maybe you could get more subs if you slow down a bit. I wish you all the best. BR
@ScreaminOwl
@ScreaminOwl Год назад
Interesting, but so bad recording and mixing I was about to steer away from this. Super annoying audio!
Далее
Binary Search: Background & Python Code
6:57
Просмотров 19 тыс.
ДЖЕФ ВСЕМ ПОМОЖЕТ🤓
10:33
Просмотров 351 тыс.
Transformer Neural Networks Derived from Scratch
18:08
Просмотров 133 тыс.
The moment we stopped understanding AI [AlexNet]
17:38
Просмотров 880 тыс.
Modern Python logging
21:32
Просмотров 172 тыс.
The Essential Main Ideas of Neural Networks
18:54
Просмотров 919 тыс.
Machine Learning From Zero to GPT in 40 Minute
47:53
Просмотров 28 тыс.
The Clever Way to Count Tanks - Numberphile
16:45
Просмотров 851 тыс.