-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why do you use your own API #2343
Comments
If you would like to read the regular PyTorch code, you may still access that at https://classic.d2l.ai |
It's like dealing with keras. Reading the code of your book is like dealing with a new language. Someone on reddit said that your book wasn't usable because it uses its own api, and I have to agree that it's not accessible anymore, you can't just read it to understand something, first you have to understand what your api does. Will the classicdhttps://classic.d2l.ai/ still be mantained, or will it die? Even the classic has a wide use of your api. |
Thanks but even that isn't classic, it's still full of api calls. d2l.load_data_fashion_mnist(batch_size=batch_size) |
@GianniGi I understand your concern and welcome your feedback.
If we don't save methods in the d2l lib, that would result in repeated and redundant code. Some code blocks can be utilized again in the latter sections of the book and hence we save them in the d2l lib of the classic version. In a section later, when the same method is used, we can take advantage of the d2l library to call the method without repeating the code. In this case, https://classic.d2l.ai/chapter_linear-networks/image-classification-dataset.html introduces and explains all the inner workings of
If you read the book sequentially, we explain and introduce all the saved methods one by one. In case sequential is not what you are looking for, you can always refer to https://d2l.ai/chapter_appendix-tools-for-deep-learning/d2l.html to find which section defines a particular d2l function. In the classic version we don't have a wrapper API of any kind, it is just some saved methods which are reused. So essentially the code is still pure PyTorch/TensorFlow/MXNet. |
Nobody reads a 1000 pages book from the beginning to the end. If you want to save some space, just use some code folding with explicit reference to previous code (i.e. see chapter x for explanation), nothing easier than that. And that's what every author is doing. This is the first time that I see someone using his own api. This book is soon going to be something like lighning or fastai, unusable by definition.
Nobody reads a book sequentially. Books are used also as reference material. You call your book Dive into Deep Learning, and the ironic part is that you can't dive anywhere, you just have to read your book from the beginning. You should rename it Sequentially and slavishly walk into deep learning.
In the classic book you still use your api for many tasks. And surely in the next editions there will be no more classic versions. |
By the way they stole the title of your book https://www.amazon.com/Dive-Into-Deep-Learning-Engagement/dp/1544361378 |
I had the same concerns while reading the book, it indeed seems like you have to learn a 'new programming paradigm', but when you think about it, it is actually necessary and understandable why they decided to do it like that (even fast.ai has the same approach), there are some levels of abstraction covered by these API that would confuse people who are just getting started, and the book indeed does a good job presenting the logic behind their implementation on the OOP chapter. Nevertheless, I saw myself referring back to the implementation of the paradigm more often than necessary, so I wrote this Jupyter Notebook to solidify my understanding of the basic components of the API. On the other hand, I took it as an opportunity to implement the algorithm on my own in plain PyTorch. So take it as an opportunity for you to implement the algorithm in plain PyTorch or TensorFlow if you like |
Since the API is just made of pure and simple substitutions, why don't they
simply make a full version without their API? It should be trivial for
them.
I just want to learn pytorch.
Il giorno mercoledì 29 marzo 2023, cx-olquinjica ***@***.***>
ha scritto:
… I had the same concerns while reading the book, it indeed seems like you
have to learn a 'new programming paradigm', but when you think about it, it
is actually necessary and understandable why they decided to do it like
that (even fast.ai has the same approach), there are some levels of
abstraction covered by these API that would confuse people who are just
getting started, and the book indeed does a good job presenting the logic
behind their implementation on the OOP chapter.
Nevertheless, I saw myself referring back to the implementation of the
paradigm more often than necessary, so I wrote this Jupyter Notebook
<https://github.com/cx-olquinjica/Deep-Learning-Personal-Notebooks/blob/main/whatisd2lreally.ipynb>
to solidify my understanding of the basic components of the API.
On the other hand, I took it as an opportunity to implement the algorithm
on my own in *plain PyTorch*. So take it as an opportunity for you to
implement the algorithm in plain PyTorch or TensorFlow if you like
—
Reply to this email directly, view it on GitHub
<#2343 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACG2GHH6ODOMP7OULJG7GALW6PIMFANCNFSM6AAAAAASCEYTUQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
You just got yourself a chance to practice more. The goal of the project is to teach Deep Learning concepts, you can still learn PyTorch by the side, and as I mentioned earlier take it as an opportunity to solidify your understanding of the concepts explained in the book by implementing them in plain PyTorch. |
Deep learning is difficult.
Pytorch is difficult.
Why should I make it nearly impossible? That's plain wrong.
Il giorno mercoledì 29 marzo 2023, cx-olquinjica ***@***.***>
ha scritto:
… *You just got yourself a chance to practice more*. The goal of the
project is to teach Deep Learning concepts, you can still learn PyTorch by
the side, and as I mentioned earlier take it as an opportunity to solidify
your understanding of the concepts explained in the book by implementing
them in *plain PyTorch*.
TL:DR Don't think of it as a limitation, it is actually an opportunity. What
is torch.nn really?
<https://pytorch.org/tutorials/beginner/nn_tutorial.html>
—
Reply to this email directly, view it on GitHub
<#2343 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACG2GHHPUE4XND5EILOFCFDW6PTRNANCNFSM6AAAAAASCEYTUQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I wonder why are you using an API, instead of regular pytorch code.
It makes everything look unfamiliar and impractical. It's like a new language. Like having to learn everything again.
The text was updated successfully, but these errors were encountered: