Fast.ai with R

No, it is not a feature request, and yes, apparently it exist. It is not a wrapper like it is for Keras with R, it is just a “brute force”, or maybe quite elegant use of reticulate (a library to call python stuff from R). If you are curious of it, I invite you to jump directly to 11 minutes, where the learner etc are store in R objects (first part is just the level zero of reticulate : just passing python script inside reticulate).

Even as a R user it blow a bit my mind. My guess is that the good writing of the fast.ai library with clean classes and methods allow to write this kind of things in R :

fastai$ImageList$from_df

without having everything exploding in hands.

Anyway, i just wanted to share this curiosity and made the fast.ai community aware of the existence of this possibility. And the other R users that could came to learn deep learning with fast.ai could be willing to use it, at least for the fun of it.

Actually I wonder if we can go further in the R style of writing and use the pipe %>%, to push the concept to its limit.

The code is here : https://github.com/Appsilon/fastai-in-r/blob/master/2_train_R.Rmd

4 Likes

Thank you for sharing this! Fastai was one of the reasons why I moved from R to Python, but I still miss some things from coding in R.

You are welcome !

Me I came back to R at the moment with Keras. You know what ? If I use fast.ai with R on kaggle (and I think I will for the fun of it) I will share my kernel here. It could be nice to have a list of kernel to document how it work inside R.

1 Like

I was actually using reticulate last week. What a coincidence. Piping would definitely be a good feature to add to it.