SlideShare a Scribd company logo
@LolaBurgueno
lburguenoc@uoc.edu
A Generic Neural
Network Architecture to
Infer Heterogeneous
Model Transformations
November 5th, 2021
Lola Burgueño
Open University of Catalonia, Barcelona, Spain
Motivation
• Models capture relevant properties of systems
• During the models’ life-cycle, models are the subject of manipulations
• Purposes:
• Managing software evolution,
• performing analysis,
• Increasing developers’ productivity,
• reducing human errors,
• etc.
• These manipulations are usually
implemented as model transformations
• Model-to-Model
• Model-to-Text
• Text-to-Model
2
Motivation
• Creating model transformations remains a challenging task [1]:
• It requires a high-level expertise,
• competences in language engineering, and
• extensive domain knowledge
• Developers are reluctant to adopt automatic model generators (e.g., from UML to JAVA)
• They do not trust them,
• They look foreign to them,
• they do not follow the company’s coding style
• AI-based solution:
• Heterogeneous model transformations can be automatically inferred from only input-output
• The outputs will comply to the company or project’s standards
3
[1] L. Burgueño, J. Cabot, S. Gérard, The future of model transformation languages: An open community
discussion,
4
Artificial Intelligence
• Machine Learning - Supervised Learning:
Input
Output
Training Transforming
ML Input Output
ML
Artificial Intelligence
Machine Learning
Artificial Neural Networks
Deep Artificial
Neural Networks
5
Artificial Neural Networks
• MTs ≈ sequence-to-sequence translation
6
Artificial Neural Networks
• Graph structure
• Neurons are mathematical functions
• Receive a set of values through its input connections
• compute an output value
• transfer the output value to another neuron through its output
connection
• Connections have associated weights (i.e., real numbers)
• Adjusted during the learning process to increase/decrease the
strength of the connection
7
Neurons
+
Directed weighted connections
Artificial Neural Networks
• The learning process basically means to find the right weights
• Supervised learning methods. Training phase:
• Example input-output pairs are used (Dataset)
Dataset
Training Validation Test
8
• The training dataset contains most
of the inputs-output pairs and is
used to train the ANN
Artificial Neural Networks
• The learning process basically means to find the right weights
• Supervised learning methods. Training phase:
• Example input-output pairs are used (Dataset)
Dataset
Training Validation Test
9
• The test dataset is only used once
the training has finished.
• Check the quality of the ANN’s
predictions for inputs it has not seen
before, and hence to study its
accuracy.
• The accuracy is calculated:
# predictions our model gets right
# total of predictions
• Thus, it is a number in the range [0;
1]. The closer to 1, the better
Artificial Neural Networks
• The learning process basically means to find the right weights
• Supervised learning methods. Training phase:
• Example input-output pairs are used (Dataset)
Dataset
Training Validation Test
10
• The validation dataset plays a similar
role as the test dataset, during the
training process.
• Controls that the learning process is
correct and avoid overfitting.
• Any accuracy increase over the training
dataset must yield to an accuracy
increase over the validation dataset
Architecture
• Encoder-decoder architecture (avoids fixed size input/output constraints)
+
• Long short-term memory neural networks (longer memory than predecessors)
Encoder
LSTM network
Decoder
LSTM network
Input
Model
Output
Model
11
Architecture
• Sequence-to-Sequence transformations
• Tree-to-tree transformations
• Input layer to embed the input tree to a numeric vector
+
• Output layer to obtain the output model from the numeric vectors produced by the decoder
Input
Tree
Embedding
Layer
Encoder
LSTM network
Output
Tree
Layer
Decoder
LSTM network
Input
Model
Output
Model
12
• Attention mechanism
• To pay more attention (remember better) to specific parts
• Helps the decoder recognize the relevant information in the vectorial
representation of the input AST at each step
Architecture
Input
Tree
Embedding
Layer
Encoder
LSTM network
Output
Tree
Layer
Decoder
LSTM network
Attention
Layer
Input
Model
Output
Model
13
• Softmax
• Multi-class classification which uses a softmax activation function
• Maps each real number to a number in the (0; 1) range. Interpreted as probabilities
• In each iteration, the component with higher probability is selected and its corresponding
token passes to be part of the output
Architecture
Input
Tree
Embedding
Layer
Encoder
LSTM network
Output
Tree
Layer
Softmax
Decoder
LSTM network
Attention
Layer
Input
Model
Output
Model
14
• Pre- and post-processing required to…
• represent models as trees
• reduce the size of the training dataset by using a canonical form
• rename variables to avoid the “dictionary problem”
Model pre- and post-processing
Input
Model
(preprocessed)
Input
Tree
Embedding
Layer
Encoder
LSTM network
Output
Tree
Layer
Softmax
Output
Model
(non-postprocessed)
Decoder
LSTM network
Attention
Layer
Input
Model
Output
Model
Preprocessing
Postprocessing
15
• Parameters that are not learned during training, but manually adjusted
• No rule to choose the best hyperparameters for a specific task
• Choosing the right values has a critical impact on the success and performance of
the network
Hyperparameters
16
Hyperparameters
17
Hyperparameter Description Value
Epoch • Number of times the complete training dataset is passed through the Neural
Networks
• In each epoch, the training dataset is randomly shuffled and split into batches
30
Batch • Set of input-output pairs
• Each time a batch is passed, an iteration is completed
64
Neural Networks
depth
• Number of hidden layers in the neural networks 1
Embedding size • Size of the vectors
• Needs to be higher tan the vocabulary size
64
Dropout • Select which weights are updated and which are not in each iteration
• If all the weights were adjusted in each iteration, overfitting would be more likely
to happen
0.75 (prob of
a weight to
be ignored)
Learning rate • Controls how much the weights are adjusted
• Value in the the range [0; 1]
0.005
Cases and Results
• We illustrate the feasibility and potential of our approach through its application
in two main operations on models:
• Model-to-Model transformation  Class 2 Relational
• Code generation  UML 2 Java
18
Results: Neural networks are able to faithfully
learn how to perform these tasks as long as
enough data is provided and no contradictory
examples are given
Class 2 Relational
Some transformation rules that need to be learned
are:
• Each Class is transformed into a Table;
• Each DataType is transformed into a Type;
• DataType is transformed into a Table,
19
• Each single-valued Attribute of type DataType
is transformed into a Column;
• Each multi-valued Attribute instance of the type
Model representation
MODEL
ASSOC
OBJ
c
Class
ATTS
isAbstract name
false family
OBJ
a
Attribute
ATTS
multivalued name
false surname
OBJ
dt
Datatype
ATTS
name
String
att
c a
ASSOC
type
a dt
20
{
" source_ast ": {
" root ": "<MODEL>",
" children ": [
{
" root ": "<OBJ>",
" children ": [
{
" root ": "D ",
" children ": [
…
Class 2 Relational: Results
• Correctness
• Measured through the accuracy and validation loss
21
Class 2 Relational: Results
• Performance
1. How long does it take for the
training phase to complete?
22
Class 2 Relational: Results
• Performance
1. How long does it take for the
training phase to complete?
2. How long it takes to transform an
input model when the network is
trained?
23
Class 2 Relational: Results
• Performance
• Comparison with ATL
• Synthetic models
• Transformation and model from [1]
• ATL: 0.033 seconds
• Our approach: 0.722 seconds
• Although a bit slower, same order of magnitude
• Reasonable time
• The advantages of our approach may pay off
24
[1] AtlanMod (Inria), Class to relational transformation example,
https://www.eclipse.org/atl/atlTransformations/#Class2Relational
UML 2 Java: Results
25
Example of translation rules:
• UML classes are transformed into Java classes;
• UML attributes into Java attributes;
• UML associations into Java attributes referencing the class in the other end of the association
Abstraction gap  Many variability points in the translation
• E.g., Primitive data type conversions
• UML attribute whose type is Real could be mapped to a Java attribute with type double, Double or
UML 2 Java: Results
26
• Training dataset
• Creation:
1. Downloaded the source code of the Eclipse IDE
2. Reverse engineer it with MoDisco
3. Removed the low-level details (e.g., method implementation)
4. Obtained the UML models
• The initial dataset (D1) contains 25,375 input-output pairs
UML 2 Java: Results
27
• Correctness
Our definition of Accuracy:
• worst-case scenario
• we are sometimes discarding
generated code that it is semantically
equivalent to the expected output even
if it presents slight syntactic differences
UML 2 Java: Results
28
• Training dataset
• Creation:
1. Downloaded the source code of the Eclipse IDE
2. Reverse engineer it with MoDisco
3. Removed the low-level details (e.g., method implementation)
4. Obtained the UML models
• The initial dataset (D1) contains 25,375 input-output pairs
• We had to curate it:
1. Discard pairs that exceed size (dataset D2)
2. Discard examples with inconsistencies (dataset D3)
• E.g., due to inheritance and the location in the hierarchy of getters/setters
• The curated dataset (D3) contains 8,937 input-output pairs
UML 2 Java: Results
29
• Correctness
UML 2 Java: Results
30
• Performance
• Training • Generating code:
• Average time of 18 milliseconds
• Standard deviation of 3 milliseconds
• Efficient enough to be part of any
continuous software development
process
3
1
Limitations/Discussion
• Generalization problem
• predicting output solutions for input models
very different from the training distribution
it has learn from
• Social acceptance
• Size of the training dataset
• Size of the input-output pairs
• Diversity in the training set
• Computational limitations of ANNs
• i.e., mathematical operations
Future work
• Study of transformers
• Validation of our approach with MT
chains
• Connectors for EMF models
• Pretrained networks for an easy quick
start
32
References
[1] Loli Burgueño, Jordi Cabot, Sébastien Gérard. An LSTM-Based Neural Network Architecture for
Model Transformations. In Proc. of MoDELS 2019: 294-299
[2] Loli Burgueño, Jordi Cabot, Shuai Li, Sébastien Gérard. A Generic LSTM Neural Network
Architecture to Infer Heterogeneous Model Transformations. Software and Systems Modeling. 2021.
DOI: 10.1007/s10270-021-00893-y
33

More Related Content

What's hot

Cognitive Toolkit - Deep Learning framework from Microsoft
Cognitive Toolkit - Deep Learning framework from MicrosoftCognitive Toolkit - Deep Learning framework from Microsoft
Cognitive Toolkit - Deep Learning framework from Microsoft
Łukasz Grala
 
AutoML - The Future of AI
AutoML - The Future of AIAutoML - The Future of AI
AutoML - The Future of AI
Ning Jiang
 
DataMass Summit - Machine Learning for Big Data in SQL Server
DataMass Summit - Machine Learning for Big Data  in SQL ServerDataMass Summit - Machine Learning for Big Data  in SQL Server
DataMass Summit - Machine Learning for Big Data in SQL Server
Łukasz Grala
 
Object modeling
Object modelingObject modeling
Object modeling
Preeti Mishra
 
Josh Patterson, Advisor, Skymind – Deep learning for Industry at MLconf ATL 2016
Josh Patterson, Advisor, Skymind – Deep learning for Industry at MLconf ATL 2016Josh Patterson, Advisor, Skymind – Deep learning for Industry at MLconf ATL 2016
Josh Patterson, Advisor, Skymind – Deep learning for Industry at MLconf ATL 2016
MLconf
 
Embed, Encode, Attend, Predict – applying the 4 step NLP recipe for text clas...
Embed, Encode, Attend, Predict – applying the 4 step NLP recipe for text clas...Embed, Encode, Attend, Predict – applying the 4 step NLP recipe for text clas...
Embed, Encode, Attend, Predict – applying the 4 step NLP recipe for text clas...
Sujit Pal
 
Chapter 2 Basics of MATLAB
Chapter 2 Basics of MATLABChapter 2 Basics of MATLAB
Chapter 2 Basics of MATLAB
Pranoti Doke
 
TensorFlow Extension (TFX) and Apache Beam
TensorFlow Extension (TFX) and Apache BeamTensorFlow Extension (TFX) and Apache Beam
TensorFlow Extension (TFX) and Apache Beam
markgrover
 
Ballerina is not Java (or Go or ..)
Ballerina is not Java (or Go or ..)Ballerina is not Java (or Go or ..)
Ballerina is not Java (or Go or ..)
Ballerina
 
2018 07-ballerina-ballerina con
2018 07-ballerina-ballerina con2018 07-ballerina-ballerina con
2018 07-ballerina-ballerina con
Sanjiva Weerawarana
 
Week 1 - Data Structures and Algorithms
Week 1 - Data Structures and AlgorithmsWeek 1 - Data Structures and Algorithms
Week 1 - Data Structures and Algorithms
Ferdin Joe John Joseph PhD
 
Introduction to machine learning
Introduction to machine learningIntroduction to machine learning
Introduction to machine learning
Sanghamitra Deb
 
General Tips for participating Kaggle Competitions
General Tips for participating Kaggle CompetitionsGeneral Tips for participating Kaggle Competitions
General Tips for participating Kaggle Competitions
Mark Peng
 
Data analytics with R
Data analytics with RData analytics with R
Data analytics with R
Dr. C.V. Suresh Babu
 
CS3270 – Database Systems Course Outline
CS3270 – Database Systems Course OutlineCS3270 – Database Systems Course Outline
CS3270 – Database Systems Course Outline
Dilawar Khan
 
Evolving a Medical Image Similarity Search
Evolving a Medical Image Similarity SearchEvolving a Medical Image Similarity Search
Evolving a Medical Image Similarity Search
Sujit Pal
 
MLConf 2016 SigOpt Talk by Scott Clark
MLConf 2016 SigOpt Talk by Scott ClarkMLConf 2016 SigOpt Talk by Scott Clark
MLConf 2016 SigOpt Talk by Scott Clark
SigOpt
 
Algorithm
AlgorithmAlgorithm
Algorithm
Prajakta Bagal
 
CIS110 Computer Programming Design Chapter (10)
CIS110 Computer Programming Design Chapter  (10)CIS110 Computer Programming Design Chapter  (10)
CIS110 Computer Programming Design Chapter (10)
Dr. Ahmed Al Zaidy
 
Programming Logic and Design: Working with Data
Programming Logic and Design: Working with DataProgramming Logic and Design: Working with Data
Programming Logic and Design: Working with Data
Nicole Ryan
 

What's hot (20)

Cognitive Toolkit - Deep Learning framework from Microsoft
Cognitive Toolkit - Deep Learning framework from MicrosoftCognitive Toolkit - Deep Learning framework from Microsoft
Cognitive Toolkit - Deep Learning framework from Microsoft
 
AutoML - The Future of AI
AutoML - The Future of AIAutoML - The Future of AI
AutoML - The Future of AI
 
DataMass Summit - Machine Learning for Big Data in SQL Server
DataMass Summit - Machine Learning for Big Data  in SQL ServerDataMass Summit - Machine Learning for Big Data  in SQL Server
DataMass Summit - Machine Learning for Big Data in SQL Server
 
Object modeling
Object modelingObject modeling
Object modeling
 
Josh Patterson, Advisor, Skymind – Deep learning for Industry at MLconf ATL 2016
Josh Patterson, Advisor, Skymind – Deep learning for Industry at MLconf ATL 2016Josh Patterson, Advisor, Skymind – Deep learning for Industry at MLconf ATL 2016
Josh Patterson, Advisor, Skymind – Deep learning for Industry at MLconf ATL 2016
 
Embed, Encode, Attend, Predict – applying the 4 step NLP recipe for text clas...
Embed, Encode, Attend, Predict – applying the 4 step NLP recipe for text clas...Embed, Encode, Attend, Predict – applying the 4 step NLP recipe for text clas...
Embed, Encode, Attend, Predict – applying the 4 step NLP recipe for text clas...
 
Chapter 2 Basics of MATLAB
Chapter 2 Basics of MATLABChapter 2 Basics of MATLAB
Chapter 2 Basics of MATLAB
 
TensorFlow Extension (TFX) and Apache Beam
TensorFlow Extension (TFX) and Apache BeamTensorFlow Extension (TFX) and Apache Beam
TensorFlow Extension (TFX) and Apache Beam
 
Ballerina is not Java (or Go or ..)
Ballerina is not Java (or Go or ..)Ballerina is not Java (or Go or ..)
Ballerina is not Java (or Go or ..)
 
2018 07-ballerina-ballerina con
2018 07-ballerina-ballerina con2018 07-ballerina-ballerina con
2018 07-ballerina-ballerina con
 
Week 1 - Data Structures and Algorithms
Week 1 - Data Structures and AlgorithmsWeek 1 - Data Structures and Algorithms
Week 1 - Data Structures and Algorithms
 
Introduction to machine learning
Introduction to machine learningIntroduction to machine learning
Introduction to machine learning
 
General Tips for participating Kaggle Competitions
General Tips for participating Kaggle CompetitionsGeneral Tips for participating Kaggle Competitions
General Tips for participating Kaggle Competitions
 
Data analytics with R
Data analytics with RData analytics with R
Data analytics with R
 
CS3270 – Database Systems Course Outline
CS3270 – Database Systems Course OutlineCS3270 – Database Systems Course Outline
CS3270 – Database Systems Course Outline
 
Evolving a Medical Image Similarity Search
Evolving a Medical Image Similarity SearchEvolving a Medical Image Similarity Search
Evolving a Medical Image Similarity Search
 
MLConf 2016 SigOpt Talk by Scott Clark
MLConf 2016 SigOpt Talk by Scott ClarkMLConf 2016 SigOpt Talk by Scott Clark
MLConf 2016 SigOpt Talk by Scott Clark
 
Algorithm
AlgorithmAlgorithm
Algorithm
 
CIS110 Computer Programming Design Chapter (10)
CIS110 Computer Programming Design Chapter  (10)CIS110 Computer Programming Design Chapter  (10)
CIS110 Computer Programming Design Chapter (10)
 
Programming Logic and Design: Working with Data
Programming Logic and Design: Working with DataProgramming Logic and Design: Working with Data
Programming Logic and Design: Working with Data
 

Similar to A Generic Neural Network Architecture to Infer Heterogeneous Model Transformations

MDE in Practice
MDE in PracticeMDE in Practice
MDE in Practice
Abdalmassih Yakeen
 
An LSTM-Based Neural Network Architecture for Model Transformations
An LSTM-Based Neural Network Architecture for Model TransformationsAn LSTM-Based Neural Network Architecture for Model Transformations
An LSTM-Based Neural Network Architecture for Model Transformations
Jordi Cabot
 
Natural Language Query to SQL conversion using Machine Learning Approach
Natural Language Query to SQL conversion using Machine Learning ApproachNatural Language Query to SQL conversion using Machine Learning Approach
Natural Language Query to SQL conversion using Machine Learning Approach
Minhazul Arefin
 
Generating test cases using UML Communication Diagram
Generating test cases using UML Communication Diagram Generating test cases using UML Communication Diagram
Generating test cases using UML Communication Diagram
Praveen Penumathsa
 
Kelis king - introduction to software design
Kelis king -  introduction to software designKelis king -  introduction to software design
Kelis king - introduction to software design
KelisKing
 
Design p atterns
Design p atternsDesign p atterns
Design p atterns
Amr Abd El Latief
 
Taking your machine learning workflow to the next level using Scikit-Learn Pi...
Taking your machine learning workflow to the next level using Scikit-Learn Pi...Taking your machine learning workflow to the next level using Scikit-Learn Pi...
Taking your machine learning workflow to the next level using Scikit-Learn Pi...
Philip Goddard
 
From science to engineering, the process to build a machine learning product
From science to engineering, the process to build a machine learning productFrom science to engineering, the process to build a machine learning product
From science to engineering, the process to build a machine learning product
Bruce Kuo
 
The Power of Auto ML and How Does it Work
The Power of Auto ML and How Does it WorkThe Power of Auto ML and How Does it Work
The Power of Auto ML and How Does it Work
Ivo Andreev
 
OODPunit1.pdf
OODPunit1.pdfOODPunit1.pdf
OODPunit1.pdf
KrishMehta47
 
Automated product categorization
Automated product categorizationAutomated product categorization
Automated product categorization
Andreas Loupasakis
 
Automated product categorization
Automated product categorization   Automated product categorization
Automated product categorization
Warply
 
Module Architecture of React-Redux Applications
Module Architecture of React-Redux ApplicationsModule Architecture of React-Redux Applications
Module Architecture of React-Redux Applications
Andrii Sliusar
 
Distributed Model Validation with Epsilon
Distributed Model Validation with EpsilonDistributed Model Validation with Epsilon
Distributed Model Validation with Epsilon
Sina Madani
 
machine learning workflow with data input.pptx
machine learning workflow with data input.pptxmachine learning workflow with data input.pptx
machine learning workflow with data input.pptx
jasontseng19
 
Machine Learning and AI at Oracle
Machine Learning and AI at OracleMachine Learning and AI at Oracle
Machine Learning and AI at Oracle
Sandesh Rao
 
Using MDE for the Formal Verification of Embedded Systems Modeled by UML Se...
Using MDE for the Formal Verification of Embedded  Systems Modeled by UML Se...Using MDE for the Formal Verification of Embedded  Systems Modeled by UML Se...
Using MDE for the Formal Verification of Embedded Systems Modeled by UML Se...
Francisco Assis Nascimento
 
PAC 2019 virtual Alexander Podelko
PAC 2019 virtual Alexander Podelko PAC 2019 virtual Alexander Podelko
PAC 2019 virtual Alexander Podelko
Neotys
 
Constructing DSMLs
Constructing DSMLsConstructing DSMLs
Constructing DSMLs
miso_uam
 
Operationalizing Machine Learning: Serving ML Models
Operationalizing Machine Learning: Serving ML ModelsOperationalizing Machine Learning: Serving ML Models
Operationalizing Machine Learning: Serving ML Models
Lightbend
 

Similar to A Generic Neural Network Architecture to Infer Heterogeneous Model Transformations (20)

MDE in Practice
MDE in PracticeMDE in Practice
MDE in Practice
 
An LSTM-Based Neural Network Architecture for Model Transformations
An LSTM-Based Neural Network Architecture for Model TransformationsAn LSTM-Based Neural Network Architecture for Model Transformations
An LSTM-Based Neural Network Architecture for Model Transformations
 
Natural Language Query to SQL conversion using Machine Learning Approach
Natural Language Query to SQL conversion using Machine Learning ApproachNatural Language Query to SQL conversion using Machine Learning Approach
Natural Language Query to SQL conversion using Machine Learning Approach
 
Generating test cases using UML Communication Diagram
Generating test cases using UML Communication Diagram Generating test cases using UML Communication Diagram
Generating test cases using UML Communication Diagram
 
Kelis king - introduction to software design
Kelis king -  introduction to software designKelis king -  introduction to software design
Kelis king - introduction to software design
 
Design p atterns
Design p atternsDesign p atterns
Design p atterns
 
Taking your machine learning workflow to the next level using Scikit-Learn Pi...
Taking your machine learning workflow to the next level using Scikit-Learn Pi...Taking your machine learning workflow to the next level using Scikit-Learn Pi...
Taking your machine learning workflow to the next level using Scikit-Learn Pi...
 
From science to engineering, the process to build a machine learning product
From science to engineering, the process to build a machine learning productFrom science to engineering, the process to build a machine learning product
From science to engineering, the process to build a machine learning product
 
The Power of Auto ML and How Does it Work
The Power of Auto ML and How Does it WorkThe Power of Auto ML and How Does it Work
The Power of Auto ML and How Does it Work
 
OODPunit1.pdf
OODPunit1.pdfOODPunit1.pdf
OODPunit1.pdf
 
Automated product categorization
Automated product categorizationAutomated product categorization
Automated product categorization
 
Automated product categorization
Automated product categorization   Automated product categorization
Automated product categorization
 
Module Architecture of React-Redux Applications
Module Architecture of React-Redux ApplicationsModule Architecture of React-Redux Applications
Module Architecture of React-Redux Applications
 
Distributed Model Validation with Epsilon
Distributed Model Validation with EpsilonDistributed Model Validation with Epsilon
Distributed Model Validation with Epsilon
 
machine learning workflow with data input.pptx
machine learning workflow with data input.pptxmachine learning workflow with data input.pptx
machine learning workflow with data input.pptx
 
Machine Learning and AI at Oracle
Machine Learning and AI at OracleMachine Learning and AI at Oracle
Machine Learning and AI at Oracle
 
Using MDE for the Formal Verification of Embedded Systems Modeled by UML Se...
Using MDE for the Formal Verification of Embedded  Systems Modeled by UML Se...Using MDE for the Formal Verification of Embedded  Systems Modeled by UML Se...
Using MDE for the Formal Verification of Embedded Systems Modeled by UML Se...
 
PAC 2019 virtual Alexander Podelko
PAC 2019 virtual Alexander Podelko PAC 2019 virtual Alexander Podelko
PAC 2019 virtual Alexander Podelko
 
Constructing DSMLs
Constructing DSMLsConstructing DSMLs
Constructing DSMLs
 
Operationalizing Machine Learning: Serving ML Models
Operationalizing Machine Learning: Serving ML ModelsOperationalizing Machine Learning: Serving ML Models
Operationalizing Machine Learning: Serving ML Models
 

Recently uploaded

block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdfTutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
aqil azizi
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
SyedAbiiAzazi1
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
BrazilAccount1
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
Vijay Dialani, PhD
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 
Unbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptxUnbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptx
ChristineTorrepenida1
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTSHeap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Soumen Santra
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
gerogepatton
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
AmarGB2
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
Aditya Rajan Patra
 

Recently uploaded (20)

block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdfTutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 
Unbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptxUnbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptx
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTSHeap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
 

A Generic Neural Network Architecture to Infer Heterogeneous Model Transformations

  • 1. @LolaBurgueno lburguenoc@uoc.edu A Generic Neural Network Architecture to Infer Heterogeneous Model Transformations November 5th, 2021 Lola Burgueño Open University of Catalonia, Barcelona, Spain
  • 2. Motivation • Models capture relevant properties of systems • During the models’ life-cycle, models are the subject of manipulations • Purposes: • Managing software evolution, • performing analysis, • Increasing developers’ productivity, • reducing human errors, • etc. • These manipulations are usually implemented as model transformations • Model-to-Model • Model-to-Text • Text-to-Model 2
  • 3. Motivation • Creating model transformations remains a challenging task [1]: • It requires a high-level expertise, • competences in language engineering, and • extensive domain knowledge • Developers are reluctant to adopt automatic model generators (e.g., from UML to JAVA) • They do not trust them, • They look foreign to them, • they do not follow the company’s coding style • AI-based solution: • Heterogeneous model transformations can be automatically inferred from only input-output • The outputs will comply to the company or project’s standards 3 [1] L. Burgueño, J. Cabot, S. Gérard, The future of model transformation languages: An open community discussion,
  • 4. 4
  • 5. Artificial Intelligence • Machine Learning - Supervised Learning: Input Output Training Transforming ML Input Output ML Artificial Intelligence Machine Learning Artificial Neural Networks Deep Artificial Neural Networks 5
  • 6. Artificial Neural Networks • MTs ≈ sequence-to-sequence translation 6
  • 7. Artificial Neural Networks • Graph structure • Neurons are mathematical functions • Receive a set of values through its input connections • compute an output value • transfer the output value to another neuron through its output connection • Connections have associated weights (i.e., real numbers) • Adjusted during the learning process to increase/decrease the strength of the connection 7 Neurons + Directed weighted connections
  • 8. Artificial Neural Networks • The learning process basically means to find the right weights • Supervised learning methods. Training phase: • Example input-output pairs are used (Dataset) Dataset Training Validation Test 8 • The training dataset contains most of the inputs-output pairs and is used to train the ANN
  • 9. Artificial Neural Networks • The learning process basically means to find the right weights • Supervised learning methods. Training phase: • Example input-output pairs are used (Dataset) Dataset Training Validation Test 9 • The test dataset is only used once the training has finished. • Check the quality of the ANN’s predictions for inputs it has not seen before, and hence to study its accuracy. • The accuracy is calculated: # predictions our model gets right # total of predictions • Thus, it is a number in the range [0; 1]. The closer to 1, the better
  • 10. Artificial Neural Networks • The learning process basically means to find the right weights • Supervised learning methods. Training phase: • Example input-output pairs are used (Dataset) Dataset Training Validation Test 10 • The validation dataset plays a similar role as the test dataset, during the training process. • Controls that the learning process is correct and avoid overfitting. • Any accuracy increase over the training dataset must yield to an accuracy increase over the validation dataset
  • 11. Architecture • Encoder-decoder architecture (avoids fixed size input/output constraints) + • Long short-term memory neural networks (longer memory than predecessors) Encoder LSTM network Decoder LSTM network Input Model Output Model 11
  • 12. Architecture • Sequence-to-Sequence transformations • Tree-to-tree transformations • Input layer to embed the input tree to a numeric vector + • Output layer to obtain the output model from the numeric vectors produced by the decoder Input Tree Embedding Layer Encoder LSTM network Output Tree Layer Decoder LSTM network Input Model Output Model 12
  • 13. • Attention mechanism • To pay more attention (remember better) to specific parts • Helps the decoder recognize the relevant information in the vectorial representation of the input AST at each step Architecture Input Tree Embedding Layer Encoder LSTM network Output Tree Layer Decoder LSTM network Attention Layer Input Model Output Model 13
  • 14. • Softmax • Multi-class classification which uses a softmax activation function • Maps each real number to a number in the (0; 1) range. Interpreted as probabilities • In each iteration, the component with higher probability is selected and its corresponding token passes to be part of the output Architecture Input Tree Embedding Layer Encoder LSTM network Output Tree Layer Softmax Decoder LSTM network Attention Layer Input Model Output Model 14
  • 15. • Pre- and post-processing required to… • represent models as trees • reduce the size of the training dataset by using a canonical form • rename variables to avoid the “dictionary problem” Model pre- and post-processing Input Model (preprocessed) Input Tree Embedding Layer Encoder LSTM network Output Tree Layer Softmax Output Model (non-postprocessed) Decoder LSTM network Attention Layer Input Model Output Model Preprocessing Postprocessing 15
  • 16. • Parameters that are not learned during training, but manually adjusted • No rule to choose the best hyperparameters for a specific task • Choosing the right values has a critical impact on the success and performance of the network Hyperparameters 16
  • 17. Hyperparameters 17 Hyperparameter Description Value Epoch • Number of times the complete training dataset is passed through the Neural Networks • In each epoch, the training dataset is randomly shuffled and split into batches 30 Batch • Set of input-output pairs • Each time a batch is passed, an iteration is completed 64 Neural Networks depth • Number of hidden layers in the neural networks 1 Embedding size • Size of the vectors • Needs to be higher tan the vocabulary size 64 Dropout • Select which weights are updated and which are not in each iteration • If all the weights were adjusted in each iteration, overfitting would be more likely to happen 0.75 (prob of a weight to be ignored) Learning rate • Controls how much the weights are adjusted • Value in the the range [0; 1] 0.005
  • 18. Cases and Results • We illustrate the feasibility and potential of our approach through its application in two main operations on models: • Model-to-Model transformation  Class 2 Relational • Code generation  UML 2 Java 18 Results: Neural networks are able to faithfully learn how to perform these tasks as long as enough data is provided and no contradictory examples are given
  • 19. Class 2 Relational Some transformation rules that need to be learned are: • Each Class is transformed into a Table; • Each DataType is transformed into a Type; • DataType is transformed into a Table, 19 • Each single-valued Attribute of type DataType is transformed into a Column; • Each multi-valued Attribute instance of the type
  • 20. Model representation MODEL ASSOC OBJ c Class ATTS isAbstract name false family OBJ a Attribute ATTS multivalued name false surname OBJ dt Datatype ATTS name String att c a ASSOC type a dt 20 { " source_ast ": { " root ": "<MODEL>", " children ": [ { " root ": "<OBJ>", " children ": [ { " root ": "D ", " children ": [ …
  • 21. Class 2 Relational: Results • Correctness • Measured through the accuracy and validation loss 21
  • 22. Class 2 Relational: Results • Performance 1. How long does it take for the training phase to complete? 22
  • 23. Class 2 Relational: Results • Performance 1. How long does it take for the training phase to complete? 2. How long it takes to transform an input model when the network is trained? 23
  • 24. Class 2 Relational: Results • Performance • Comparison with ATL • Synthetic models • Transformation and model from [1] • ATL: 0.033 seconds • Our approach: 0.722 seconds • Although a bit slower, same order of magnitude • Reasonable time • The advantages of our approach may pay off 24 [1] AtlanMod (Inria), Class to relational transformation example, https://www.eclipse.org/atl/atlTransformations/#Class2Relational
  • 25. UML 2 Java: Results 25 Example of translation rules: • UML classes are transformed into Java classes; • UML attributes into Java attributes; • UML associations into Java attributes referencing the class in the other end of the association Abstraction gap  Many variability points in the translation • E.g., Primitive data type conversions • UML attribute whose type is Real could be mapped to a Java attribute with type double, Double or
  • 26. UML 2 Java: Results 26 • Training dataset • Creation: 1. Downloaded the source code of the Eclipse IDE 2. Reverse engineer it with MoDisco 3. Removed the low-level details (e.g., method implementation) 4. Obtained the UML models • The initial dataset (D1) contains 25,375 input-output pairs
  • 27. UML 2 Java: Results 27 • Correctness Our definition of Accuracy: • worst-case scenario • we are sometimes discarding generated code that it is semantically equivalent to the expected output even if it presents slight syntactic differences
  • 28. UML 2 Java: Results 28 • Training dataset • Creation: 1. Downloaded the source code of the Eclipse IDE 2. Reverse engineer it with MoDisco 3. Removed the low-level details (e.g., method implementation) 4. Obtained the UML models • The initial dataset (D1) contains 25,375 input-output pairs • We had to curate it: 1. Discard pairs that exceed size (dataset D2) 2. Discard examples with inconsistencies (dataset D3) • E.g., due to inheritance and the location in the hierarchy of getters/setters • The curated dataset (D3) contains 8,937 input-output pairs
  • 29. UML 2 Java: Results 29 • Correctness
  • 30. UML 2 Java: Results 30 • Performance • Training • Generating code: • Average time of 18 milliseconds • Standard deviation of 3 milliseconds • Efficient enough to be part of any continuous software development process
  • 31. 3 1 Limitations/Discussion • Generalization problem • predicting output solutions for input models very different from the training distribution it has learn from • Social acceptance • Size of the training dataset • Size of the input-output pairs • Diversity in the training set • Computational limitations of ANNs • i.e., mathematical operations
  • 32. Future work • Study of transformers • Validation of our approach with MT chains • Connectors for EMF models • Pretrained networks for an easy quick start 32
  • 33. References [1] Loli Burgueño, Jordi Cabot, Sébastien Gérard. An LSTM-Based Neural Network Architecture for Model Transformations. In Proc. of MoDELS 2019: 294-299 [2] Loli Burgueño, Jordi Cabot, Shuai Li, Sébastien Gérard. A Generic LSTM Neural Network Architecture to Infer Heterogeneous Model Transformations. Software and Systems Modeling. 2021. DOI: 10.1007/s10270-021-00893-y 33

Editor's Notes

  1. The loss is another metric in charge of monitoring the quality of the training. The loss reports the sum of the error made for each example in the dataset, thus it should be as close as 0 as possible. It is expected that a decrease in training loss should trigger a decrease in validation loss.
  2. In our scenario, we may need this long-term memory to remember previous mappings as part of a more complex mapping pattern
  3. The correctness of ANNs is studied through its accuracy and overfitting (being the latter measured through the validation loss). The accuracy should be as close as 1 as possible while the validation loss as close to 0 as possible. The accuracy is calculated comparing for each input model in the test dataset whether the output of the network corresponds with the expected output. If it does, the network was able to successfully predict the target model for the given input model. The accuracy grows and the loss decreases with the size of the dataset, i.e., the more input-output pairs we provide for training, the better our software learns and predicts (transforms). In this concrete case, with a dataset with 1000 models, the accuracy is 1 and the loss 0 (meaning that no overfitting was taking place), which means that the ANNs are perfectly trained and ready to use. Note that we show the size of the complete dataset but, we have split it using an 80% of the pairs for training, a 10% for validation and another 10% for testing.