EMADL2CPP issueshttps://git.rwth-aachen.de/monticore/EmbeddedMontiArc/generators/EMADL2CPP/-/issues2024-02-05T12:17:13+01:00https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/generators/EMADL2CPP/-/issues/123Schema validation fails when root model is not called 'MnistClassifier' (PyTo...2024-02-05T12:17:13+01:00Jonas DjurevciSchema validation fails when root model is not called 'MnistClassifier' (PyTorch Backend)# Remark
The training configuration of a network must be named `<componentName>_<networkInstanceName>` (where `componentName` is the name of the component containing the network instance, and `networkInstanceName` is the name of the netw...# Remark
The training configuration of a network must be named `<componentName>_<networkInstanceName>` (where `componentName` is the name of the component containing the network instance, and `networkInstanceName` is the name of the network instance inside that component). For example, the training configuration of the network in 'adanet_experiment' must be named `mnistClassifier_net`, since the component containing the network is called 'MnistClassifier' and the instance name is 'net'. If the configuration name does not follow that pattern, executing the generated Python script will fail.
# Problem
During schema validation, the name of the configuration is checked for hardcoded values (see `de.monticore.mlpipelines.automl.helper.ConfigurationValidationHandler.getScmName()`). This means, that schema validation only succeeds if the name of the configuration is 'Supervised' or starts with 'mnistClassifier'. The first option is not viable, as the name must follow the pattern from above (see remark). Therefore, the configuration must be named `mnistClassifier_<networkInstanceName>`, which consequently means that the root emadl model must be called 'MnistClassifier' or 'mnistClassifier'. Executing the EMADL2CPP generator on other models will therefore fail.
# Steps to reproduce
Execute the generator on an architecture, whose root model is not called 'MnistClassifier' or 'mnistClassifier'. Example execution:
- Main class: `de.monticore.lang.monticar.emadl.generator.MontiAnnaCli`
- Program arguments: `-m src/main/resources/calculator_experiment/emadl -r calculator.Connector -o target -b PYTORCH`
# Workaround
Until this issue is fixed, the method `getScmName()` (see above) must be modified to allow schema validation for configurations with custom names. To allow the execution above, the method must be modified as follows:
```
private static String getScmName(ASTConfiguration configuration) {
String scmName = configuration.getName();
if (scmName.startsWith("mnistClassifier") || scmName.startsWith("connector")) {
scmName = "Supervised";
} else if (scmName.equals("AdaNet")) {
scmName = "NeuralArchitectureSearch";
}
return scmName;
}
```Antonio AntovskiAntonio Antovskihttps://git.rwth-aachen.de/monticore/EmbeddedMontiArc/generators/EMADL2CPP/-/issues/122Network Tagging is ignored (PyTorch Backend)2024-02-05T12:17:01+01:00Jonas DjurevciNetwork Tagging is ignored (PyTorch Backend)# Problem
Multiple instances of the same network are trained separately instead of only once, even though a tagging file is present. While the tagging file is parsed and used to download the dataset, it is not used to determine, which ne...# Problem
Multiple instances of the same network are trained separately instead of only once, even though a tagging file is present. While the tagging file is parsed and used to download the dataset, it is not used to determine, which network instances have to be trained (see method `de.monticore.mlpipelines.workflow.AbstractWorkflow.getNetworkInstanceConfigs`). This requires the provision of one training and one pipeline configuration file per network instance.
# Steps to reproduce
Note: Getting far enough to trigger this problem requires implementing the workaround presented in issue #123, given that it is not yet solved.
Execute the EMADL2CPP generator on the MNISTCalculator example application located in `src/main/resources/calculator_experiment`.
For this purpose, use the following Run Configuration:
- Main class: `de.monticore.lang.monticar.emadl.generator.MontiAnnaCli`
- Program arguments: `-m src/main/resources/calculator_experiment/emadl -r calculator.Connector -o target -b PYTORCH`Antonio AntovskiAntonio Antovskihttps://git.rwth-aachen.de/monticore/EmbeddedMontiArc/generators/EMADL2CPP/-/issues/121Training loss is NaN sometimes (PyTorch Backend)2024-02-05T12:16:44+01:00Jonas DjurevciTraining loss is NaN sometimes (PyTorch Backend)# Problem
When running certain experiments, the training loss calculation in src/main/resources/experiments/steps/MySupervisedTrainer.py (line 80) sometimes returns 'NaN'. This results in debug messages like:
`Epoch:1 Train Loss:nan Trai...# Problem
When running certain experiments, the training loss calculation in src/main/resources/experiments/steps/MySupervisedTrainer.py (line 80) sometimes returns 'NaN'. This results in debug messages like:
`Epoch:1 Train Loss:nan Train Accuracy:10.03%`
# Steps to reproduce
Note: Getting far enough to trigger this problem requires implementing the workaround presented in issue #123, given that it is not yet solved.
This issue is not deterministic. However, when executing the EMADL2CPP generator as follows, there is a high chance of encountering the problem.
- Main class: `de.monticore.lang.monticar.emadl.generator.MontiAnnaCli`
- Program arguments: `-m src/main/resources/calculator_experiment/emadl -r calculator.Connector -o target -b PYTORCH`
Out of the six runs generated by this execution, typically 2-4 runs exhibit this behavior.
I've never encountered this issue with other experiments like the 'adanet_experiment' or 'squaredigit_experiment', even though all mentioned experiments use the same loss metric (cross entropy).Antonio AntovskiAntonio Antovskihttps://git.rwth-aachen.de/monticore/EmbeddedMontiArc/generators/EMADL2CPP/-/issues/112Saving checkpoints during the model training (PyTorch backend)2023-05-25T16:14:07+02:00Nazish QamarSaving checkpoints during the model training (PyTorch backend)Problem: The PyTorch backend allows saving the trained model only after the complete training.
Improvement: The training pipeline should save the model checkpoints after each epoch. If one tries to run the incomplete experiment later, t...Problem: The PyTorch backend allows saving the trained model only after the complete training.
Improvement: The training pipeline should save the model checkpoints after each epoch. If one tries to run the incomplete experiment later, there should be a provision in the training pipeline to load the latest checkpoint and continue the training from there.aixaiaixaihttps://git.rwth-aachen.de/monticore/EmbeddedMontiArc/generators/EMADL2CPP/-/issues/109Open to-dos MA Mulhem2023-02-12T17:37:21+01:00Feras MulhemOpen to-dos MA MulhemOpen to-dos derived from Mulhem's Master thesis
- #108
- #107
- #106Open to-dos derived from Mulhem's Master thesis
- #108
- #107
- #106aixaiaixaihttps://git.rwth-aachen.de/monticore/EmbeddedMontiArc/generators/EMADL2CPP/-/issues/108Workflow adjustment for multiple networks2023-02-12T17:37:21+01:00Feras MulhemWorkflow adjustment for multiple networks**Current situation**
The current workflow assumes one EMADL component representing a neural network. For applications like the MNISTCalculator we need to deal with multiple networks, possibly trained with different training configurati...**Current situation**
The current workflow assumes one EMADL component representing a neural network. For applications like the MNISTCalculator we need to deal with multiple networks, possibly trained with different training configurations.
**Tasks**
- [ ] When an EMADL model is given, iterate the model looking up all networks.
**Notes**
- The [EMADLGenerator] implemented (https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/generators/EMADL2CPP/-/blob/master/src/main/java/de/monticore/lang/monticar/emadl/generator/EMADLGenerator.java#L988) this functionality
- An example of how to resolve a neural network in an emadl model is given [here](https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/generators/EMADL2CPP/-/blob/master/src/main/java/de/monticore/mlpipelines/workflow/AbstractWorkflow.java#L100)https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/generators/EMADL2CPP/-/issues/107Naming conventions for emadl network components2023-02-12T17:37:21+01:00Feras MulhemNaming conventions for emadl network components**Current situation**
- A [naming convention](https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/generators/EMADL2CPP/-/blob/master/src/main/java/de/monticore/mlpipelines/workflow/AbstractWorkflow.java#L67) is followed to resolve conf...**Current situation**
- A [naming convention](https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/generators/EMADL2CPP/-/blob/master/src/main/java/de/monticore/mlpipelines/workflow/AbstractWorkflow.java#L67) is followed to resolve configuration such that these are assumed to have the _full name_ of a to-be-trained neural network.
**Tasks**
- [ ] Adjust the naming conventions to exclude the _package name_ from the network full name
- [ ] Adjust the names of the corresponding configurations accordingly. The configurations need also to have package information explicitly ( i.e. _package MyPackage_)https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/generators/EMADL2CPP/-/issues/106Link pipeline configurations to their reference model2023-04-25T19:50:07+02:00Feras MulhemLink pipeline configurations to their reference modelThis issue aims to enable the toolchain to resolve the correct pipeline reference model based on the pipeline configuration. This mechanism is similar to resolving the training-time architectures using training configuration.
**Tasks**
...This issue aims to enable the toolchain to resolve the correct pipeline reference model based on the pipeline configuration. This mechanism is similar to resolving the training-time architectures using training configuration.
**Tasks**
- [ ] Add a schema definition that contains an entry for the desired reference model
- [ ] in the pipeline configuration add an entry that determines which schema shall be used ( for example _learning method_)
- [ ] Resolve the corresponding schema definitions for the given pipeline configuration
- [ ] Validate the pipeline configuration (similar to [training configurations](https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/generators/EMADL2CPP/-/blob/master/src/main/java/de/monticore/mlpipelines/workflow/AbstractWorkflow.java#L139))
**Notes**
- The above-mentioneed steps shall be added as part of the commen [workflow ](https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/generators/EMADL2CPP/-/blob/master/src/main/java/de/monticore/mlpipelines/workflow/AbstractWorkflow.java#L139 ) for ML pipelines.
- Currently, the workflow resolves a default pipeline reference modelTobias HörnschemeyerNazish QamarHiroshi HamanoAkashKumarDSTobias Hörnschemeyerhttps://git.rwth-aachen.de/monticore/EmbeddedMontiArc/generators/EMADL2CPP/-/issues/65MontiAnna Configuration Model2023-03-24T23:15:00+01:00Evgeny KusmenkoMontiAnna Configuration Model- [x] Please create a meta-model of a MontiAnna configuration as a class diagram
- [x] Please define the SA model transformation performed on the metal model , e.g. using pseudo-code
- [x] Please define the model transformation of other ...- [x] Please create a meta-model of a MontiAnna configuration as a class diagram
- [x] Please define the SA model transformation performed on the metal model , e.g. using pseudo-code
- [x] Please define the model transformation of other hyperparameter search algorithms performed on the configuration metal model , e.g. using pseudo-code
- [x] Please create object diagrams conforming to the meta-model for several steps of SA and other algorithms, cf. [OD ticket](https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/generators/EMADL2CPP/-/issues/63)Hiroshi HamanoAkashKumarDSHiroshi Hamano2023-03-10https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/generators/EMADL2CPP/-/issues/45Explicit input and output shape required2022-09-02T17:30:04+02:00Luis LaasExplicit input and output shape requiredA component currently requires explicit input and output shapes to be successfully parsed.
This works:
package rangePrediction;
component MLPL{
ports in Q(0:100)^{1} data,
out Q(-oo:+oo)^{1} prediction;
...A component currently requires explicit input and output shapes to be successfully parsed.
This works:
package rangePrediction;
component MLPL{
ports in Q(0:100)^{1} data,
out Q(-oo:+oo)^{1} prediction;
implementation CNN {
data -> prediction;
}
}
However this does not work:
package rangePrediction;
component MLPL{
ports in Q(0:100) data,
out Q(-oo:+oo) prediction;
implementation CNN {
data -> prediction;
}
}
Generating code terminates with this Exception:
Exception in thread "main" java.lang.IllegalStateException: Unknown port type
The expected behavior is that both versions work.
generator-version: 0.5.3
environment: registry.git.rwth-aachen.de/monticore/embeddedmontiarc/generators/emadl2cpp/mxnet/190https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/generators/EMADL2CPP/-/issues/43AutoML: Hyperparameter Search2023-03-04T10:41:15+01:00Evgeny KusmenkoAutoML: Hyperparameter Search- Please extend the framework to optimize the MontiAnna hyperparameters for a given learning problem
- extend the framework to automatically exchange pipeline components, e.g. exchange image preprocessing components
- create tests for yo...- Please extend the framework to optimize the MontiAnna hyperparameters for a given learning problem
- extend the framework to automatically exchange pipeline components, e.g. exchange image preprocessing components
- create tests for your framework
- create a model in the MNISTCalculator project X
- create a CI experiment in the MNISTCalculator projectHiroshi HamanoAkashKumarDSHiroshi Hamano2023-05-01https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/generators/EMADL2CPP/-/issues/36Reference models not copied to generation target path2022-03-31T09:44:03+02:00Ghost UserReference models not copied to generation target pathThe method `EMADLGenerator.copySchemaFilesFromResource` (https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/generators/EMADL2CPP/-/blob/master/src/main/java/de/monticore/lang/monticar/emadl/generator/EMADLGenerator.java#L1104) copies ...The method `EMADLGenerator.copySchemaFilesFromResource` (https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/generators/EMADL2CPP/-/blob/master/src/main/java/de/monticore/lang/monticar/emadl/generator/EMADLGenerator.java#L1104) copies the schema files (`*.scm`) to the generation target path, however, it does not copy the reference models (`*.ema`), leading to exceptions when running the generator with the reinforcement learning and GAN pipelines.
This method must be changed such that along with the schema files, also the reference models are copied to the generation target path.https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/generators/EMADL2CPP/-/issues/33Generation of execute code fails for similar component names2021-12-07T12:45:51+01:00Evgeny KusmenkoGeneration of execute code fails for similar component namesSometimes the generator confuses similar component names, e.g. `number1_ones` and `number1` in
[this model](https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/applications/mnistcalculator/-/blob/1718997f3019e4efe3da4fa853f1df460406400...Sometimes the generator confuses similar component names, e.g. `number1_ones` and `number1` in
[this model](https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/applications/mnistcalculator/-/blob/1718997f3019e4efe3da4fa853f1df4604064009/gluon-cpp/src/emadl/models/cNNCalculator/Calculator.emadl)
here the `number1 ` component gets executed instead of `number1_ones`, `number1_tens`, `number1_hundreds`. Same happens for `number2` and the respective ArgMax components.
Please fix this and rename the Argmax components back to `number1_ones`, `number1_tens`, `number1_hundreds`, etc. in the master branch.https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/generators/EMADL2CPP/-/issues/32Failing tests2021-11-22T12:08:50+01:00Ghost UserFailing testsThe following test cases were not executed by the pipeline due to a process termination caused by a wrong initializing of the global logger. After fixing the issue, the following tests are now failing and must be fixed.
- CMakeGeneratio...The following test cases were not executed by the pipeline due to a process termination caused by a wrong initializing of the global logger. After fixing the issue, the following tests are now failing and must be fixed.
- CMakeGenerationTest.testModelWithIpopt()
- IntegrationGluonTest.testEpisodicMemorySimple()
- IntegrationGluonTest.testGluonPreprocessingWithSupervised()
- IntegrationGluonTest.testGluonPreprocessingWithGAN()https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/generators/EMADL2CPP/-/issues/31Order of input port names2021-12-07T16:21:14+01:00Evgeny KusmenkoOrder of input port namesthere is a bug concerning usage of input port names / layer names. order seems to override namesthere is a bug concerning usage of input port names / layer names. order seems to override namesNils BaumannNils Baumannhttps://git.rwth-aachen.de/monticore/EmbeddedMontiArc/generators/EMADL2CPP/-/issues/30LoadNetwork: Input output names are fixed2021-11-19T14:57:50+01:00Evgeny KusmenkoLoadNetwork: Input output names are fixedinput and output must be named data and softmax , this should be changed to allow arbitrary namesinput and output must be named data and softmax , this should be changed to allow arbitrary namesDmytro SemenchenkoDmytro Semenchenkohttps://git.rwth-aachen.de/monticore/EmbeddedMontiArc/generators/EMADL2CPP/-/issues/29link to docker files not working2021-11-10T11:07:13+01:00Jonas Ritzlink to docker files not workinglink to docker files from the README.md file does not see to work (first section of Prerequisites)link to docker files from the README.md file does not see to work (first section of Prerequisites)https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/generators/EMADL2CPP/-/issues/26Output ports can not be used for further connects2021-03-14T14:15:44+01:00Andreas WahlenOutput ports can not be used for further connectsWhen using an output port as a source of a connect statement, there will be no error or warning but no corresponding code will be generated.
This should either throw an error or just work. Could be helpful in situations like the followi...When using an output port as a source of a connect statement, there will be no error or warning but no corresponding code will be generated.
This should either throw an error or just work. Could be helpful in situations like the following:
```
package ...;
component Test {
port
in x,
out y,
out z;
instance InstX instX;
instance InstY instY;
connect x -> instX.param;
connect instX.res -> y;
connect y -> instY.param; // this is the problematic line, one could of course also use instX.res again
connect instY.res -> z;
}
```Evgeny KusmenkoEvgeny Kusmenkohttps://git.rwth-aachen.de/monticore/EmbeddedMontiArc/generators/EMADL2CPP/-/issues/25Usage of type N inside structs leads to error2021-02-10T17:31:17+01:00Andreas WahlenUsage of type N inside structs leads to errorError message is: [ERROR] 0xA1038 SymbolReference Could not load full information of 'N' (Kind de.monticore.lang.monticar.ts.MCTypeSymbolKind)
No stack trace present.Error message is: [ERROR] 0xA1038 SymbolReference Could not load full information of 'N' (Kind de.monticore.lang.monticar.ts.MCTypeSymbolKind)
No stack trace present.Evgeny KusmenkoEvgeny Kusmenkohttps://git.rwth-aachen.de/monticore/EmbeddedMontiArc/generators/EMADL2CPP/-/issues/24Warning for types in structs2021-02-10T17:09:12+01:00Andreas WahlenWarning for types in structs`[WARN] unknown type symbol: Q`
Where Q is the type used inside a struct. Could also be N, Z, ...
After all the generator produces the expected code correctly.`[WARN] unknown type symbol: Q`
Where Q is the type used inside a struct. Could also be N, Z, ...
After all the generator produces the expected code correctly.Evgeny KusmenkoEvgeny Kusmenko