Deep Learning in R x Python

keras

#1

For a person who's trying to learn deep learning, how far can R take me? I know the keras package is a big step in that regard, but I can't find many resources other than the Deep Learning with R book. I have 0 experience with Python but almost all the online courses use it, so I started to think about whether I would need to learn it in order to do some advanced deep learning, but I really didn't want to spend the time learning another language. So I guess what I wanted to know is: can R do the same things Python does in deep learning? And what are some good resources to help me learn it?

Thanks in advance!


#2

Buy the Deep Learning for R book and read it cover-to-cover and then head on over to RStudio's learning resources to dive into more examples.

With respect to Python versus R, I see no reason to start a language war, choose whichever suits you.

The Keras R-package is an API calling the Keras Python API, which calls the TensorFlow Python API, which calls the TensorFlow C++ core library, so if you can do it in Python, you can do it in R :sunglasses:


#3

Yeah, I think @Leon's advice is as good advice as anybody could give. Python houses most if not all of the major open-source deep learning libraries, and most of the big advances in open-source deep learning software are in Python. So if "deep learning" in and of itself is what you're interested in, I think it would be a good idea to start learning some Python.

At the same time, if you're interested in general machine learning/modeling, I think you should stick with R for the time-being and follow what @Leon said. Also, I don't know how comfortable you are with the tidyverse, but from my experience, getting really comfortable with the tidyverse is helpful for learning Python if you decide to do that. I find the syntax of the two to be way more similar than Python is with base R.

Also I'm not that educated with deep learning, but it seems to me that understanding the theory behind different neural networks -- moreso than how to code them -- is pretty valuable. I've heard lots of good things about Andrew Ng's Coursera course on deep learning (which I think is just theory).


#4

Thanks for the replies, @Leon and @eoppe1022! I actually just started taking the Andrew Ng course, but it does use Python. That's why I thought it would be interesting to find resources where you could immediatly apply the theory in R. I am very comfortable with the tidyverse, so I feel better knowing that it would be helpful if I ever decide to go in that direction. But before that, I'll follow Leon's advice and read the book cover-to-cover and dive into more examples. Also, if anyone knows about some examples beyond the ones in the keras website, please let me know.


#5

Yeah I asked something similar a few months back, so maybe there's something good here for you


#6

Maybe @Leon is too modest to link himself, but he posted slides from a talk you might be interested in just the other day:


#7

oh shit this is great. thanks for sharing!


#8

Thanks for the kind words @eoppe1022 and @jcblum :+1:

...and @eoppe1022, I did actually put this minimal Keras example using TidyVerse up on GitHub - Please feel free to get inspired :slightly_smiling_face:

#sharingIsCaring


#9

This is great! Thanks!


#10

Nothing to add other than I have been using Keras in R on Tensorflow; it was very slightly tricky to install on the GPU due to one file, but it is really easy to use and runs pretty fast compared to my native R code on neural networks. I plan to use it for some customer projects.