Commit 01939ebd authored by Sebastian N.'s avatar Sebastian N.

Added invariant test

parent 133c0326
Pipeline #157635 failed with stages
in 17 seconds
......@@ -190,6 +190,14 @@ public class GenerationTest extends AbstractSymtabTest {
"mnist_mnistClassifier_net.h"));
}
@Test
public void testInvariantForGluon() throws IOException, TemplateException {
Log.getFindings().clear();
String[] args = {"-m", "src/test/resources/models/", "-r", "Invariant", "-b", "GLUON", "-f", "n", "-c", "n"};
EMADLGeneratorCli.main(args);
assertTrue(Log.getFindings().size() == 0);
}
@Test
public void testGluonReinforcementModelGymEnvironment() {
Log.getFindings().clear();
......
......@@ -22,6 +22,7 @@ package de.monticore.lang.monticar.emadl;
import de.monticore.lang.monticar.emadl.generator.EMADLGeneratorCli;
import de.se_rwth.commons.logging.Log;
import org.junit.Ignore;
import org.junit.Test;
import java.nio.file.Files;
......@@ -34,8 +35,6 @@ import static org.junit.Assert.assertFalse;
public class IntegrationGluonTest extends IntegrationTest {
private Path multipleInputsHashFile = Paths.get("./target/generated-sources-emadl/MultipleInputs.training_hash");
private Path multipleOutputsHashFile = Paths.get("./target/generated-sources-emadl/MultipleOutputs.training_hash");
private Path multipleStreamsHashFile = Paths.get("./target/generated-sources-emadl/MultipleStreams.training_hash");
public IntegrationGluonTest() {
......
configuration Invariant{
num_epoch:10
batch_size:5
context:cpu
optimizer:adam{
learning_rate:0.01
learning_rate_decay:0.8
step_size:1000
weight_decay:0.0001
}
}
component Invariant{
ports in Z(0:3)^{1} data[2],
out Q(0:1)^{4} pred[3];
implementation CNN {
data[0] ->
FullyConnected(units=4) ->
Softmax() ->
pred[0];
data[1] ->
OneHot(size=4) ->
pred[1];
1 ->
OneHot(size=4) ->
pred[2];
}
}
\ No newline at end of file
......@@ -10,4 +10,5 @@ instanceTestCifar.CifarNetwork src/test/resources/training_data/Cifar
mnist.LeNetNetwork data/mnist.LeNetNetwork
MultipleInputs src/test/resources/training_data/MultipleInputs
MultipleOutputs src/test/resources/training_data/MultipleOutputs
MultipleStreams src/test/resources/training_data/MultipleStreams
\ No newline at end of file
MultipleStreams src/test/resources/training_data/MultipleStreams
Invariant src/test/resources/training_data/Invariant
\ No newline at end of file
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