Do fastai videos and fastai's notebooks really help me become a good Python coder in lower level?

JonathanSum: <p>Level lower I mean that I don’t need to rely on Fastai to build Unet, Resent, Desnet, and more?</p>

ptrblck: <p>I’m sure you’ll get a better answer in the <a href="https://forums.fast.ai/">fast.ai forum</a> or from <a class="mention" href="/u/jphoward">@jphoward</a>, as they have a much better overview what the course teaches and focuses on.</p>
<p>However, I always recommend the courses, as I’m learning a lot of useful techniques you can apply later in your research. I would also see it independent from using “lower level” PyTorch methods. <img src="https://discuss.pytorch.org/images/emoji/apple/wink.png?v=9" title=":wink:" class="emoji" alt=":wink:"></p>

jphoward: <p>Part 2 of the course shows how to build most of fastai from scratch using nothing but PyTorch tensors and autodiff. It’s not easy, but if you work at it and complete this part of the course, you’ll be a very strong PyTorch coder and DL practitioner at every level (except for stuff requiring CUDA coding). Many folks presenting at NeurIPS and working at top DL centers studied thru fast.ai.</p>

tom: <p>The fastai courses do teach a lot of good things, but “good Python coding” without a lot of qualifications probably isn’t one of them.</p>
<p>Jeremy has been very outspoken that he doesn’t like Python and the fastai library clearly shows. There also are a lot of clever hacks around writing terse code that, shall we say, might not be universally seen as writing clear code for a library that can be built on. Now I do have a washlist of things I think are not so nice in PyTorch (e.g. spectral norm via hooks, default initialization, nondeterministic kernels…), but the structure of the API has been given quite a bit of thought and it shows.</p>
<p>The fast ai library versions 0.7, 1 and 2 seem to be really completely separate things with little bridges between them. The more mature PyTorch bits have been very stable since 0.4 or so (but if your code still uses 0.1.2/0.2/0.3-style <code>Variable(..)</code> a lot there is something to do…).</p>
<p>Don’t get me wrong, there are a lot of nice things to be found there and it is worth looking at, but – at least if you believe there is some truth to the Zen of Python –  there are also lots of things that are really dubious fads in terms of how things are done.</p>
<p>As for the lectures, they are great when they do show how to get results with neural nets, but in my opinion they are weaker when they go into “how to design a library”. For this reason, I would recommend Part II 2018 over the 2019 version. (Starting with the outright bizarre “Python is 1000 times too slow” claim in the first lecture 2019 that has been qualified in the second to last lecture when it didn’t support the story anyways, but never made the errata list of the first lecture.) So lots of great insights and a refreshing style, but the frequency of dubious claims seems a bit higher than, say, what you get with e.g. the courses Stanford put online.</p>
<p>So if the university-style lectures you can find are not to your taste, fastai’s offering is one of the very cool ones out there and one that doesn’t dumb down things wile being very accessible. That is quite some achievement.</p>
<p>I should really write a more in-depth review, but the above was my impression of the main pros and cons.</p>
<p>Best regards</p>
<p>Thomas</p>

jphoward: <aside class="quote no-group" data-username="tom" data-post="4" data-topic="68448">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/tom/48/3162_2.png" class="avatar"> tom:</div>
<blockquote>
<p>Don’t get me wrong, there are a lot of nice things to be found there and it is worth looking at, but – at least if you believe there is some truth to the Zen of Python – there are also lots of things that are really dubious fads in terms of how things are done.</p>
</blockquote>
</aside>
<p>That couldn’t be more wrong. The coding approach is built on <em>far</em> more years of research than Python has existed. The basic ideas go back to APL, developed in the late 1950’s.</p>
<p>For folks that are deeply immersed in just one way of doing things, this will be uncomfortable.</p>
<aside class="quote no-group" data-username="tom" data-post="4" data-topic="68448">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/tom/48/3162_2.png" class="avatar"> tom:</div>
<blockquote>
<p>Starting with the outright bizarre “Python is 1000 times too slow” claim in the first lecture 2019</p>
</blockquote>
</aside>
<p>This is nearly universally accepted as being true.</p>

tom: <p>Thank you for commenting on that.</p>
<p>I should indeed have said “idiosyncrasies” instead of “fads” and maybe “quite a few” rather than “lots”. What I was trying to express that in my observation some choices in the course seem to prefer terseness over concepts like <em>explicit over implicit</em> or <em>sparse over dense</em> and thus does not necessarily seem exemplary on the way to <em>become a good Python coder</em> as the question was put.<br>
In the end it is your choice to disregard the things people generally to see as enhancing clarity in Python code. That is cool for you to do, but I view it as distracting form the value from the course.</p>
<aside class="quote no-group" data-username="jphoward" data-post="5" data-topic="68448">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/jphoward/48/16771_2.png" class="avatar"> jphoward:</div>
<blockquote>
<p>That couldn’t be more wrong. The coding approach is built on <em>far</em> more years of research than Python has existed. The basic ideas go back to APL, developed in the late 1950’s.</p>
</blockquote>
</aside>
<p>Part of what strikes me as a weakness of the course that in between valuable takeaways there are passages similar to the above – it almost looks like a strong argument for your coding approach until one asks oneself what exactly (I paraphrase) “our coding approach is based on research that in part predates Python” actually says about the superiority of your coding approach over a more pythonic one.</p>
<aside class="quote no-group quote-modified" data-username="jphoward" data-post="5" data-topic="68448">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/jphoward/48/16771_2.png" class="avatar"> jphoward:</div>
<blockquote>
<blockquote>
<p>Starting with the outright bizarre “Python is 1000 times too slow” claim in the first lecture 2019</p>
</blockquote>
<p>This is nearly universally accepted as being true.</p>
</blockquote>
</aside>
<p>The timing presented measured roughly “slowness of Python + slowness of creating lots of Tensors (relatively complex objects) in the hot loop” and it seems bizarre to conclude “Python is thousands of times too slow” in the context of a lecture emphasizing performance measurement as much as it did. Part of the disappointment might be that more controlled experimentation would have been quite easy to have. So in between other things, there is this bit presented with lots of emphasis that looks almost right but is, in reality, quite off.</p>
<p>So again, I do recommend the course, but the frequency of things like the above seems higher than in, to pick a random example, Chris Manning’s cs224n course.</p>
<p>Best regards</p>
<p>Thomas</p>