Тёмный

Neural Networks in Matlab: Part 1 - Training Regression Networks 

CodingLikeMad
Подписаться 3,4 тыс.
Просмотров 50 тыс.
50% 1

In this matlab tutorial we introduce how to define and train a 1 dimensional regression machine learning model using matlab's neural network toolbox, and discuss network complexity and over training.
Image credits:
MultipolarNeuron: By BruceBlaus [CC BY 3.0 (creativecommons.org/licenses/...)], from Wikimedia Commons
Two_layer_ann: By Mcstrother [CC BY 3.0 (creativecommons.org/licenses/...)], from Wikimedia Commons

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

 

29 июн 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 47   
@Danieltredway1431
@Danieltredway1431 5 лет назад
It is so nice to hear something in clear English! Thanks!
@ducdeubro1
@ducdeubro1 Год назад
Thank you so much for your wonderful and helpful videos.
@luisd.ramirezburgueno5245
@luisd.ramirezburgueno5245 4 года назад
Amazing video, looked for several introductions to NN and this is def the best. One last thing, can you further explain performance and Mu? what small or big values in those parameters represent? Thank you!
@LucasTeixeirasc20
@LucasTeixeirasc20 4 года назад
Have you found anything else close to this? I'm in the same search
@LucasTeixeirasc20
@LucasTeixeirasc20 4 года назад
Man, pls come back. You do an awesome job. Upload more videos!!!
@CodingLikeMad
@CodingLikeMad 4 года назад
Haha, thanks! Any topics you want? I'm working on new stuff, but its projects not tutorials.
@LucasTeixeirasc20
@LucasTeixeirasc20 4 года назад
@@CodingLikeMad Great!! I'll wait for it then. I'm willing to learn neural network, that would be very helpful for me!! But I'm learning a lot with your other videos too so feel free haha. Tks.
@techzila5379
@techzila5379 3 года назад
@@CodingLikeMad yes please implement RBFNN on secord order control system
@phvaguiar
@phvaguiar 4 года назад
Good video.
@gustavotimponi519
@gustavotimponi519 5 лет назад
Great explanation! I didn’t find part II. Where is it ? Cheers
@CodingLikeMad
@CodingLikeMad 5 лет назад
Glad you liked it! Part 2 isn't titled as part 2 because they don't really depend on each other. You can find it here: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-IUK8x3fZ1CA.html
@michaelwirtzfeld7847
@michaelwirtzfeld7847 2 года назад
Thank you.
@kammelna
@kammelna 4 года назад
Well explained, thanks for sharing with us. I am new to this field and have a little bit of knowledge and just would like to learn about ANN from this nice toolbox in MATLAB. Do you think the house prices advanced regression dataset can perform better using ANN?
@CodingLikeMad
@CodingLikeMad 4 года назад
I guess the question is "better compared to what?" Generally performance on a data set comes down to three things I think: how efficiently you use your training data, if your model has enough(but not too much) capacity for the problem, and how naturally does the model basis match the problem. Answering those is very case by case, and ANNs depend on how you encode the input space and output space quite a bit too. Easiest answer: just try! :)
@CodingLikeMad
@CodingLikeMad 4 года назад
Something else I want to mention actually, is that while my other comment is accurate, a _trend_ I have observed is that neural nets require more data to train than other models. This is because commonly seen continuous relationships (for instance, a linear relationship) tend to be more easily fit by other models, while commonly seen threshold features(for classification models) tend to be better fit by decision trees. So neural nets require enough data to approximate those relationships, rather than doing it naturally. The trade off is the less commonly seen/more complex relationships are EASIER to model with a neural net. So no hard an fast rules, but personally, I almost always try a linear regression before literally anything else.
@venkatyalamati3285
@venkatyalamati3285 Год назад
Excellent tutorial sir... Thank you so much.. plz tell me which activation function used in your model... Bcz i am going to implement similar model in Excel VBA. I cannot use matlab.
@zypchenfeng
@zypchenfeng 6 лет назад
This is fantastic video, thank you!
@CodingLikeMad
@CodingLikeMad 6 лет назад
Glad you enjoyed!
@techzila5379
@techzila5379 2 года назад
sir can you do matlab simulation of neural network for non linear system with taking some research paper?
@HuCEcpvrLab
@HuCEcpvrLab 5 лет назад
Great tutorial, thanks. What is ii in y2predict(ii:i) = net(x2);
@CodingLikeMad
@CodingLikeMad 5 лет назад
Oh my gosh, you found a typo I think. That code was probably used in a loop before I made the simplified version for the tutorial. You can just get rid of the indexing entirely I think, most likely ii was set to one when it runs.
@ducdeubro1
@ducdeubro1 Год назад
@@CodingLikeMad Thanks so much, I replaced ii=1 and i=: then it works well
@thehaseeb9136
@thehaseeb9136 2 года назад
Hello sir, thank you for making this video. I have a query that if I want to solve the same function with deep neural network then what would be modifications do I need to perform?
@CodingLikeMad
@CodingLikeMad 2 года назад
The difference between a deep neural network and a regular one is pretty artificial. Typically it just refers to NNs with more layers and nodes, rather than anything more fancy. Add more layers and you are good to go really.
@peaceandlove5855
@peaceandlove5855 4 года назад
here i come back to your video as it's well explained i had a question please, how to evaluate the accuracy of the trained Neural Network (as the output are numeric, not classes)
@CodingLikeMad
@CodingLikeMad 4 года назад
For a numeric network, the two most common metrics like accuracy are MSE (mean-squared error) and MAE (mean absolute error). These are also often used as cost functions for the network itself, although when you are judging "accuracy"(I put in quotes because accuracy really means something else), you should run them on a test set. MSE and MAE are calculated exactly like they sound like - calculate the absolute error for every element, or the squared error for every element, then take the mean.
@peaceandlove5855
@peaceandlove5855 4 года назад
@@CodingLikeMad can we say that ( accuracy = 100 - MAPE ) in % ?
@CodingLikeMad
@CodingLikeMad 4 года назад
@@peaceandlove5855 I cannot find any reference which FORMALLY defines accuracy for a regression problem. As an informal and useful metric, that seems reasonable. Be aware that MAPE has some down sides in terms of being biased towards lower error models. If you find one, feel free to reply with it, but I think people are just playing fast and loose with the word "Accuracy". I might be mistaken though.
@peaceandlove5855
@peaceandlove5855 4 года назад
@@CodingLikeMad some use test R value multipied by 100 to give an idea about model accuracy . The problem is that few talk about accuracy for nonbinary output 😅 Thanks for your fast reply mate. I really appreciate the video and the comments
@CodingLikeMad
@CodingLikeMad 4 года назад
@@peaceandlove5855 Yeah, I think the basic fact at the end of the day is that accuracy doesn't really exist as a METRIC for a regression (non-binary or non-classification) model. People want something to take the place of it, but there are a lot of ways to measure distance which is what this comes down to. Pierson's R is a common one as well. Sadly, this sort of thing is the "secret spice" of machine learning, and there isn't a perfect metric.
@souadsouad2674
@souadsouad2674 5 лет назад
Hello, it's a very good video. please have you a proposition video for RBF neural networks?
@CodingLikeMad
@CodingLikeMad 5 лет назад
Thanks for the feedback and suggestion! I don't have one planned at the moment but I'll look into it.
@DrChandraPrakashDubey
@DrChandraPrakashDubey 3 года назад
Can you please elaborate to get the optimised model parameters from trained network?
@CodingLikeMad
@CodingLikeMad 3 года назад
Do you mean the weights of the trained model, or do you mean the hyper parameters?
@osvaldoflor1785
@osvaldoflor1785 3 года назад
hi. could you ples help me to use the *plotfit(t,x,'name1',t,x,'name2',t,x,'name3') * i wrote that , but does not works.. i did not undertand the syntaxis in matlab help. I have a 3x17 matrix of inputs X and a 3x17 for outputs.
@CodingLikeMad
@CodingLikeMad 3 года назад
Hi Osvaldo, the syntax for the multiple plots looks confusing to me, I believe the matlab help page has a typo in it - you need the first argument to be the neural network. IE, plotfit(net, t1, x1, 'name1', t2,x2, 'name2'). The help text for it in matlab indicates this at least, and the one on the matlab website looks clearly busted to me. If it still won't work, could you DM me with the code and error message, and I can try to take a look?
@phvaguiar
@phvaguiar 4 года назад
Make a video using this network for testing new samples, simulations
@CodingLikeMad
@CodingLikeMad 4 года назад
Hi Pedro, glad you liked it. Could you say a bit more what you mean for your idea?
@phvaguiar
@phvaguiar 4 года назад
@@CodingLikeMad For example, when you finish the training in nftool for other app and then you use sim(net, sample) with new inputs. You could show that part later.
@mehraraemadian9114
@mehraraemadian9114 3 года назад
thanks for your valuable tutorial.i have a problem.i sincerely appreciate your answer. i have matrix with 48 raws and 2 columns,one column is in situ data and one column is satellite data. i want to train a network for points that i dont have in situ data , get satellite data and give me resault that if i had in situ data it was really close to the result .actually my rx is 1 to 30 in situ data and my ry is 1 to 30 satellite data.i want to train my network with this rx and ry.my x2 is 31 to 48 satellite data.this is my code. rx=dataaa(:,3); ry=book(:,3); x2=reshape(rx(31:48),1,[]); % inputs=dataaaa; % outputs=book(:,3); netconf=[10]; net=feedforwardnet(netconf); net=train(net,rx(1:30).',ry(1:30).'); y2pred=net(x2); figure;hold on; plot(x2,y2pred,'linewidth',0.5); plot(rx(1:30),ry(1:30),'x'); the answer is a very hard curve.how can i smooth it?is my code right?
@CodingLikeMad
@CodingLikeMad 3 года назад
I'm not sure if your code is correct, but if it runs it has a decent chance of being mostly right, but you have a bigger issue - your network has very limited data. Neural nets are generally "data heavy" - for a problem where you only have 30 training examples, I would be very tempted to not use a neural net. If you have any better curve to fit to, that may be a better model than a neural net. My suspicion is that you are heavily "over training". To verify your dimensions are correct, take a look at the input and output sizes first (in the input and outputs), and make sure they match your expected sizes, thats the thing I am most worried about from a pure correctness side. Please see the discussion towards the last half of the video about over/undertraining though, I suspect you are in such a regime.
@souparnomajumder
@souparnomajumder 4 года назад
getting an error at y2pred(ii, :)
@CodingLikeMad
@CodingLikeMad 4 года назад
There is indeed a typo in the code! That code was probably used in a loop before I made the simplified version for the tutorial. You can just get rid of the indexing entirely I think, most likely ii was set to one when it runs. Thanks for pointing it out, I'll try and add a comment near there since you are the second person to get tripped up with it.
@souparnomajumder
@souparnomajumder 4 года назад
@@CodingLikeMad works great, thanks, i was wondering if it would be possible for you to create an equivalent code in python to run in google colab?? thanks againg
@CodingLikeMad
@CodingLikeMad 4 года назад
@@souparnomajumder I've been thinking of making some python tutorials as well. Which python neural network framework were you thinking of?
@souparnomajumder
@souparnomajumder 4 года назад
@@CodingLikeMad a start with keras will be great :)
Далее
Едим ЕДУ на ЗАПРАВКАХ 24 Часа !
28:51
My little bro is funny😁  @artur-boy
00:18
Просмотров 10 млн
Artificial Neural Network (ANN) modeling using Matlab
35:14