Dot product weight derivative function
Syntax
dZ_dP = ddotprod('p',W,P,Z)
dZ_dW = ddotprod('w',W,P,Z)
Description
ddotprod
is a weight derivative function.
ddotprod('p',W,P,Z)
takes three arguments,
and returns the S
x R
derivative dZ/dP
.
ddotprod('w',W,P,Z)
returns the R
x Q
derivative dZ/dW.
Examples
Here we define a weight W
and input P
for an input with 3 elements and a layer with 2 neurons.
W = [0 -1 0.2; -1.1 1 0];
P = [0.1; 0.6; -0.2];
Here we calculate the weighted input with dotprod
, then calculate each derivative with ddotprod
.
Z = dotprod(W,P)
dZ_dP = ddotprod('p',W,P,Z)
dZ_dW = ddotprod('w',W,P,Z)
Algorithm
The derivative of a product of two elements with respect to one element is the other element.
dZ/dP = W
dZ/dW = P
See Also
dotprod
[ Previous | Help Desk | Next ]