pytorch / tutorials

PyTorch tutorials.
https://pytorch.org/tutorials/
BSD 3-Clause "New" or "Revised" License
8.14k stars 4.04k forks source link

Test the Transforms tutorial #2896

Open sekyondaMeta opened 4 months ago

sekyondaMeta commented 4 months ago

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>
  4. Save the output into a .txt file. Did you see any errors? Add them to the output.
  5. 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.
  6. 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 commented 4 months ago

/assigntome

akhil-maker commented 4 months ago

/assigntome

github-actions[bot] commented 4 months ago

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

saurabhkthakur commented 4 months ago

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 commented 3 months ago

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

kit1980 commented 3 months ago

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