fchollet / deep-learning-with-python-notebooks

Jupyter notebooks for the code samples of the book "Deep Learning with Python"
MIT License
17.97k stars 8.48k forks source link

Edited codeblock 7.26: Made the CustomModel independent of previous model. #182

Closed var-nan closed 2 years ago

var-nan commented 2 years ago

In code block 7.26, If the sub-block alone is executed, it generates NameError: name 'model' is not defined. The subclass CustomModel uses the optimizer and trainable weights that were defined in the previous model. By accessing the actual optimizer and trainable weights that passed to CustomModel's compile(), the subclass can be made independent of the previously defined model and can eliminate the mentioned error.

fchollet commented 2 years ago

Thanks for the PR! The change looks right. However there are a lot of extra lines being changed in the PR. Can you please limit to change to the specific lines being edited?

var-nan commented 2 years ago

In the previous commit, most of the changes occurred because of the auto-update of cell numbers in Jupyter-notebook. The number of changes is reduced in this commit.

fchollet commented 2 years ago

Thanks!