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

Keras basic text classification tutorial: removed +1 from embeddings … #2256

Conversation

vaharoni
Copy link
Contributor

…input dimensions

In the Tutorials > Beginner > ML basics with Keras > Basic text classification, there is the following code:

max_features = 10000
sequence_length = 250

vectorize_layer = layers.TextVectorization(
    standardize=custom_standardization,
    max_tokens=max_features,
    output_mode='int',
    output_sequence_length=sequence_length)

# ...

model = tf.keras.Sequential([
  layers.Embedding(max_features + 1, embedding_dim),
  layers.Dropout(0.2),
  layers.GlobalAveragePooling1D(),
  layers.Dropout(0.2),
  layers.Dense(1)])

I believe the +1 in max_features + 1 is unnecessary, as the vocabulary of TextVectorization layers already includes the padding and OOV tokens.

@vaharoni vaharoni requested a review from a team as a code owner August 25, 2023 14:25
@google-cla
Copy link

google-cla bot commented Aug 25, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@github-actions
Copy link

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 vaharoni/text-classification-fix

@8bitmp3 8bitmp3 added the review in progress Someone is actively reviewing this PR label Aug 29, 2023
@8bitmp3 8bitmp3 assigned MarkDaoust and unassigned MarkDaoust Sep 20, 2023
@8bitmp3
Copy link
Contributor

8bitmp3 commented Sep 20, 2023

@MarkDaoust

@MarkDaoust MarkDaoust added the ready to pull Start merge process label Sep 27, 2023
@8bitmp3 8bitmp3 added the cla: no CLA has not been signed label Nov 1, 2023
@8bitmp3
Copy link
Contributor

8bitmp3 commented Nov 1, 2023

@vaharoni Thanks again for the PR. Can you check the cla/google link below and sign the CLA is you haven't done so already https://github.com/tensorflow/docs/actions/runs/5977063575/job/16982580897?pr=2256

@vaharoni
Copy link
Contributor Author

vaharoni commented Nov 2, 2023

I have already signed the CLA, and this was picked up correctly on a different PR I made. When I visit the CLA page, it says "It looks like you've already signed this CLA. If you'd like to edit your contact information, you may do so below." I clicked on "I agree" again nevertheless. Let me know if you need me to do anything else.

@MarkDaoust
Copy link
Member

@google-cla try again

@google-cla google-cla bot added cla: yes CLA has been signed and removed cla: no CLA has not been signed labels Nov 2, 2023
@MarkDaoust MarkDaoust added ready to pull Start merge process and removed ready to pull Start merge process labels Nov 2, 2023
@MarkDaoust
Copy link
Member

Sorry about the delay, we should be good to go now.

@copybara-service copybara-service bot merged commit 60abeb0 into tensorflow:master Nov 2, 2023
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes CLA has been signed ready to pull Start merge process review in progress Someone is actively reviewing this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants