当前位置:网站首页>Learning notes of "hands on learning in depth"
Learning notes of "hands on learning in depth"
2022-07-05 05:05:00 【fb_ help】
《 Hands-on deep learning 》 Learning notes
Data manipulation
Automatic derivation
Variable setting derivation
x = torch.ones(2, 2, requires_grad=True)
Obtain derivative
out.backward()
Here, the dependent variable is required to be scalar , If tensor, You need to provide a weight matrix with the same size as the dependent variable , The output dependent variable is transformed into a scalar by weighted summation of all elements , Then you can backward().
The reason is well understood : There is no relationship between dependent variables , All dependent variable elements are simply put together , Therefore, their permutation can be regarded as a one-dimensional vector and linearly weighted to a scalar l On . The advantage of this is that the gradient is independent of the latitude of the dependent variable , Got l And the gradient of the independent variable , It doesn't matter what shape the dependent variable is tensor.
Linear regression
The gradient descent method solves the parameters
The above formula can be solved analytically .
The parameters to be solved can also be optimized by gradient descent through linear regression . Small batch random gradient descent is usually used (mini-batch stochastic gradient descent) Method , That is, calculate the average gradient in small batches , Multi batch optimization parameters .
Here is also multiplied by a learning rate , It is equivalent to step size , It can be a little bigger at first , The back should be smaller .
Fully connected layer ( Dense layer )
Linear regression
- Build simulation data , Confirm the input (features), Input (label), Parameters
- Write data loader( Split data into batch)
- structure function (net) , loss And optimization method
- iteration epoch solve
Linear regression concise version
data fetch
Define your own function, You need to give the number of parameters and forward function . In fact, it is the functional relationship between input and output . therefore , Give the calculation method of input and output , namely forward function . Neural network replaces this functional relationship with grid structure .
use torch Of net structure
Loss
An optimization method
边栏推荐
- cocos_ Lua loads the file generated by bmfont fnt
- 【Leetcode】1352. Product of the last K numbers
- 2022 thinking of mathematical modeling C problem of American college students / analysis of 2022 American competition C problem
- Leetcode word search (backtracking method)
- 54. Spiral matrix & 59 Spiral matrix II ●●
- Unity check whether the two objects have obstacles by ray
- AutoCAD - graphic input and output
- AutoCAD - window zoom
- Cocos2dx Lua registers the touch event and detects whether the click coordinates are within the specified area
- MD5 bypass
猜你喜欢
3dsmax snaps to frozen objects
AutoCAD - full screen display
54. Spiral matrix & 59 Spiral matrix II ●●
Research on the value of background repeat of background tiling
十年不用一次的JVM调用
Unity3d learning notes
Establish cloth effect in 10 seconds
LeetCode之单词搜索(回溯法求解)
Introduction to JVM principle and process
Collapse of adjacent vertical outer margins
随机推荐
Grail layout and double wing layout
"Measuring curve length" of CAD dream drawing
中国艾草行业研究与投资前景预测报告(2022版)
Lua determines whether the current time is the time of the day
C4D simple cloth (version above R21)
2022 American College Students' mathematical modeling ABCDEF problem thinking /2022 American match ABCDEF problem analysis
Unity shot tracking object
Collapse of adjacent vertical outer margins
3dsmax scanning function point connection drawing connection line
AutoCAD - continuous annotation
Unity find the coordinates of a point on the circle
Pause and resume of cocos2dx Lua scenario
Personal required code
Redis 排查大 key 的4种方法,优化必备
【Leetcode】1352. 最后 K 个数的乘积
Emlog博客主题模板源码简约好看响应式
嵌入式数据库开发编程(零)
中国溶聚丁苯橡胶(SSBR)行业研究与预测报告(2022版)
被舆论盯上的蔚来,何时再次“起高楼”?
AutoCAD - full screen display