7. 機械学習応用の設計パターン文献
7
0
1
2
3
4
5
6
7
8
9
10
2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019
Scholarly
Gray
◼ Engineering VillageおよびGoogle検索エンジンによる検索
◼ 学術論文と灰色文献のいずれも概ね増加傾向
Hironori Washizaki, Hiromu Uchida, Foutse Khomh and Yann-Gael Gueheneuc, “Studying Software Engineering Patterns
for Designing Machine Learning Systems,” The 10th International Workshop on Empirical Software Engineering in
Practice (IWESEP 2019)
8. 例: Data Lake
データレイク
◼ 問題:どのような分析を行う
のか、どのようなフレームワ
ークを用いて分析を行うの
か、見通しがつきにくい。
◼ 解決:構造化されたデータ
から非構造化されたデータ
まで、可能な限り「生」の状
態で一元化されたリポジトリ
に保存する。異なるフレーム
ワークを用いた並列分析を
可能にする。
8
非構造化デ
ータ
構造化データ
データ
ソース
ML framework
MLフレーム
ワーク ML framework
他のデータ解
析
挿入のみのデータストレージ
変換ツール
データウェア
ハウス
Hironori Washizaki, Foutse Khomh, Yann-Gael Gueheneuc, “Software Engineering Patterns for Machine Learning
Applications (SEP4MLA),” 9th Asian Conference on Pattern Languages of Programs (AsianPLoP 2020)
9. 例: Distinguish Business Logic from ML Models
MLモデルからのビジネスロジック分離
◼ 問題:推論エンジンにおける変化が他に大きく影響してしまう。
◼ 解決:ビジネスロジックと推論エンジンを分離し、ビジネスロジックとML固
有のデータフローを疎結合する。
9
Haruki Yokoyama, Machine Learning System Architectural Pattern for Improving Operational Stability, ICSA-C, 2019
Hironori Washizaki, Foutse Khomh, Yann-Gael Gueheneuc, “Software Engineering Patterns for Machine Learning
Applications (SEP4MLA),” 9th Asian Conference on Pattern Languages of Programs (AsianPLoP 2020)
データレイヤロジックレイヤプレゼンテーションレイ
ヤ
ユーザイン
タフェース
データベー
ス
データ収集
データレイ
ク
Business
Logic
データ処理
推論エンジ
ン
実世界
ビジネスロジ
ック固有
ML固有
Architectural Layers
Deployed as ML System
Business Logic Data Flow
ML Runtime Data Flow
ML Development Data Flow
Legend
10. パターン間の関係からランゲージへ
10
Data Lake
Distinguish Business
Logic from ML Models
Uses
Separation of Concerns
and Modularization of
ML Components
Handshake
Test the infrastructure independently
from the machine learning
Reuse Code between Training
Pipeline and Serving Pipeline
Data-Algorithm-
Serving-Evaluator
Closed-Loop Intelligence
Canary Model
Daisy Architecture
Event-driven ML Microservices
Microservice Architecture
Data Lake
Kappa Architecture
Lambda Architecture
Parameter-Server
Abstraction
Decouple Training Pipeline
from Production Pipeline
ML Versioning pattern
Distinguish Business
Logic from ML
Models
Gateway Routing
Architecture
Undeclared
Consumers
Abstraction Debt
Pipeline Jungles
Glue Code
Big Ass Script
Architecture
Design Holistically about Data
Collection and Feature Extraction
Federated Learning
Secure Aggregation
Architecture
pattern
Design
pattern
Wrap Black-Box Packages
into Common APIs
Isolate and Validate
Output of Model