当前位置:网站首页>Learn from Li Mu, deep learning - linear regression and basic optimization function
Learn from Li Mu, deep learning - linear regression and basic optimization function
2022-07-28 19:18:00 【Cug- Wu Yanzu】
Linear regression and basic optimization function
Linear regression
background
Teacher Li Mu made a background introduction , Say the United States needs bidding to buy a house . So according to others' offer , Then how much is suitable for me . We need to predict the price trend . This requires linear regression .
simplified model
Set up a simplified model to say house price and number of rooms , The number of toilets , Living area related . Then the purpose of linear regression is to find out each x Ahead w Parameters and b constant .
Vector version
Expand to a n Dimension vector . Then the linear model becomes the vector version .
Single layer neural network
The linear model can be regarded as a single-layer neural network , Input is each argument x Output as house price o, Then each line represents the weight of this vector .
Loss function
How to measure the loss between the real value and the estimated value of training . Then we need a loss function to express . The commonly used loss function is the square loss .
Collection of training data
Collect some data as this training sample . The more the better , This can better fit the parameters .
Parameter learning
Then we need to calculate the average loss between the predicted value and the real value to measure the loss function . The goal is to minimize the loss function .
The explicit solution of linear function
Because this is a linear model , So the loss is a convex function . Then there is the optimal solution . But in machine learning , Don't care about functions with explicit solutions . Only care about complete NP Difficult problem .
summary

Basic optimization function
gradient descent
Choose the initial value of a parameter at random , Then solve the loss function about w Gradient of ( At this point, the fastest decline direction ). η \eta η It's a learning step . It's a super parameter , It's not good to be too short ( Very expensive computing resources , Computing gradients is the most expensive part of machine learning , So use less ), Too long is not good ( Too long, easy to fit and fast convergence ).

Here is random sampling b Samples to approximate the loss function . It is called small batch random gradient descent . All in learning , When calculating the loss function , I'll pick one batch Not the whole sample .
Similarly, the batch size should not be too large or too small .
detach
stay pytorch Each tensor in it needs to be derived from the graph detach Only when you come out can you turn into numpy
yield
One at a time x and y Until all return .
epoch
It means scanning the whole data epoch Time
with keyword
with Express try-finally It means . Presentation testing
There is another one from 0 Start implementing version , And using the toolkit to implement the version . In the video . It's important to understand , Test set generation , Definition of weights and parameters in network model definition of loss function , Definition of super parameters , Model training . And finally the process of losing the output of the function . After understanding clearly , All change is the same .
边栏推荐
- Is zero basic software testing training reliable?
- From Bayesian filter to Kalman filter (2)
- The login interface of modern personal blog system modstartblog v5.4.0 has been revised and the contact information has been added
- Remember a uniapp experience
- Is the software testing training institution reliable?
- Module 8 of the construction camp
- Two month software testing training scam? How to choose training institutions?
- Wechat solves the problem of long press selected style
- Kali doesn't have an eth0 network card? What if you don't connect to the Internet
- Implementation of grayscale publishing with haproxy
猜你喜欢

ACM warm-up exercise 3 in 2022 summer vacation (detailed)

Fundamentals of software testing and development | practical development of several tools in testing and development

Module 8 of the construction camp
![[image segmentation] vein segmentation based on directional valley detection with matlab code](/img/82/7b7b761c975cd5c2f5b8f3e43592d2.png)
[image segmentation] vein segmentation based on directional valley detection with matlab code

Self cultivation of Electronic Engineers - when a project is developed

pytest 自定义HOOK函数

关于ASM冗余问题

Creating new projects and adding your own programs

BM16 delete duplicate elements in the ordered linked list -ii

Qt: 一个SIGNAL绑定多个SLOT
随机推荐
vim学习手册
Kali doesn't have an eth0 network card? What if you don't connect to the Internet
How new people get started learning software testing
Creating new projects and adding your own programs
QT widget promoted to QWidget
Kotlin:sealed Class detailed explanation of sealed class
关于ASM冗余问题
Swiftui component how to implement textfield of hidden part of phone number mask (tutorial includes source code)
MES生产管理系统对设备的应用价值
Implementation of grayscale publishing with haproxy
Minio distributed file system learning notes
Easynlp Chinese text and image generation model takes you to become an artist in seconds
How to break through the bottleneck of professional development for software testing engineers
The wechat installation package has expanded 575 times in 11 years, and the up owner: "98% of the documents are garbage"; Apple App store was exposed to a large number of pornographic apps; Four techn
What is the future of software testing? How to learn?
【图像隐藏】基于DCT、DWT、LHA、LSB的数字图像信息隐藏系统含各类攻击和性能参数附matlab代码
Mongodb database shell command execution
Win11系统svchost.exe一直在下载怎么办?
Is zero basic software testing training reliable?
架构实战营第8模块作业