Quick and Cheap Prototyping of Deep Learning Models – A Review on Floydhub.com’s GPU Cloud Platform for Deep Learning

If you’ve been working on deep learning models on your laptop, then this is for YOU.

So, if you’ve seen my other projects, you’ll know that when I finish setting up my neural networks, I usually optimize them using a genetic algorithm. Now, up to this point, I’ve only used the genetic algorithm to work on Sklearn models; with usually 200 neural nets at a time.

However, work has required me to adapt this algorithm to a recurrent neural network, an LSTM (long short-term memory) to be exact. This being a deep learning model, it was a given that training will span from anywhere between 20 mins (for one neural net) to a couple of days. And that is exactly what started to happen when I ran the genetic algorithm.

Imagine training 20 LSTM models over 10 generations! 12 to 14 hours after I started running it, I found out that I was barely 10% into the 1st generation. This pushed me to look for an alternative. I didn’t want to go through the usual Google, AWS, etc. options, since I just really needed something for rapid prototyping.

After around 20 minutes of googling, I stumbled upon Floydhub.com. According to the website,

Screen Shot 2017-08-17 at 7.25.04 PM.png

Honestly, I think it’s a mix of Heroku and Github. I was drawn to this because you could run this using Terminal (I use a Mac, remember?). It was also very simple to use. It can run normal python scripts and Jupyter notebooks.

At the time of signing up, I got 2 hours worth of GPU run time. I knew this wasn’t going to be enough, but I needed a little bit more convincing before I sign up for a pay-as-you-go account.

Lo and behold, after setting up my directory (kinda like how you set up Github repos) and running a Jupyter notebook (it looks and feels exactly like a normal Jupyter notebook, minus the LOUD FAN NOISE), the genetic algorithm started eating over hundreds of epochs and several neural nets. So much so, that in about 20 mins, I had already overtaken the progress that I had achieved using my local CPU, which had been running for more than 14 hours.

Because I am very satisfied with the whole experience (from setting up to the actual training), I decided to share more details about this neat little GPU platform on the cloud.

Installing Floydhub using Terminal:

Screen Shot 2017-08-17 at 8.10.01 PM.png

Logging into Floydhub:

Screen Shot 2017-08-17 at 7.33.58 PM.png

Initializing the project:

Before initializing the directory, I had to create a project on the dashboard in my Floydhub account. Afterwards, all I had to do was run this command on my Terminal.

Screen Shot 2017-08-17 at 7.35.05 PM.png

Make sure to have your dataset in the directory.

Creating the floyd-requirements.txt (list of required dependencies):

Screen Shot 2017-08-17 at 7.41.10 PM.png

Opening a Jupyter Notebook:

Screen Shot 2017-08-17 at 7.38.56 PM.png

Take note of the environment code that I used: tensorflow-1.2:py2. I had to append the “:py2” because Floydhub runs on Python 3 by default. This environment already has Keras (which is what I’m using for this model). If you’re using other environments, you can check this page out.

Plans and Rates:

These are as of August 28, 2017. Check here for more updated rates.

Screen Shot 2017-08-17 at 8.14.26 PM.png

Screen Shot 2017-08-17 at 8.14.34 PM.png

Billing Dashboard:

Screen Shot 2017-08-17 at 8.12.21 PM.png





Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s