kindling: A Higher-Level torch Interface for Generating, Training, and Tuning Neural Networks in R
Abstract
kindling is an R package that provides a higher-level interface to torch, R's native implementation of PyTorch, for defining, training, and tuning neural networks. It supports multilayer perceptrons and recurrent architectures (RNN, LSTM, GRU) while reducing the boilerplate typically required to write torch model definitions and training loops by hand. The package is organized around three levels of abstraction: code-generation functions that return inspectable, unevaluated torch::nn\module() expressions; direct-training functions that fit a model from a formula and data frame; and tidymodels-registered model specifications that let neural networks be fit, tuned, and evaluated using the tune, dials, recipes, and workflows infrastructure that tidymodels users already rely on for other model types. This design lets analysts move from exploratory training to systematic hyperparameter search without leaving the tidymodels ecosystem, while retaining the ability to inspect or modify the generated model code rather than treating it as a black box.
Turn this paper into a full lesson
ArcXiv compiles a staged curriculum from this paper: 8-12 lessons across beginner → advanced, synthesised section guides, visuals, flashcards, a quiz, exercises, and on-demand deep dives per section. Grounded in the abstract, never invented.