Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
coding neural network
#1
Hi everyone,

I'm doing an online coure in Coursera (Neural Networks and Deep Learning), but I'm a little confused of the pre-writed code lines.In the programming assignment the tutor don't expain well the function of this instructions.

I have uploadaed the docx file containing the questions:
https://docs.google.com/document/d/19A7e...a2v-l/edit

this is the source code/solution for the programming assignment on github:

https://github.com/Kulbear/deep-learning...ayer.ipynb
Reply
#2
1. W1 is the weight matrix and is the shape going between input and first hidden layer
2. Use np.shape(w1)
3. Input layer will be the number of features. For example, this is one of my model input layers, left it flexible for me so if I change data structure I don't have to chase down and change the input layer.
layers.Dense(64, activation='relu', input_shape=[len(train_dataset.keys())])
4. You can create your own repository. Go to GitHub and sign up. Using them is not intuitive, but pretty easy once you get used to it. I suggest "A Practical Guid to Git and Github for Windows Users from Amazon.
5. The function initialize_parameters_test_case() (look in your code) returns 3 values.
6. Same as #2
7. print type of logprobs to see what it is. That may help.
8. layer_sizes by itself should print the layer_sizes. predictions=np.round(A2) will round A2
9. Yes
10. https://www.geeksforgeeks.org/enumerate-in-python/
Reply
#3
1. this command can not be executed, it returns an error message: "NameError: name 'W1' is not defined"

4. Recently I wouldn't buy this book, but I have already registered on github and created my own project, I suppose I have to upload my ipynb file but then what? (I think it is possible to write the code in the jupyter notebook what is connected to my github project).

5. The function initialize_parameters_test_case() (look in your code) returns 3 values.

I have runned this code: type("logprobs") and it returned : str
but this command doesn't work: print(logprobs) --> "name 'logprobs' is not defined"

9. in the documentation: "predictions -- vector of predictions of our model (red: 0 / blue: 1)"
so in this case I think "predictions" is an array and it contains a predictive value for all (400) examples. It is right?
Reply
#4
1. W1 is defined in In[9] of your posted code. That cell needs to be executed before you can print.
4. Typically you will create a repository on your computer and sync the two. See the book.
5.
type("anthing you like")
will return str, because anything in quotes is a string.
9. Looks like. try
print(predictions.shape)
Reply
#5
ok, thanks for your help
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Neural network and data analysis from clients survey result pthon3 2 1,864 Mar-17-2022, 02:21 AM
Last Post: jefsummers
  Multilayer Perceptron Neural Network erdemath 3 2,282 Aug-09-2021, 11:07 PM
Last Post: jefsummers
  Neural Network importance weights / coefficients jkaustin 1 2,027 Nov-10-2020, 07:44 PM
Last Post: jefsummers
  Get error message in a GAN neural network tutorial jdude50 0 1,648 Oct-22-2020, 11:11 PM
Last Post: jdude50
  Explain Me Neural Network Ai's Harshil 2 1,970 Oct-22-2020, 04:50 AM
Last Post: Harshil
  construction of Neural Network for solving Differential equations arshad 0 1,607 Jun-04-2020, 09:20 AM
Last Post: arshad
  Neural Network mensagem error Dalpi 2 2,826 May-20-2020, 04:03 PM
Last Post: Dalpi
  Why does this simple neural network not learn? PythonIsGreat 1 2,082 Aug-30-2019, 05:49 PM
Last Post: ThomasL
  First neural network: Problem with the weight factos 11112294 0 2,141 Jan-12-2019, 09:11 PM
Last Post: 11112294
  Neural network nesrine 0 2,613 Dec-11-2018, 03:48 PM
Last Post: nesrine

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020