IDEAS home Printed from https://ideas.repec.org/p/aiz/louvad/2026026.html

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

Author

Listed:
  • Soetewey, Antoine

    (Université catholique de Louvain, LIDAM/ISBA, Belgium)

  • Marie, Joshua

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.

Suggested Citation

  • Soetewey, Antoine & Marie, Joshua, 2026. "kindling: A Higher-Level torch Interface for Generating, Training, and Tuning Neural Networks in R," LIDAM Discussion Papers ISBA 2026026, Université catholique de Louvain, Institute of Statistics, Biostatistics and Actuarial Sciences (ISBA).
  • Handle: RePEc:aiz:louvad:2026026
    as

    Download full text from publisher

    To our knowledge, this item is not available for download. To find whether it is available, there are three options:
    1. Check below whether another version of this item is available online.
    2. Check on the provider's web page whether it is in fact available.
    3. Perform a
    for a similarly titled item that would be available.

    More about this item

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:aiz:louvad:2026026. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    We have no bibliographic references for this item. You can help adding them by using this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: Alain Gillis (email available below). General contact details of provider: https://edirc.repec.org/data/isuclbe.html .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.