当前位置:网站首页>2. Simple regression problem
2. Simple regression problem
2022-07-27 05:57:00 【Pie star's favorite spongebob】
List of articles
The return question
introduce


Optimize

Through samples wx1+b、y1,wx2+b、y2 etc. , It can be inferred that (w,b) Make for any xn, Estimate one yn, That's what we want to do .
The reason for the gradient descent may be , The derivative method is used to find the minimum value , That is, find the gradient , In higher numbers, let the derivative first ( gradient ) by 0 when , Then judge whether this point is the extreme point , Finally, find the minimum point .
Linear regression
The value range of the whole prediction is continuous .
Logical regression
The activation function is added on the basis of linear regression ( Compression function ), For example, the predicted value is 0-1 The problem of .
for example ReLU function :
R(z)=max(0,z)
classification
The classic case is MNIST Data set identification
Return to the problem of actual combat
points Data sets :

def computer_error_for_line_given_points(b,w,points):
totalError = 0
for i in range(0,len(points)):
x = points[i,0]
y = points[i,1]
totalError += (y - (w * x + b))**2
return totalError/ float(len(points))

def step_gradient(b_current,w_current,points,learningRate):
b_gradient = 0
w_gradient = 0
N = float(len(points))
for i in range(0,len(points)):
x = points[i, 0]
y = points[i, 1]
b_gradient += (2/N) * ( w_current * x + b_current - y)
w_gradient += (2/N) * x * ( w_current * x + b_current - y)
new_b = b_current - (learningRate * b_gradient)
new_w = w_current - (learningRate * w_gradient)
return [new_b,new_w]

Optimize :
def gradient_descent_ruuner(points,starting_b,starting_w,learning_rate,num_iterations):
b = starting_b
w = starting_w
for i in range(num_iterations):
b,w = step_gradient(b,w,np.array(points),learning_rate)
return [b,w]
Running results :
边栏推荐
- Sealem Finance - a new decentralized financial platform based on Web3
- Only one looper may be created per thread
- php 定义数组使用逗号,
- Day 4.Social Data Sentiment Analysis: Detection of Adolescent Depression Signals
- Getaverse, a distant bridge to Web3
- Public opinion & spatio-temporal analysis of infectious diseases literature reading notes
- 17.动量与学习率的衰减
- 3.分类问题---手写数字识别初体验
- MySQL limit分页查询优化实践
- andorid检测GPU呈现速度和过度绘制
猜你喜欢

使用Docker部署Redis进行高可用主从复制

数字图像处理 第八章——图像压缩

14.实例-多分类问题

The LAF protocol elephant of defi 2.0 may be one of the few profit-making means in your bear market

1.PyTorch简介

Seektiger's okaleido has a big move. Will the STI of ecological pass break out?

You should negotiate the handling fee before opening a futures account

数字图像处理 第二章 数字图像基础

13.逻辑回归

3.分类问题---手写数字识别初体验
随机推荐
Andorid detects GPU rendering speed and over rendering
GBASE 8C——SQL参考 5 全文检索
GBASE 8C——SQL参考6 sql语法(3)
GBASE 8C——SQL参考6 sql语法(11)
11.感知机的梯度推导
go通过channel获取goroutine的处理结果
Uboot supports LCD and HDMI to display different logo images
Dimitra and ocean protocol interpret the secrets behind agricultural data
Day 3. Suicidal ideation and behavior in institutions of higher learning: A latent class analysis
Emoji表情符号用于文本情感分析-Improving sentiment analysis accuracy with emoji embedding
Sealem Finance - a new decentralized financial platform based on Web3
【好文种草】根域名的知识 - 阮一峰的网络日志
14.实例-多分类问题
10.梯度、激活函数和loss
常用adb命令汇总 性能优化
Day10. Work organization and mental health problems in PhD students
Activity之应用进程创建流程简析
GBASE 8C——SQL参考4 字符集支持
GBASE 8C——SQL参考6 sql语法(13)
Web2.0 giants have deployed VC, and tiger Dao VC may become a shortcut to Web3