当前位置:网站首页>Scalar / vector / matrix derivation method
Scalar / vector / matrix derivation method
2022-07-08 01:23:00 【You roll, I don't roll】
This blog stems from the derivation of an error vector Euclidean distance when reading the paper , as follows :
After reading a pile of data, I came to the following conclusion :
How did this conclusion come about ? This involves scalars / vector / The derivation of the matrix . Due to scalar 、 Vectors can be regarded as special matrices , Therefore, it is collectively referred to as matrix derivation .
Catalog
2、 The denominator layout of matrix derivation
3、 Common formulas for denominator layout derivation
5、 Jacobian matrix And Jacobian determinant
1、 How to derive a matrix
For general scalar functions f(x) For scalars x The derivative of is :
matrix A The matrix B The derivation of dA/dB It is essentially a matrix A Medium Every element For the matrix B Medium Every element The derivation of . According to this essence, we can get the number of derivatives in the following cases .
1、 When A And B All are 1×1 Matrix time , here A Yes B Derivation is the derivation of scalar function from scalar , The result is 1 A derivative ;
2、 When A by m×1 Vector ,B by 1×1 Scalar time of , here A Yes B Derivation is the derivation of a vector function from a scalar , There are m A derivative ;
3、 When A by m×1 Vector ,B by p×1 When the vector of , Such as :
There are m×p A derivative ;
4、 When A by m×n Vector ,B by p×q When the vector of , There are m×n×p×q A derivative
In the above four cases , Except that the first result is a scalar , The other three derivatives have multiple . In practical applications , We often expect that the result of matrix derivation is also in the form of a matrix to participate in subsequent operations . By the end of 4 For example , The final m×n×p×q How should the derivatives be arranged in matrix form ? Is arranged in m×n That's ok p×q Or m That's ok n×p×q Columns or other forms ? This leads to the matrix ( vector ) Derivative Molecular arrangement And Denominator layout 了 .
Molecular arrangement And Denominator layout In essence, it is the layout of two artificially prescribed derivative results , There is no difference between good and bad , The specific layout can be selected according to the calculation habits . For the derivative dA/dB , Molecular arrangement Is to find the derivative result in terms of the matrix at the molecular position A The form shall prevail ( The first dimension of the derivative result is consistent with the molecular position ), Denominator layout Is the matrix on the denominator of the derivative result B The form shall prevail . Let's say Denominator layout Take an example to explain .
2、 The denominator layout of matrix derivation
For the derivative df/dx Come on ,f At the molecular position ,x In the denominator position , The discussion can be divided into the following situations :
( Generally, the vector represented by letters defaults to Column vector , Unless transposed )
1、f Is a scalar function ,x Is the column vector :
here , Because the denominator part is a p×1 Column vector form of , So the final result is p×1 The column vector .
2、f Is a scalar function ,x It's a row vector :
here , Because the denominator part is a 1×p In the form of a row vector , So the final result is 1×p The row vector .
3、f Is the column vector ,x For the scalar :
The result is 1×p In the form of a row vector , This result is equivalent to
4、f Is the column vector ,x Is the column vector :
At this time, the form of the final result can be deduced in two steps .
First, the first step will be f As a whole , According to the position of the denominator x The layout of
Now you can put According to the situation 3 The form in is expanded as follows :
For the denominator layout, the final result is consistent with the form of the denominator , There is a simple image called XY Stretching , The form of the result can be judged by the following two criteria :
- Scalar invariant , Vector stretch
- X Longitudinal stretch ,Y Transverse stretch
The stretching explanation of the above formula is shown in the figure below :
The above is matrix derivation Denominator layout Several situations of , Other complex combinations can be derived from the above rules . The denominator layout is only an artificial layout regulation of the matrix derivation results , The derivative result is just a few definite values , In specific applications, we layout these values into one-dimensional vectors 、 Two dimensional matrix or higher dimensional form are set according to their own needs , Just the denominator / The form of molecular layout is more commonly used in general applications .
3、 Common formulas for denominator layout derivation
(1)
among :
This problem can be looked at first f(x) The expansion of , Notice that the result is Scalar :
According to the rules of denominator layout , The derivative result at this time should be a p×1 The column vector , here
(2)
among :
You can launch at this time :
(3) This is also the calculation mentioned at the beginning of the article ( It can be deduced by expanding first and then deriving each item )
(4)
(5)
4、 Molecular arrangement
For molecular layout, the final result is consistent with the form of molecules , Similar to the denominator layout XY Stretching , There is also a simple and easy to remember method of molecular layout, namely YX Stretching , The form of the result can be judged by the following criteria :
- Scalar invariant , Vector stretch
- Y Longitudinal stretch ,X Transverse stretch ( Note that the denominator layout is X Longitudinal stretch ,Y Transverse stretch )
Generally speaking, the results of numerator layout and denominator layout are transposed to each other . There is no difference between the two layouts , Just find a way to use it that you are used to .
5、 Jacobian matrix And Jacobian determinant
Matrix by Molecular arrangement The result of derivation constitutes Jacobian matrix ( The result of denominator layout is the transposition of Jacobian determinant ). When the Jacobian matrix is a square matrix , The determinant of the square matrix can be called Jacobian determinant . In matrix theory , The determinant of the linear transformation matrix represents the change multiple of the space area before and after the transformation , But for nonlinear transformation matrix , The establishment of its Jacobian determinant is to solve the problem of local space expansion , use Infinitesimal method ( Infinitesimal transformation can actually be regarded as linear ) Represents the multiple of space expansion near a certain point .
===================================================================
of The geometric principle of matrix linear transformation as well as The geometric principle of Jacobian determinant You can refer to the following video :
【 As the saying goes, matrix 】 The essential meaning of determinant is actually like this ! The math teacher will never tell you !_ Bili, Bili _bilibilihttps://www.bilibili.com/video/BV1Hb4y1q7Sp?from=search&seid=9625805080710138609&spm_id_from=333.337.0.0《 Under Jacobian matrix : The so-called Jacobian determinant 》3Blue1Brown Grant Sanderson, Moved from Khan College . 【 Self made Chinese subtitles 】_ Bili, Bili _bilibili
https://www.bilibili.com/video/BV18J41157X8/?spm_id_from=333.788.recommend_more_video.12
Matrix derivation Reference video :
边栏推荐
- General configuration toolbox
- Scheme selection and scheme design of multifunctional docking station for type C to VGA HDMI audio and video launched by ange in Taiwan | scheme selection and scheme explanation of usb-c to VGA HDMI c
- 5. Discrete control and continuous control
- 8. Optimizer
- 3. MNIST dataset classification
- 2022 safety officer-a certificate free examination questions and safety officer-a certificate mock examination
- 完整的模型训练套路
- Redis 主从复制
- Recommend a document management tool Zotero | with tutorials and learning paths
- How to transfer Netease cloud music /qq music to Apple Music
猜你喜欢
Blue Bridge Cup embedded (F103) -1 STM32 clock operation and led operation method
2021 tea master (primary) examination materials and tea master (primary) simulation test questions
国内首次,3位清华姚班本科生斩获STOC最佳学生论文奖
Parade ps8625 | replace ps8625 | EDP to LVDS screen adapter or screen drive board
Led serial communication
Ag9311maq design 100W USB type C docking station data | ag9311maq is used for 100W USB type C to HDMI with PD fast charging +u3+sd/cf docking station scheme description
2022 chemical automation control instrument examination summary and chemical automation control instrument simulation examination questions
利用GPU训练网络模型
2022 free test questions of fusion welding and thermal cutting and summary of fusion welding and thermal cutting examination
Vscode reading Notepad Chinese display garbled code
随机推荐
2021-03-06 - play with the application of reflection in the framework
Chapter improvement of clock -- multi-purpose signal modulation generation system based on ambient optical signal detection and custom signal rules
On the concept and application of filtering in radar signal processing
Cs5261type-c to HDMI alternative ag9310 | ag9310 alternative
How to transfer Netease cloud music /qq music to Apple Music
Introduction to the types and repair methods of chip Eco
Ag9311maq design 100W USB type C docking station data | ag9311maq is used for 100W USB type C to HDMI with PD fast charging +u3+sd/cf docking station scheme description
Chapter XI feature selection
11. Recurrent neural network RNN
Ag9310 same function alternative | cs5261 replaces ag9310type-c to HDMI single switch screen alternative | low BOM replaces ag9310 design
Ag7120 and ag7220 explain the driving scheme of HDMI signal extension amplifier | ag7120 and ag7220 design HDMI signal extension amplifier circuit reference
For the first time in China, three Tsinghua Yaoban undergraduates won the stoc best student thesis award
C#中string用法
4. Apprentissage stratégique
A little experience from reading "civilization, modernization, value investment and China"
Generic configuration legend
2022 safety officer-a certificate free examination questions and safety officer-a certificate mock examination
redis的持久化方式-RDB和AOF 两种持久化机制
Smart grid overview
Common effects of line chart