Skip to content
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

Make autoencoder easier to copy-paste #2215

Merged
merged 5 commits into from
Aug 14, 2023
Merged

Make autoencoder easier to copy-paste #2215

merged 5 commits into from
Aug 14, 2023

Conversation

beyarkay
Copy link
Contributor

@beyarkay beyarkay commented Apr 4, 2023

This PR simply removes the explicit (28, 28) and 784 which represented the shape of the FMNIST dataset.

It rather uses a shape member variable which is passed into the constructor for the Autoencoder. This shape variable is set to be shape = x_test.shape[1:] by default.

I often come to this page, since I forget exactly how to structure an Autoencoder in TF, and I always end up writing this little snippet out where I extract the shape variable into a member variable of the Autoencoder class.

This commit simply removes the explicit `(28, 28)` and `784` which represented the shape of the FMNIST dataset.

 It rather uses a `shape` member variable which is passed into the constructor for the Autoencoder. This `shape` variable is set to be `shape = x_test.shape[1:]` by default.
@beyarkay beyarkay requested a review from a team as a code owner April 4, 2023 12:40
@github-actions
Copy link

github-actions bot commented Apr 4, 2023

Preview

Preview and run these notebook edits with Google Colab: Rendered notebook diffs available on ReviewNB.com.

Format and style

Use the TensorFlow docs notebook tools to format for consistent source diffs and lint for style:
$ python3 -m pip install -U --user git+https://github.com/tensorflow/docs

$ python3 -m tensorflow_docs.tools.nbfmt notebook.ipynb
$ python3 -m tensorflow_docs.tools.nblint --arg=repo:tensorflow/docs notebook.ipynb
If commits are added to the pull request, synchronize your local branch: git pull origin patch-1

@beyarkay
Copy link
Contributor Author

beyarkay commented Apr 5, 2023

Just wanting to check in, and see if this sort of PR is welcome here?

@vijayasarathib
Copy link
Contributor

LGTM

@github-actions github-actions bot added the lgtm Community-added approval label Aug 13, 2023
Copy link
Member

@markmcd markmcd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the submission - this is great.

@markmcd markmcd added the ready to pull Start merge process label Aug 14, 2023
Copy link
Member

@markmcd markmcd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smoke tests found an issue.

site/en/tutorials/generative/autoencoder.ipynb Outdated Show resolved Hide resolved
Copy link
Member

@markmcd markmcd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@beyarkay
Copy link
Contributor Author

Thanks for the approval! How often are the docs re-built?

@markmcd
Copy link
Member

markmcd commented Aug 14, 2023

This one is updated nightly, but before it's merged it requires another internal review, so could take a day or two.

@copybara-service copybara-service bot merged commit 007d8f4 into tensorflow:master Aug 14, 2023
4 checks passed
@beyarkay beyarkay deleted the patch-1 branch August 14, 2023 19:24
@beyarkay
Copy link
Contributor Author

Thanks for helping out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm Community-added approval ready to pull Start merge process
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants