I am newbie to deep learning, I was building my first model using MNIST dataset, I understood the full model, but one thing is a bit confusing to me. How can we get the weights and bias? Is it that, weights are our input data or is it going to get assigned some random values and also bias or some of the weights.

It works based on this formula


2 Answers 2

                                      Y = Wx + b

Here, I am assuming that the h is in subscript :

  1. Y is the value that we want to predict
  2. x is the input
  3. b is the bias
  4. W is the weight

Now, the question that you asked If I understood clearly :

You want to know, How can you get the weight and Bias of your model ? And are the W input to your machine learning model or is it the neural networks task to find the weight for you ?

Weight W is the coefficient of the input x which when combined with bias b returns the predicted value Y. Note that weight W is the coefficient of the feature input x.

The sole aim to run a machine / deep learning algorithm is to find the best set of weights corresponding to each feature and the bias. The bias does not correspond to every weight w, It corresponds to each layer in the network.


Assuming that you have read some stuff on DL already. You might want to refer to these couple of videos Introduction: https://www.youtube.com/watch?v=aircAruvnKk

How a neural network learns: https://www.youtube.com/watch?v=IHZwWFHWa-w

They have a good visualization and helps in understanding how a neural network learns. Hope that helps.

We begin by assigning random weights(W) initially, and over iterations, NN assigns the optimal weights to them so that the accuracy/score is maximum.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.