How does a Neural Network formed by the Sequential, Dense function set its weights?

We built a NN using the Dense and the Sequential functions. But how did we get to this and how did the Neural Network set its weights?

The one thing which causes a deeper confusion is that we didn’t use the fit or the compile function till then and before that we were accessing the weights.

I am terribly confused with this first week

1 Like

Hi @Sparsh22 ,

The weights and bias are generated by Tensorflow. Please refer to the Tensorflow model section of the notebook for detailed explanation.

Hi @Sparsh22 Great question!!

The reason why you were able to access to the weights before using the compile function is because they are randomly initialize when the model is created, after that the training improves the weights with the data that you have.

Please let me know if this answers your question.

That clears a lot of things up, thank you so much. @pastorsoto

1 Like