tutorials icon indicating copy to clipboard operation
tutorials copied to clipboard

Test the Transforms tutorial

Open sekyondaMeta opened this issue 1 year ago • 6 comments

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

sekyondaMeta avatar Jun 04 '24 13:06 sekyondaMeta

/assigntome

saurabhkthakur avatar Jun 04 '24 17:06 saurabhkthakur

/assigntome

akhil-maker avatar Jun 04 '24 18:06 akhil-maker

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

github-actions[bot] avatar Jun 04 '24 18:06 github-actions[bot]

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]

saurabhkthakur avatar Jun 04 '24 18:06 saurabhkthakur

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

brycebortree avatar Jun 12 '24 19:06 brycebortree

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

kit1980 avatar Jun 18 '24 18:06 kit1980