Bindings for machine learning frameworks (such as TensorFlow and PyTorch) allow developers to integrate a framework's functionality using a programming language different from the framework's default language (usually Python). In this paper, we study the impact of using TensorFlow and PyTorch bindings in C#, Rust, Python and JavaScript on the software quality in terms of correctness (training and test accuracy) and time cost (training and inference time) when training and performing inference on five widely used deep learning models. Our experiments show that a model can be trained in one binding and used for inference in another binding for the same framework without losing accuracy. Our study is the first to show that using a non-default binding can help improve machine learning software quality from the time cost perspective compared to the default Python binding while still achieving the same level of correctness.
翻译:机器学习框架(如TensorFlow和PyTorch)的绑定允许开发者使用不同于框架默认语言(通常为Python)的编程语言集成框架功能。本文研究了在C#、Rust、Python和JavaScript中使用TensorFlow与PyTorch绑定时,对五种广泛使用的深度学习模型进行训练与推理的软件质量影响,评估维度包括正确性(训练与测试准确率)与时间成本(训练与推理时间)。实验表明,模型可在同一框架的某一绑定中训练,并在另一绑定中用于推理,且不会损失准确率。本研究首次证明,从时间成本角度而言,使用非默认绑定相较于默认Python绑定有助于提升机器学习软件质量,同时仍能保持同等水平的正确性。