Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exercise 3 in 2.1 np.roll is used to change 1st row with last not first column with last column #80

Open
bilalayaz2 opened this issue Jun 28, 2021 · 0 comments

Comments

@bilalayaz2
Copy link

bilalayaz2 commented Jun 28, 2021

`

  1. //Setup the parameters you will use for this exercise
  2. input_layer_size = 400 // 20x20 Input Images of Digits
  3. hidden_layer_size = 25 // 25 hidden units
  4. num_labels = 10 // 10 labels, from 0 to 9

6.//Load the .mat file, which returns a dictionary
7. weights = loadmat(os.path.join('Data', 'ex3weights.mat'))
8.
9. //get the model weights from the dictionary
10. // Theta1 has size 25 x 401
11. //Theta2 has size 10 x 26
12. Theta1, Theta2 = weights['Theta1'], weights['Theta2']
13.
14. //swap first and last columns of Theta2, due to legacy from MATLAB indexing,
15. //since the weight file ex3weights.mat was saved based on MATLAB indexing
16. Theta2 = np.roll(Theta2, 1, axis=0)

`
here we are swapping first and last row not column (as stated in line 14 [which is incorrect]) with axis = 0 (in line 16) not column .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant