dsgiitr / d2l-pytorch

This project reproduces the book Dive Into Deep Learning (https://d2l.ai/), adapting the code from MXNet into PyTorch.
Apache License 2.0
4.24k stars 1.24k forks source link

Implement `d2l.train_ch3()` #4

Closed aksub99 closed 5 years ago

aksub99 commented 5 years ago

To exactly replicate the book, function d2l.train_ch3() function would be a necessary addition. This function is to be called during training from the implementations in other chapters as well. This would be more convenient than writing the training loop each and every time. Infact, all training loops required in the book can be added to train.py similar to https://github.com/d2l-ai/d2l-en/blob/8e53fce19c6c744cf4994a896c43e382567e6fbc/d2l/train.py#L1

AnirudhDagar commented 5 years ago

Yeah! This was discussed in the last meet. For example, look at this script, this is a pytorch replica of the original one and is used in later sections of the book like you pointed out. So if you create a section notebook which calls a particular function from the d2l package, then please implement that and add it there (in a similar manner as the original book does)as well for future use, if it is not present already.

aksub99 commented 5 years ago

I'll submit a PR implementing d2l.train_ch3() soon. It would be great if this issue could be assigned to me.