Deep learning (DL) has become a cornerstone of modern machine learning (ML) praxis. We introduce the R package mlr3torch, which is an extensible DL framework for the mlr3 ecosystem. It is built upon the torch package, and simplifies the definition, training, and evaluation of neural networks for both tabular data and generic tensors (e.g., images) for classification and regression. The package implements predefined architectures, and torch models can easily be converted to mlr3 learners. It also allows users to define neural networks as graphs. This representation is based on the graph language defined in mlr3pipelines and allows users to define the entire modeling workflow, including preprocessing, data augmentation, and network architecture, in a single graph. Through its integration into the mlr3 ecosystem, the package allows for convenient resampling, benchmarking, preprocessing, and more. We explain the package's design and features and show how to customize and extend it to new problems. Furthermore, we demonstrate the package's capabilities using three use cases, namely hyperparameter tuning, fine-tuning, and defining architectures for multimodal data. Finally, we present some runtime benchmarks.
翻译:深度学习(DL)已成为现代机器学习(ML)实践的核心组成部分。我们介绍R包mlr3torch,这是面向mlr3生态系统的一个可扩展深度学习框架。该包基于torch包构建,简化了针对表格数据及通用张量(如图像)进行分类与回归的神经网络定义、训练与评估流程。它实现了预定义架构,且torch模型可便捷转换为mlr3学习器,同时支持用户将神经网络定义为图结构——这种表示基于mlr3pipelines中定义的图语言,允许用户将预处理、数据增强和网络架构等整个建模工作流整合在单个图中。通过与mlr3生态系统的集成,该包实现了便捷的重采样、基准测试、预处理等功能。我们阐释了该包的设计与特性,并展示如何针对新问题对其进行定制与扩展。进一步地,通过超参数调优、微调以及多模态数据架构定义三个用例演示其功能,最后给出若干运行时基准测试结果。