I’ll join you. Can we maybe have a call tomorrow? I very thoroughly looked into DataLoaders and Transforms and also have a write up on TypedList from around 2-3 months ago. Would love to jump on a call and get back into this.
Hey @arora_aman, thanks for the resource! Always wanted to learn vim properly but didn’t invest the time mainly due to lack of good suggestions on learning source for it! Will definitely check theirs out!
That’s strange. Could you try doing a pip install of the fastai2 in vs code again since I believe you’re using its virtual environment where fastai2 isn’t available…
Open up the fastai2 and fastcore folders in sublime text. (could be VS Code based on your preference)
Open up a Jupyter notebook.
Decide what to work on/understand and copy it’s source code into Jupyter.
Read every line, put comments based on what I understand, and wade through the source code using sublime text (any IDE works) when needed.
For the bits I find weird, I’d try and run something similar in the Jupyter notebook.
I don’t always do a set_trace and follow through the source code. For me personally, I’ve had a lot of practice with just looking at code with parameters in my head and keeping a sort-of mental stack trace of where things are at the moment and I find this better for my purposes. Also, given the fact that there’s an insane amount of loops all over the place, I wouldn’t want to trouble myself with stepping through them in a debugger.
This ends up working very well for me. Of course, it can be different for different people.
One advantage of keeping a mental stack trace is that I don’t need to be on the server or Colab and be running things on a GPU. I have a fair idea of how arrays/tensors work on a GPU so I can just do this exercise on my MacBook.
I’ve used a similar thing in PyCharm. It definitely does help, no doubts about that. But for me personally, this helps in cases when there’s a bug in my code, not when I’m simply trying to understand someone else’s code. But that’s just me, I guess.
I was finding some new things with python while reviewing the fastai2 code which I haven’t used before so it make sense for me to actually look up the method/function, before and after the method gets applied to data in order to visually understand whats happening.
Personally for me, its important for me to visualize in my mind whats actually happening and if I can’t do that, then I don’t understand it (applies to any topic… )
Yup. I have trouble quite a few times when going through FastAI source code because there’s a lot of clever bits in it which I have never seen before. That’s the reason why I always keep a jupyter notebook on at all times so I can execute, modify and completely understand what’s there.
I had hard time with VS Code too, I now maintain a clone of fastai2 repo and added that as a workspace. For me code navigation in VS code is a life saver, with jupyter I’m always confused which is where.