Commit 5196adbc authored by Sebastian Nickels's avatar Sebastian Nickels

Bumped version numbers and prepared test for multiple outputs

parent bd3b512b
Pipeline #147141 failed with stages
in 5 minutes and 30 seconds
......@@ -8,18 +8,18 @@
<groupId>de.monticore.lang.monticar</groupId>
<artifactId>embedded-montiarc-emadl-generator</artifactId>
<version>0.3.0-SNAPSHOT</version>
<version>0.3.1-SNAPSHOT</version>
<!-- == PROJECT DEPENDENCIES ============================================= -->
<properties>
<!-- .. SE-Libraries .................................................. -->
<emadl.version>0.2.7-SNAPSHOT</emadl.version>
<emadl.version>0.2.8-SNAPSHOT</emadl.version>
<CNNTrain.version>0.3.0-SNAPSHOT</CNNTrain.version>
<cnnarch-mxnet-generator.version>0.2.14-SNAPSHOT</cnnarch-mxnet-generator.version>
<cnnarch-caffe2-generator.version>0.2.11-SNAPSHOT</cnnarch-caffe2-generator.version>
<cnnarch-gluon-generator.version>0.2.0-SNAPSHOT</cnnarch-gluon-generator.version>
<cnnarch-mxnet-generator.version>0.2.16-SNAPSHOT</cnnarch-mxnet-generator.version>
<cnnarch-caffe2-generator.version>0.2.12-SNAPSHOT</cnnarch-caffe2-generator.version>
<cnnarch-gluon-generator.version>0.2.1-SNAPSHOT</cnnarch-gluon-generator.version>
<embedded-montiarc-math-opt-generator>0.1.4</embedded-montiarc-math-opt-generator>
<!-- .. Libraries .................................................. -->
......
......@@ -25,6 +25,7 @@ import de.se_rwth.commons.logging.Log;
import org.junit.Test;
import java.nio.file.Files;
import java.nio.file.NoSuchFileException;
import java.nio.file.Path;
import java.nio.file.Paths;
......@@ -34,6 +35,7 @@ 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");
public IntegrationGluonTest() {
super("GLUON", "39253EC049D4A4E5FA0536AD34874B9D#1DBAEE1B1BD83FB7CB5F70AE91B29638#C4C23549E737A759721D6694C75D9771#5AF0CE68E408E8C1F000E49D72AC214A");
......@@ -43,7 +45,7 @@ public class IntegrationGluonTest extends IntegrationTest {
public void testMultipleInputs() {
Log.getFindings().clear();
deleteMultipleInputsHashFile();
deleteHashFile(multipleInputsHashFile);
String[] args = {"-m", "src/test/resources/models/", "-r", "MultipleInputs", "-b", "GLUON"};
EMADLGeneratorCli.main(args);
......@@ -51,9 +53,24 @@ public class IntegrationGluonTest extends IntegrationTest {
assertTrue(Log.getFindings().isEmpty());
}
private void deleteMultipleInputsHashFile() {
/*@Test
public void testMultipleOutputs() {
Log.getFindings().clear();
deleteHashFile(multipleOutputsHashFile);
String[] args = {"-m", "src/test/resources/models/", "-r", "MultipleOutputs", "-b", "GLUON"};
EMADLGeneratorCli.main(args);
assertTrue(Log.getFindings().isEmpty());
}*/
private void deleteHashFile(Path hashFile) {
try {
Files.delete(multipleInputsHashFile);
Files.delete(hashFile);
}
catch (NoSuchFileException e) {
}
catch(Exception e) {
assertFalse("Could not delete hash file", true);
......
configuration MultipleOutputs{
num_epoch:10
batch_size:64
normalize:true
load_checkpoint:false
optimizer:adam{
learning_rate:0.01
learning_rate_decay:0.8
step_size:1000
}
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 MultipleOutputs{
ports in Q(-oo:+oo)^{10,1,1} data,
out Q(0:1)^{4} pred[2];
ports in Z(0:255)^{3, 32, 32} data,
out Q(0:1)^{10} pred[2];
implementation CNN {
data ->
FullyConnected(units=128, no_bias=true) ->
Tanh() ->
(
FullyConnected(units=16, no_bias=true) ->
Tanh() ->
FullyConnected(units=4, no_bias=true)
|
FullyConnected(units=16, no_bias=true) ->
Tanh() ->
FullyConnected(units=4, no_bias=true)
) ->
Convolution(kernel=(5,5), channels=8, padding="valid") ->
Convolution(kernel=(5,5), channels=8, padding="valid") ->
FullyConnected(units=128) ->
Dropout() ->
FullyConnected(units=10) ->
(
[0] ->
Softmax() ->
pred[0]
|
[1] ->
Softmax() ->
pred[1]
);
......
configuration MultipleOutputs{
num_epoch:10
batch_size:64
normalize:true
load_checkpoint:false
optimizer:adam{
learning_rate:0.01
learning_rate_decay:0.8
step_size:1000
}
}
component MultipleOutputs{
ports in Q(-oo:+oo)^{10,1,1} data,
out Q(0:1)^{4} pred[2];
implementation CNN {
data ->
FullyConnected(units=128, no_bias=true) ->
Tanh() ->
(
FullyConnected(units=16, no_bias=true) ->
Tanh() ->
FullyConnected(units=4, no_bias=true)
|
FullyConnected(units=16, no_bias=true) ->
Tanh() ->
FullyConnected(units=4, no_bias=true)
) ->
(
[0] ->
Softmax() ->
pred[0]
|
[1] ->
Softmax() ->
pred[1]
);
}
}
\ No newline at end of file
cifar10.CifarNetwork src/test/resources/training_data
simpleCifar10.CifarNetwork src/test/resources/training_data
cNNCalculator.Network src/test/resources/training_data
MultipleOutputs data/MultipleOutputs
cifar10.CifarNetwork src/test/resources/training_data/Cifar
simpleCifar10.CifarNetwork src/test/resources/training_data/Cifar
cNNCalculator.Network src/test/resources/training_data/Cifar
InstanceTest.NetworkB data/InstanceTest.NetworkB
Alexnet data/Alexnet
ThreeInputCNN_M14 data/ThreeInputCNN_M14
VGG16 data/VGG16
ResNeXt50 data/ResNeXt50
instanceTestCifar.CifarNetwork src/test/resources/training_data
instanceTestCifar.CifarNetwork src/test/resources/training_data/Cifar
mnist.LeNetNetwork data/mnist.LeNetNetwork
MultipleInputs src/test/resources/training_data/MultipleInputs
\ No newline at end of file
MultipleInputs src/test/resources/training_data/MultipleInputs
MultipleOutputs src/test/resources/training_data/MultipleOutputs
\ No newline at end of file
......@@ -18,7 +18,7 @@ class MyConstant(mx.init.Initializer):
class CNNCreator_cifar10_cifar10Classifier_net:
module = None
_data_dir_ = "src/test/resources/training_data/"
_data_dir_ = "src/test/resources/training_data/Cifar/"
_model_dir_ = "model/cifar10.CifarNetwork/"
_model_prefix_ = "model"
_input_names_ = ['data']
......
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