torch ecosystem

Installation and use

  • Install torch running install.packages("torch").

  • Run library(torch) to use it. Additional software will be downloaded and installed the first time you use torch.

The torch ecosystem

There are a few extensions to the core torch package that are useful depending on the kind of data you are working on. See the list below:

torch

torch is the core package in the ecosystem. It provides a GPU accelerated array computation library, a collection of general neural network layers and abstractions for efficiently loading data for deep learning models. 

luz

luz is a higher level API for torch providing abstractions to allow for much less verbose training loops. Luz let's you take your Torch nn_module definition and fit it to a dataloader, while handling the boring parts like moving data between devices, updating the weights, showing progress bars and tracking metrics. 

torchvision

torchvision is an extension providing image loading, transformations, common architectures for computer vision, pre-trained weights and access to commonly used datasets. 

torchaudio

torchaudio is an extension for torch providing audio loading, transformations, common architectures for signal processing, pre-trained weights and access to commonly used datasets. 

torchdatasets

torchdatasets is an extension for torch providing access to commonly used datasets for deep learning. It includes datasets for computer vision, audio, text and tabular data. 

ETM

ETM is a generative topic model combining traditional topic models (LDA) with word embeddings (word2vec). It models each word with a categorical distribution whose natural parameter is the inner product between a word embedding and an embedding of its assigned topic. 

innsight

innsight is an R package that interprets the behavior and explains individual predictions of modern neural networks. Many methods for explaining individual predictions already exist, but hardly any of them are implemented or available in R. 

More

If you are developing a torch extension, contact us on GitHub so we can feature it! We welcome all kinds of extensions: datasets, models, or any kind of functionality built on torch! 

torch as a backend

torch can be used as a backend in various high-level modeling frameworks such as tidymodels and fable. Here are some torch models and the contexts and frameworks in which they can be used:

Package Framework Context
tabnet tidymodels classification/regression/time series via (modeltime)
brulee brulee classification/regression