EconPapers    
Economics at your fingertips  
 

kindling: A Higher-Level torch Interface for Generating, Training, and Tuning Neural Networks in R

Antoine Soetewey and Joshua Marie
Additional contact information
Antoine Soetewey: Université catholique de Louvain, LIDAM/ISBA, Belgium

No 2026026, LIDAM Discussion Papers ISBA from Université catholique de Louvain, Institute of Statistics, Biostatistics and Actuarial Sciences (ISBA)

Abstract: {kindling} is an R (R Core Team, 2025) package that provides a higher-level interface to the {torch} package (Falbel and Luraschi, 2025), R’s native implementation of PyTorch, for defining, training, and tuning neural networks. This package supports MLPs with the same topology, including the standard deep feedforward neural networks and recurrent variants (RNN, LSTM, GRU), while reducing the boilerplate typically required to write {torch} neural network architecture expression and training loops by hand. The package is organized around three levels of abstraction. At the lowest level, generator functions (for example ffnn generator()) return unevaluated torch::nn module() expressions that users can inspect or modify directly, since {kindling} builds its models through code generation rather than opaque wrapper objects. At an intermediate level, functions such as ffnn() and rnn() train a model directly from a formula and data frame, handling data preparation, the optimization loop, and, optionally, early stopping and a validation split. At the highest level, mlp kindling() and rnn kindling() register these models as {parsnip} model specifications (Kuhn and Vaughan, 2026), so they can be fit, tuned, and evaluated using the rest of the {tidymodels} ecosystem (Kuhn and Wickham, 2020): {recipes} for preprocessing, {workflows} for bundling preprocessing and modeling steps, and {tune}/{dials} for hyperparameter search over layer widths, network depth, activation functions, the output activation, the optimizer, and other architectural choices. Fitted models can also be inspected with variable-importance methods from {NeuralNetTools} (Beck, 2018), implementing the algorithms of Garson (Garson, 1991) and Olden and Jackson (Olden and Jackson, 2002), and with the {vip} package. Figure 1 shows an example of this last capability applied to the feedforward network trained in the package’s own README usage example.

Pages: 5
Date: 2026-07-03
References: Add references at CitEc
Citations:

There are no downloads for this item, see the EconPapers FAQ for hints about obtaining it.

Related works:
This item may be available elsewhere in EconPapers: Search for items with the same title.

Export reference: BibTeX RIS (EndNote, ProCite, RefMan) HTML/Text

Persistent link: https://EconPapers.repec.org/RePEc:aiz:louvad:2026026

Access Statistics for this paper

More papers in LIDAM Discussion Papers ISBA from Université catholique de Louvain, Institute of Statistics, Biostatistics and Actuarial Sciences (ISBA) Voie du Roman Pays 20, 1348 Louvain-la-Neuve (Belgium). Contact information at EDIRC.
Bibliographic data for series maintained by Alain Gillis ().

 
Page updated 2026-07-08
Handle: RePEc:aiz:louvad:2026026