LxMLS / lxmls-toolkit

Machine Learning applied to Natural Language Processing Toolkit used in the Lisbon Machine Learning Summer School
Other
222 stars 216 forks source link

Remove references to torch.autograd.Variable (Fix #203) #204

Closed bpopeters closed 2 months ago

bpopeters commented 2 months ago

This pull request updates the pytorch code for non-linear classifiers and non-linear sequence models so that they do not explicitly use torch.autograd.Variable. Wrapping tensors in Variable objects has not been necessary since pytorch 1.0. Their continued inclusion in our materials is likely to cause student confusion. I did not apply the same changes to the reinforcement learning code as it is not part of this year's curriculum (right?).

I also made a handful of small cosmetic changes to unify style between the pytorch log-linear, MLP, and RNN models.

Corresponding changes will also be necessary in the student branch (and maybe the guide as well?).