Row 3647

Row ID: 3647 | Dataset Entry | Axioma AXP Content Repository

Content Data

This page contains data entry 3647 from the Axioma AXP content repository. The structured data below represents the complete record for this entry.

Hi everyone, I´m new in this AI stuff and I'm engineering student too. So, I´m trying to code a multilayer perceptron with two hidden layers and one neuron in output layer to do a regression task without any library, just with linear algebra. I think that I understood the math behind the back propagation, but I have a doubt when i'm coding.

​

During the backward pass I wrote something similar to this( just to know, I´m writing the code in samsung notes before coding):

​

% second hidden layer

dE\_dY = grad3\*w3

dY\_dI = g(L2\_input,derivative = "True")

grad2 = dE\_dy\*dI\_dy

dI\_dW = L1\_output

​

W2 = W2 -(learning\_rate)\*(-grad2\*dI\_dW)

​

This part of my code is updating the weigths of second hidden layer. My problem is with the dimensions. because when i calculate grad2, that in my case is the multiplication of 2 collunm vectors of same dimensions,something like (1xn)\*(1xn), and as you know, I can't multiply this.

​

Due to the fact that I know the dimension of my weight matrix, e.g MxN, I konw that --> (learning\_rate)\*(-grad2\*dI\_dW) <--- needs to have this same dimensions. With this, the only possibility to achieve the dimension MxN is if I realize the operation dI\_dy.\*dI\_dy, where the operator ".\*" will multiply each one of the elements of the dI\_dy by each element of dI\_dy, resulting in the (1xn).

&#x200B;

My doubt is: In the math, -->dI\_dy\*dI\_dy<--- is just a multiplication, but when I'm coding, it appears that I will need to use the ".\*", but I don't know if this is correct.

&#x200B;

Just to know, I´m programming in MATLAB.

Sorry by the long text and if I didn't was clear enough, please let me know (I'm not an native english speaker).

&#x200B;

FieldValue
text Hi everyone, I´m new in this AI stuff and I'm engineering student too. So, I´m trying to code a multilayer perceptron with two hidden layers and one neuron in output layer to do a regression task without any library, just with linear algebra. I think that I understood the math behind the back propagation, but I have a doubt when i'm coding. &#x200B; During the backward pass I wrote something similar to this( just to know, I´m writing the code in samsung notes before coding): &#x200B; % secon…
label r/neuralnetworks
dataType post
communityName r/neuralnetworks
datetime 2024-03-18
username_encoded Z0FBQUFBQm5LakwxVVNlZ1V4aF8yUEtFWHl5OHkxTnRNclp5N2ZaMUsxWFJWcjJFcFk0SV92R3h5blhLYkprZDZGUmZxQmFzaEYyd1Y3ZzNqWHQ2ZXpvTGowV1I5WWg5eFE9PQ==
url_encoded Z0FBQUFBQm5Lak9FZVZDQW0xQmNERFZNcElKWDFoWC03YTN0OHpKN3dJckFSNkw5SFRKRmRBd3BocHR5aERLam9SQy1ZbUZKOXBpZEhhMEdlZFV1RmZMMTlPV0ZxamxWd2tWVnZHbmhNNXVvMEEzYVR4eUxZOU9OQ29LSDFvT1ZobDkxZkZCZUJNa2VVWFJYWXlINEw1SGZRa2tqN1ZUbVdjRXlsSWx4czFZQ2VtQmVpVGppWEU2ZW5Ca1Y2OFI5dDFrTGl3NlJxNXp1XzdhTHp1ZUEyNkdPY1AtSzhReDMtUT09

Raw Record

{
  "text": "Hi everyone, I´m new in this AI stuff and I'm engineering student too. So, I´m trying to code a multilayer perceptron with two hidden layers and one neuron in output layer to do a regression task without any library, just with linear algebra. I think that I understood the math behind the back propagation, but I have a doubt when i'm coding.\n\n&#x200B;\n\nDuring the backward pass I wrote something similar to this( just to know, I´m writing the code in samsung notes before coding):\n\n&#x200B;\n\n% second hidden layer\n\ndE\\_dY = grad3\\*w3\n\ndY\\_dI = g(L2\\_input,derivative = \"True\")\n\ngrad2 = dE\\_dy\\*dI\\_dy\n\ndI\\_dW = L1\\_output\n\n&#x200B;\n\nW2 = W2 -(learning\\_rate)\\*(-grad2\\*dI\\_dW)\n\n&#x200B;\n\nThis part of my code is updating the weigths of second hidden layer. My problem is with the dimensions. because when i calculate grad2, that in my case is the multiplication of 2 collunm vectors of same dimensions,something like (1xn)\\*(1xn), and as you know, I can't multiply this.\n\n&#x200B;\n\nDue to the fact that I know the dimension of my weight matrix, e.g MxN, I konw that --> (learning\\_rate)\\*(-grad2\\*dI\\_dW) <--- needs to have this same dimensions. With this, the only possibility to achieve the dimension MxN is if I realize the operation dI\\_dy.\\*dI\\_dy, where the operator \".\\*\" will multiply each one of the elements of the dI\\_dy by each element of dI\\_dy, resulting in the (1xn).\n\n&#x200B;\n\nMy doubt is: In the math, -->dI\\_dy\\*dI\\_dy<--- is just a multiplication, but when I'm coding, it appears that I will need to use the \".\\*\", but I don't know if this is correct.\n\n&#x200B;\n\nJust to know, I´m programming in MATLAB.\n\nSorry by the long text and if I didn't was clear enough, please let me know (I'm not an native english speaker).\n\n&#x200B;",
  "label": "r/neuralnetworks",
  "dataType": "post",
  "communityName": "r/neuralnetworks",
  "datetime": "2024-03-18",
  "username_encoded": "Z0FBQUFBQm5LakwxVVNlZ1V4aF8yUEtFWHl5OHkxTnRNclp5N2ZaMUsxWFJWcjJFcFk0SV92R3h5blhLYkprZDZGUmZxQmFzaEYyd1Y3ZzNqWHQ2ZXpvTGowV1I5WWg5eFE9PQ==",
  "url_encoded": "Z0FBQUFBQm5Lak9FZVZDQW0xQmNERFZNcElKWDFoWC03YTN0OHpKN3dJckFSNkw5SFRKRmRBd3BocHR5aERLam9SQy1ZbUZKOXBpZEhhMEdlZFV1RmZMMTlPV0ZxamxWd2tWVnZHbmhNNXVvMEEzYVR4eUxZOU9OQ29LSDFvT1ZobDkxZkZCZUJNa2VVWFJYWXlINEw1SGZRa2tqN1ZUbVdjRXlsSWx4czFZQ2VtQmVpVGppWEU2ZW5Ca1Y2OFI5dDFrTGl3NlJxNXp1XzdhTHp1ZUEyNkdPY1AtSzhReDMtUT09"
}

Entry Information