[Blog post] Understanding callbacks in fastai

Hello everyone!

As callbacks were one of the important topics in lesson9 (and more broadly they are one of the great thing about fastai) and that I saw a lot of discussion about them on the forums, I decided to make a blog post explaining them as best as I could.

You can it on the following link: https://pouannes.github.io/blog/callbacks-fastai/

Of course feel free to make any suggestion or comment, all feedback is most welcome! In particular I didn’t talk about the details of how callbacks are implemented in fastai (things like how the CallbackHandler works, same thing for the LearnerCallback) so if you’d like an explanation fo those please tell me.

11 Likes

I wrote something similar few weeks ago but it’s more general and not tight to fastai callbacks https://dzlab.github.io/dl/2019/03/16/pytorch-training-loop/

2 Likes

Nice… Sylvain Gugger recently gave a talk on FastAI Training loop where we went into Callback implementation in detail - https://www.youtube.com/watch?v=roc-dOSeehM

Ah…just realized that @PierreO referenced this talk in his blog post. Nice summary. Enjoyed the blog post.

2 Likes

Just a note: I figured out that callback-based approach to deal with different stages of training was adopted in Keras back in late 2017. Both seems similar so people looking for resources could take advantage of that. Like this introduction:

That’s quite a small subset of the functionality required to implement many of the callbacks discussed in the course, unfortunately.

Yep, I noted. In fact, I think that fastai callbacks are way better/complete than keras’ ones nowadays, and the way you introduced them in the course is the best resource someone can get. I only added that reference because I thought it might help someone looking for extra aid. :smiley:

1 Like