The goal of hyperparameter tuning (or hyperparameter optimization) is to optimize the hyperparameters to improve the performance of the machine or deep learning model. spotPython (``Sequential Parameter Optimization Toolbox in Python'') is the Python version of the well-known hyperparameter tuner SPOT, which has been developed in the R programming environment for statistical analysis for over a decade. PyTorch is an optimized tensor library for deep learning using GPUs and CPUs. This document shows how to integrate the spotPython hyperparameter tuner into the PyTorch training workflow. As an example, the results of the CIFAR10 image classifier are used. In addition to an introduction to spotPython, this tutorial also includes a brief comparison with Ray Tune, a Python library for running experiments and tuning hyperparameters. This comparison is based on the PyTorch hyperparameter tuning tutorial. The advantages and disadvantages of both approaches are discussed. We show that spotPython achieves similar or even better results while being more flexible and transparent than Ray Tune.
翻译:超参数调优(或超参数优化)的目标是优化超参数,以提升机器学习或深度学习模型的性能。spotPython(“Python中的序列参数优化工具箱”)是著名超参数调优器SPOT的Python版本,后者已在R编程环境中用于统计分析开发超过十年。PyTorch是一个针对利用GPU和CPU进行深度学习的优化张量库。本文展示了如何将spotPython超参数调优器集成到PyTorch训练工作流中。以CIFAR10图像分类器的结果为例。除介绍spotPython之外,本教程还包括与Ray Tune(一个用于运行实验和调优超参数的Python库)的简要比较。该比较基于PyTorch超参数调优教程。我们讨论了两种方法的优缺点,并表明spotPython在比Ray Tune更灵活、更透明的同时,能够达到相似甚至更好的结果。