How to calculate the gradient of

begin {align}

L left (W, gamma, beta right): = -y ^ T log left (f left (W x; gamma, beta right) right)

end

in memory of $ left {W, gamma, beta right } $, from where $ x in mathbb {R} ^ n $, $ W in mathbb {R} ^ {m times n} $, and $ y in mathbb {R} ^ m $, but $ y_i in {0,1 } $, $ f (z; gamma, beta) $ is parameterized with $ gamma $ and $ beta $?

The definition of

$$ eqalign {

f (z; gamma, beta) & = gamma left (z- mu (z) right) \ left ( sigma (z) + epsilon right) ^ {- 1/2} + beta cr

mu (z) & = alpha 1 ^ Tz cr

sigma (z) & = alpha sum_ {k = 1} ^ m left (ex[k] – mu (z) right) ^ 2 equiv alpha 1 ^ T left[ left( z- mu(z) right) odot left(z – mu(z) right) right] cr

$$ from where $ 1 ^ T $ is a row vector with all, $ odot $ is an elementwise multiplication and $ alpha $ and $ epsilon $ are known scalars.

Thanks in advance for your help