2022-04-25 Skolotāju konference LiepU

image-20220425111609367

https://playground.tensorflow.org

image-20220425091503373

 

image-20220425110042323

image-20220425110404987

File:Neural network.svg - Wikimedia Commons

 

Derivative rules

Constant rule

x+c∂x=x+0=x

Power rule

cxn∂x=nxn−1

Exponent rule

ef(x)dx=ef(x)⋅f(x)dx

 

Chain rule

f(g(x))∂x=f(g(x))∂g(x)g(x)∂x

 

Product rule

f(x)g(x)∂x=f(x)∂xg(x)+f(x)g(x)∂x

Quotient Rule

∂xf(x)g(x)=g(x)∂xf(x)−f(x)g(x)∂xg(x)2

 

Reciprocal rule

dx1f(x)=dxf(x)−1=−f(x)−2⋅f(x)dx

 

 

 

Model(x,W1,b1,W2,b2)=Linear(sigmoid(Linear(x,W1,b1)),W2,b2))=y′
LMAE=∑|y′−y|
W1′=W1−LMAE∂W1αb1′=b1−LMAE∂b1α

 

SGD

image-20220425110210199

 

MAE derivative

LMAE=∑|y′−y|

LMAE=|a|=a2=(a2)12

LMAE∂y′=?

1n=n−1

1n10=n−10

 

LMAE∂a=12(a2)12−1⋅a2∂a=12(a2)12−1⋅2a=a⋅(a2)−12=a(a2)12=a(a2)=a|a|+ϵ

 

Linear function

Linear(x,W,b)=W⋅x+b

Linear(x,W,b)∂W=x

Linear(x,W,b)∂x=W

Linear(x,W,b)∂b=1⋅b0=1

 

Sigmoid function

img

 

σ(x)=11+e−x

σ(x)∂x=11+e−x=(1+e−x)−1=(1+e−x)∂x⋅−1(1+e−x)−2=e−x⋅−x∂x⋅−1(1+e−x)−2=e−x(1+e−x)2=σ(x)(1−σ(x))

reciprocal rule = chain & power rule dx1f(x)=f(x)−1=−f(x)−2⋅f(x)dx

exponent rule ef(x)dx=ef(x)⋅f(x)dx