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

Test the Transforms tutorial #2896

Open
sekyondaMeta opened this issue Jun 4, 2024 · 6 comments
Open

Test the Transforms tutorial #2896

sekyondaMeta opened this issue Jun 4, 2024 · 6 comments

Comments

@sekyondaMeta
Copy link
Contributor

sekyondaMeta commented Jun 4, 2024

Test the following tutorial:
https://pytorch.org/tutorials/beginner/basics/transforms_tutorial.html
Follow these steps:

  1. Fork the pytorch/tutorials repo.
  2. Switch to a new branch.
  3. Run the tutorial as a python script:
python3 <path-to-tutorial>
  1. Save the output into a .txt file. Did you see any errors? Add them to the output.
  2. Run the tutorial in the Google Colab and save the outputs into a .txt file. Did you see any issues? Take screenshots of the issues.
  3. Did the tutorial make sense? Can you suggest any improvements? Past all the outputs, screenshots, and suggestions for improvements in the issue and ping one of the reviewers. If your suggestion is approved, please submit a PR with the fix.

cc @svekars @kit1980

@saurabhkthakur
Copy link

/assigntome

@akhil-maker
Copy link

/assigntome

Copy link

github-actions bot commented Jun 4, 2024

The issue is already assigned. Please pick an opened and unnasigned issue with the docathon-h1-2024 label.

@saurabhkthakur
Copy link

Hi @svekars @kit1980
There was no issue while running this tutorial as python script and in Google colab.
gcp_testing.txt
local_testing.txt
Updated_Documentation..txt
May be we can explain the last part as

Updated Documentation Part

To represent categorical labels as one-hot encoded tensors, we start with an initial tensor array of zeros. For labels ranging from 1 to 10, the initial tensor array will be:
torch.zeros(10, dtype=torch.float) will give [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]
Given a specific label for an image, say 3, the value 1.0 will be assigned to the corresponding index in the tensor array. Since indices start from 0, the label 3 will correspond to index 2. Thus, the final one-hot encoded tensor array will be:
torch.zeros(10, dtype=torch.float).scatter_(dim=0, index=torch.tensor(y), value=1) will give [0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]

@brycebortree
Copy link

Hi, @subramen, do these suggestions for the Transforms tutorial sound good?

@kit1980
Copy link
Member

kit1980 commented Jun 18, 2024

@saurabhkthakur maybe create a PR with the updated doc so people can see it and review?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants