Commit 29c1d9f8 authored by Kirhan, Cihad's avatar Kirhan, Cihad
Browse files

ConfLang integration

parent cbbea643
Pipeline #436090 failed with stage
in 1 minute and 43 seconds
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.emadl.generator;
import com.google.common.base.CaseFormat;
import com.google.common.base.Charsets;
import com.google.common.base.Joiner;
import com.google.common.base.Splitter;
import com.google.common.io.Resources;
import conflang._ast.ASTComponentLiteral;
import conflang._ast.ASTMCQualifiedName;
import conflang._ast.ASTSimpleConfigurationEntry;
import conflang._symboltable.*;
import de.monticore.io.paths.ModelPath;
......@@ -35,19 +33,15 @@ import de.monticore.lang.monticar.emadl.tagging.dltag.LayerPathParameterSymbol;
import de.monticore.lang.monticar.generator.FileContent;
import de.monticore.lang.monticar.generator.MathCommandRegister;
import de.monticore.lang.monticar.generator.cmake.CMakeConfig;
import de.monticore.lang.monticar.generator.cmake.CMakeFindModule;
import de.monticore.lang.monticar.generator.cpp.*;
import de.monticore.lang.monticar.generator.cpp.converter.TypeConverter;
import de.monticore.lang.monticar.generator.pythonwrapper.GeneratorPythonWrapperFactory;
import de.monticore.lang.monticar.generator.pythonwrapper.GeneratorPythonWrapperStandaloneApi;
import de.monticore.lang.monticar.generator.pythonwrapper.symbolservices.data.ComponentPortInformation;
import de.monticore.lang.monticar.semantics.Constants;
import de.monticore.lang.monticar.semantics.ExecutionSemantics;
import de.monticore.lang.monticar.semantics.util.BasicLibrary;
import de.monticore.lang.tagging._symboltable.TagSymbol;
import de.monticore.lang.tagging._symboltable.TaggingResolver;
import de.monticore.literals.literals._ast.ASTSignedIntLiteral;
import de.monticore.literals.literals._ast.ASTSignedLiteral;
import de.monticore.symboltable.GlobalScope;
import de.monticore.symboltable.Scope;
import de.monticore.symboltable.Symbol;
......@@ -797,7 +791,7 @@ public class EMADLGenerator implements EMAMGenerator {
throw new RuntimeException("No schema definition for configuration available!");
}
SchemaLangDefinitionSymbol schemaLangDefinitionSymbol = schemaLangDefinitionSymbolOpt.get();
schemaLangDefinitionSymbol.validate(configurationSymbol);
schemaLangDefinitionSymbol.validateConfiguration(configurationSymbol);
// TODO Add method to ConfLangConfigurationSymbol to search for configuration entries of any kind
Optional<Symbol> criticSymbolOpt = configurationSymbol.getSpannedScope().resolve(ConfigEntryNameConstants.CRITIC, ConfigurationEntryKind.KIND);
......
......@@ -10,6 +10,7 @@ configuration LeNetNetwork{
context = "cpu"
normalize = false
eval_metric = "accuracy"
clip_global_grad_norm = 31.5
optimizer = adam{
learning_rate = 0.001
learning_rate_policy = fixed
......
......@@ -19,4 +19,12 @@ if __name__ == "__main__":
mnist_mnistClassifier_net_trainer.train(
batch_size=32,
num_epoch=7894561,
load_checkpoint=False,
checkpoint_period=345,
log_period=10,
load_pretrained=False,
context='cpu',
preprocessing=True,
normalize=False,
)
......@@ -19,4 +19,11 @@ if __name__ == "__main__":
mnist_mnistClassifier_net_trainer.train(
batch_size=32,
num_epoch=7894561,
load_checkpoint=False,
checkpoint_period=345,
log_period=10,
load_pretrained=False,
context='cpu',
normalize=False,
)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment