Row 3647
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).
​
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.
​
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).
​
| Field | Value |
|---|---|
| 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. ​ During the backward pass I wrote something similar to this( just to know, I´m writing the code in samsung notes before coding): ​ % 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​\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​\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​\n\nW2 = W2 -(learning\\_rate)\\*(-grad2\\*dI\\_dW)\n\n​\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​\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​\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​\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​",
"label": "r/neuralnetworks",
"dataType": "post",
"communityName": "r/neuralnetworks",
"datetime": "2024-03-18",
"username_encoded": "Z0FBQUFBQm5LakwxVVNlZ1V4aF8yUEtFWHl5OHkxTnRNclp5N2ZaMUsxWFJWcjJFcFk0SV92R3h5blhLYkprZDZGUmZxQmFzaEYyd1Y3ZzNqWHQ2ZXpvTGowV1I5WWg5eFE9PQ==",
"url_encoded": "Z0FBQUFBQm5Lak9FZVZDQW0xQmNERFZNcElKWDFoWC03YTN0OHpKN3dJckFSNkw5SFRKRmRBd3BocHR5aERLam9SQy1ZbUZKOXBpZEhhMEdlZFV1RmZMMTlPV0ZxamxWd2tWVnZHbmhNNXVvMEEzYVR4eUxZOU9OQ29LSDFvT1ZobDkxZkZCZUJNa2VVWFJYWXlINEw1SGZRa2tqN1ZUbVdjRXlsSWx4czFZQ2VtQmVpVGppWEU2ZW5Ca1Y2OFI5dDFrTGl3NlJxNXp1XzdhTHp1ZUEyNkdPY1AtSzhReDMtUT09"
}
Entry Information
- Entry ID: 3647
- Repository: Axioma AXP
- Dataset: arrmlet/reddit_dataset_36
- Total Entries: 100,000