/R-Deep-Learning

Workshop (6 hours): Deep learning in R using Keras. Building & training deep nets, image classification, transfer learning, text analysis, visualization

Primary LanguageR

R Deep Learning

DataHub Binder License: CC BY 4.0 Workshop Materials

This is the repository for D-Lab’s six-hour Introduction to Deep Learning in R workshop.

Prerequisites

We recommend attendees be intermediate R users and have had some prior exposure to the concepts in R-Machine-Learning.

Check D-Lab's Learning Pathways to figure out which of our workshops to take!

Workshop Goals

In this workshop, we provide an introduction to Deep Learning using TensorFlow and keras in R. First, we will cover the basics of what makes deep learning "deep." Then, we will explore using code to classify images. Along the way, we will build a workflow of a deep learning project.

Installation Instructions

We will use RStudio to go through the workshop materials, which requires installation of R, RStudio, and TensorFlow. Complete the following steps if you want to work locally.

  1. Download R and RStudio

  2. Within the R console, run the following commands

install.packages(c("tensorflow", "keras", "reticulate")) # Pulls in all R dependencies necessary for TensorFlow in R

library(reticulate)

# Set up R with a Python installation it can use
virtualenv_create("r-reticulate", python = install_python()) 

library(keras)
install_keras(envname = "r-reticulate") # Install TensorFlow and Keras python modules

After these steps you will have a working Keras and TensorFlow installation. This process will take some time if you decide to download to your local machine. To determine the TensorFlow version installed on your machine, run in the console

library(tensorflow)
tf$constant("Hello Tensorflow!")
  1. Install additional packages required for this workshop
install.packages(c("tfhub", "tfdatasets")

About the UC Berkeley D-Lab

D-Lab works with Berkeley faculty, research staff, and students to advance data-intensive social science and humanities research. Our goal at D-Lab is to provide practical training, staff support, resources, and space to enable you to use R for your own research applications. Our services cater to all skill levels and no programming, statistical, or computer science backgrounds are necessary. We offer these services in the form of workshops, one-to-one consulting, and working groups that cover a variety of research topics, digital tools, and programming languages.

Visit the D-Lab homepage to learn more about us. You can view our calendar for upcoming events, learn about how to utilize our consulting and data services, and check out upcoming workshops. Subscribe to our newsletter to stay up to date on D-Lab events, services, and opportunities.

Additional Resources

Other D-Lab R workshops

D-Lab offers a variety of R workshops, catered toward different levels of expertise.

Introductory Workshops

Intermediate and Advanced Workshops