Skip to main content
QUICK REVIEW

[论文解读] Code Generation for Machine Learning using Model-Driven Engineering and SysML

Simon Raedler, Matthias Rupp|arXiv (Cornell University)|Jul 10, 2023
Computational Physics and Python Applications被引用 3
一句话总结

本文提出一种模型驱动的方法,通过基于构造型的配置和模板映射,从SysML模型自动生成可执行的机器学习代码。通过将代码生成逻辑与转换逻辑解耦,使用JSON配置,该方法实现了灵活、可维护且可扩展的代码生成,而无需修改核心生成器,在天气预报案例研究中展示了其可行性。

ABSTRACT

Data-driven engineering refers to systematic data collection and processing using machine learning to improve engineering systems. Currently, the implementation of data-driven engineering relies on fundamental data science and software engineering skills. At the same time, model-based engineering is gaining relevance for the engineering of complex systems. In previous work, a model-based engineering approach integrating the formalization of machine learning tasks using the general-purpose modeling language SysML is presented. However, formalized machine learning tasks still require the implementation in a specialized programming languages like Python. Therefore, this work aims to facilitate the implementation of data-driven engineering in practice by extending the previous work of formalizing machine learning tasks by integrating model transformation to generate executable code. The method focuses on the modifiability and maintainability of the model transformation so that extensions and changes to the code generation can be integrated without requiring modifications to the code generator. The presented method is evaluated for feasibility in a case study to predict weather forecasts. Based thereon, quality attributes of model transformations are assessed and discussed. Results demonstrate the flexibility and the simplicity of the method reducing efforts for implementation. Further, the work builds a theoretical basis for standardizing data-driven engineering implementation in practice.

研究动机与目标

  • 弥合SysML模型中形式化机器学习任务与Python等编程语言实现之间的差距。
  • 通过从SysML模型自动生成代码,实现数据驱动工程中的模型驱动工程。
  • 在不修改转换引擎的情况下,提高代码生成的可维护性和可扩展性。
  • 为工业系统工程中机器学习实现的标准化奠定基础。

提出的方法

  • 该方法使用带有自定义构造型的SysML,对特征、模型和数据源等机器学习组件进行语义注释。
  • 基于JSON的映射配置将SysML构造型与代码模板关联,实现动态代码生成。
  • 使用轻量级、可扩展的转换引擎,将构造型属性填充到通用代码模板中。
  • 转换引擎与代码生成逻辑解耦,允许通过配置更新,以及在不更改核心逻辑的情况下添加新模板。
  • 通过将模型转换逻辑与代码生成模板及配置分离,该方法支持模块化。
  • 实现过程中使用Jupyter Notebook执行并验证生成的代码,通过唯一块标记实现可追溯性。

实验结果

研究问题

  • RQ1RQ1:在模型驱动工程背景下,哪些模型属性可用于自动推导机器学习模型?
  • RQ2RQ2:何种软件工程手段可实现对机器学习代码推导的扩展与维护,而无需修改模型转换逻辑?
  • RQ3RQ3:在机器学习代码生成背景下,如何评估模型转换的质量属性,如模块化、完整性与简洁性?

主要发现

  • 该方法成功地通过基于构造型的配置和模板映射,从SysML模型生成可执行的机器学习代码。
  • 配置与转换逻辑的分离使得无需修改代码生成器即可实现可扩展性,支持可维护性。
  • 该方法在使用公开数据集的真实天气预报案例研究中展示了可行性。
  • 生成的代码在Jupyter Notebook中被验证,通过唯一块标记确认了正确性与可追溯性。
  • 通过定义新模板,该方法支持灵活的目标语言选择,而无需更改转换引擎。
  • 通过配置驱动设计和模板复用,实现了模块化、完整性与简洁性等质量属性。

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。