I'm doing some work with neural networks lately and I'm having trouble with this seemingly simple equation.(adsbygoogle = window.adsbygoogle || []).push({});

The equation describing the network is:

y = [itex]\psi[/itex](W3x [itex]\psi[/itex](W2x [itex]\psi[/itex](W1xI)))

Where:

y (scalar) is the output valueW1(2x2 matrix) are the 1st layer weightsW2(2x2 matrix) are the 2nd layer weightsW3(1x2 matrix) are the output layer weightI(2x1 vector) is the input vector[itex]\psi[/itex] is the activation function (log sigmoid)

I'm trying to differentiate the equation by the weight matrices (using the chain rule) but I'm getting equations that don't work. When I try to differentiate byW1I get:

dy/dW1= [itex]\psi[/itex]' (W3x [itex]\psi[/itex](W2x [itex]\psi[/itex](W1xI))) xW3x [itex]\psi[/itex]' (W2x [itex]\psi[/itex](W1xI)) xW2x [itex]\psi[/itex]' (W1xI) xI

When I try to calculate I'm getting matrix dimension mismatches. Am I doing something wrong?

**Physics Forums | Science Articles, Homework Help, Discussion**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Matrix dimensions are not matching after differentiation

**Physics Forums | Science Articles, Homework Help, Discussion**