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 - The Fusion of Science and Community**

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

# Matrix dimensions are not matching after differentiation

Loading...

Similar Threads - Matrix dimensions matching | Date |
---|---|

I Gaussian integral in two dimensions | Nov 14, 2016 |

I Jacobian matrix generalization in coordinate transformation | Jun 24, 2016 |

I Determinant of a 4x4 matrix | Apr 2, 2016 |

I Just to be sure about the Jacobian matrix and determinant... | Mar 22, 2016 |

Solving Exponential of a Matrix | Oct 29, 2015 |

**Physics Forums - The Fusion of Science and Community**