C2_W1_Lab01_Neurons_and_Layers Logistic Regression Layer

Hi everyone.

I’m a bit confused on how the weights for the layer turned out to be 2 and -4.5. I don’t think we have manually assigned this value to the layer anywhere. So where did these two weights came from?



When a layer is created, it is automatically initialized to some random values.
When I ran the notebook, I got different initial weights, as expected.

1 Like

Ah, I see. I think it may be a coincidence that when I first ran the code the value is identical to the two numbers we set manually in the later lines. Thank you!

That would be an unusual coincidence.

Note that you should re-run all of the cells any time you work on the notebook.

I do not see training output data (Y_train) used by tensorflow for linear regression. How are the weights calculated to best fit the model and yet tensorflow prediction is dead on?

Training in supervised learning always requires labeled data.

However there is no training performed in this lab. It just experiments with various weight values you change by hand.