-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
When I was reading 4.3.4 One-hot encoding, I am ok with the demonstrate about scatter_ method in this wine example. Although it took me some time to understand the index argument in the scatter_ method, the explain "target.unsqueeze(1)" makes sense to me. However, when I run the code in 4.4 Working with time series, I was confused with the comment that says "Decreases the values by 1 because weather situation ranges from 1 to 4, while indices are 0-based", obviously it makes sense too. And now I was wondering, the scores in 4.3 wine case ranges from 1 to 10, so in the case of 4.4 weather example, the code should be "target.unsqueeze(1) - 1" to get the right one-hot encoding. I also run these code snippets on jupyter notebook to testify my thought. Can anyone prove my thought? Thanks!
Explain the first and second picture: in the case of wine example, if the score is 6, then the one-hot encode should be [0,0,0,0,0,1,0,0,0,0], apparently it is not the result print from the code, so I think something went wrong.
picture 1