-
-
Notifications
You must be signed in to change notification settings - Fork 44
Migrating the Keras backend to PyTorch #624
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…backend. NOTE: The PyTorch version of the model is not learning well unless the features are normalised.
Thank you!Thank you for your pull request 😃 🤖 This automated message can help you check the rendered files in your submission for clarity. If you have any questions, please feel free to open an issue in {sandpaper}. If you have files that automatically render output (e.g. R Markdown), then you should check for the following:
Rendered Changes🔍 Inspect the changes: https://github.com/carpentries-lab/deep-learning-intro/compare/md-outputs..md-outputs-PR-624 The following changes were observed in the rendered markdown documents: What does this mean?If you have source files that require output and figures to be generated (e.g. R Markdown), then it is important to make sure the generated figures and output are reproducible. This output provides a way for you to inspect the output in a diff-friendly manner so that it's easy to see the changes that occur due to new software versions or randomisation. ⏱️ Updated at 2025-12-09 15:41:19 +0000 |
carschno
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good start, thanks!
I would prefer to not change the X_train and X_test capitalization here because there are many other places in the lesson and in the slides which use it, and they should remain consistent.
| from sklearn.model_selection import train_test_split | ||
|
|
||
| X_train, X_test, y_train, y_test = train_test_split(features, target, test_size=0.2, random_state=0, shuffle=True, stratify=target) | ||
| x_train, x_test, y_train, y_test = train_test_split(features, target, test_size=0.2, random_state=0, shuffle=True, stratify=target) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer X_train/X_test to remain consistent with the capitalization across all episodes.
|
|
||
| Keras is a machine learning framework with ease of use as one of its main features. | ||
| It is part of the tensorflow python package and can be imported using `from tensorflow import keras`. | ||
| It is a standalone python package that supports multiple deep learning frameworks as backends, and it can be imported using `import keras`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| It is a standalone python package that supports multiple deep learning frameworks as backends, and it can be imported using `import keras`. | |
| It is a Python package that supports multiple deep learning frameworks as backends, and it can be imported using `import keras`. |
| ::: spoiler | ||
|
|
||
| ### On Linux/macOs | ||
| ### On Linux/MacOS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also no need to change this. This is how "macOs" is written, at least nowadays.
|
|
||
| ## Testing Keras Installation | ||
| Keras is available as a module within TensorFlow, as described in the [setup instructions](learners/setup.md#packages). | ||
| Keras is available as a standalone package, as described in the [setup instructions](learners/setup.md#packages). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch. Clearly some of the narrative has to be changed too!
Moving to PyTorch as the Keras backend.
Closes #602