Git Product home page Git Product logo

torch-workshop's Introduction

torch-workshop

This workshop is part of the Rocky Mountain Advanced Computing Consortium’s (RMACC) High Performance Computing Symposium (5/18/2023).

This workshop presents a conceptual overview of the R interface for PyTorch. Emphasis will be on basic structures and applications for deep learning. With torch there is no need to install or use Python. Torch and its associated packages – torchaudio, torchvision, luz – will run on CPU or GPU. This workshop will demonstrate torch for R using an NVIDIA GPU environment, which significantly accelerates computations.

Materials

Materials for this workshop are based on the new book, Deep Learning and Scientific Computing with R torch by Sigrid Keydana. For slides click here.

Getting Started

Torch for R is an open source machine learning framework based on PyTorch. torch provides fast array computation with strong GPU acceleration and a neural networks library built on a tape-based autograd system. The "torch for R"" ecosystem is a collection of extensions for torch. For details on getting started, see the Installation Vignette.

Windows and Mac (CPU)

  1. Install RStudio desktop
  2. Install torch
install.packages("torch")
  1. Clone this repos and make sure the working directory is torch-workshop
  2. Download Tiny ImageNet data
tiny_imagenet_dataset(".", download = TRUE)
  1. Install the modeldata package from the 2021-06-08 snapshot
install.packages("modeldata", repos = "https://packagemanager.rstudio.com/cran/__linux__/bionic/2021-06-08")

Linux (GPU)

  1. Have a CUDA compatible NVIDIA GPU with compute capability 6.0 or higher
  2. Install the NVIDIA Container Toolkit
  3. Pull and run the RStudio Rocker container
docker pull rocker/rstudio
docker run --gpus=all -d -t -e PASSWORD=rstudio -p 8787:8787 --name rstudio rocker/rstudio
  1. Open RStudio Server from your browser by opening http://<your.ip.address>:8787/. Make sure port 8787 is open. Your username is rstudio and your password is rstudio
  2. Configure RStudio Server to download package binaries from the Posit Package Manager
# For Red Hat 8 use:
https://packagemanager.rstudio.com/cran/__linux__/centos8/latest

# For Ubuntu 20.04 use:
https://packagemanager.rstudio.com/cran/__linux__/focal/latest
  1. Install torch from the pre-built binaries (Warning! This download is 2Gb)
options(timeout = 600)
install.packages("torch", repos = "https://storage.googleapis.com/torch-lantern-builds/packages/cu117/0.10.0/")
  1. Make sure your CUDA device is available (this should return TRUE)
library(torch)
cuda_is_available()
  1. Clone this repos and make sure the working directory is torch-workshop
  2. Download Tiny ImageNet data
wget http://cs231n.stanford.edu/tiny-imagenet-200.zip
unzip tiny-imagenet-200.zip
  1. Install the modeldata package from the 2021-06-08 snapshot
install.packages("modeldata", repos = "https://packagemanager.rstudio.com/cran/__linux__/bionic/2021-06-08")

torch-workshop's People

Contributors

nwstephens avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.