Commit 8ef4c449 authored by aa's avatar aa Committed by Julian Johannes Steinsberger-Dührßen

Added Tensorflow generator

parent 00b67fc7
......@@ -21,6 +21,7 @@
<cnnarch-mxnet-generator.version>0.2.17-SNAPSHOT</cnnarch-mxnet-generator.version>
<cnnarch-caffe2-generator.version>0.2.13-SNAPSHOT</cnnarch-caffe2-generator.version>
<cnnarch-gluon-generator.version>0.2.8-SNAPSHOT</cnnarch-gluon-generator.version>
<cnnarch-tensorflow-generator.version>0.2.14-SNAPSHOT</cnnarch-tensorflow-generator.version>
<embedded-montiarc-math-opt-generator>0.1.4</embedded-montiarc-math-opt-generator>
<!-- .. Libraries .................................................. -->
......@@ -86,6 +87,12 @@
<version>${cnnarch-gluon-generator.version}</version>
</dependency>
<dependency>
<groupId>de.monticore.lang.monticar</groupId>
<artifactId>cnnarch-tensorflow-generator</artifactId>
<version>${cnnarch-tensorflow-generator.version}</version>
</dependency>
<dependency>
<groupId>de.monticore.lang.monticar</groupId>
<artifactId>cnnarch-caffe2-generator</artifactId>
......
......@@ -6,10 +6,12 @@ import de.monticore.lang.monticar.cnnarch.generator.CNNTrainGenerator;
import de.monticore.lang.monticar.cnnarch.gluongenerator.CNNArch2Gluon;
import de.monticore.lang.monticar.cnnarch.gluongenerator.CNNTrain2Gluon;
import de.monticore.lang.monticar.cnnarch.mxnetgenerator.CNNArch2MxNet;
import de.monticore.lang.monticar.cnnarch.caffe2generator.CNNArch2Caffe2;
import de.monticore.lang.monticar.cnnarch.mxnetgenerator.CNNTrain2MxNet;
import de.monticore.lang.monticar.cnnarch.caffe2generator.CNNArch2Caffe2;
import de.monticore.lang.monticar.cnnarch.caffe2generator.CNNTrain2Caffe2;
import de.monticore.lang.monticar.emadl.generator.reinforcementlearning.RewardFunctionCppGenerator;
import de.monticore.lang.monticar.cnnarch.tensorflowgenerator.CNNArch2Tensorflow;
import de.monticore.lang.monticar.cnnarch.tensorflowgenerator.CNNTrain2Tensorflow;
import java.util.Optional;
......@@ -44,7 +46,16 @@ public enum Backend {
return new CNNTrain2Gluon(new RewardFunctionCppGenerator());
}
};
TENSORFLOW{
@Override
public CNNArchGenerator getCNNArchGenerator() {
return new CNNArch2Tensorflow();
}
@Override
public CNNTrainGenerator getCNNTrainGenerator() {
return new CNNTrain2Tensorflow();
}
};
public abstract CNNArchGenerator getCNNArchGenerator();
public abstract CNNTrainGenerator getCNNTrainGenerator();
......@@ -55,9 +66,12 @@ public enum Backend {
case "CAFFE2":
return Optional.of(CAFFE2);
case "GLUON":
return Optional.of(GLUON);
case "TENSORFLOW":
return Optional.of(TENSORFLOW);
default:
return Optional.empty();
......@@ -70,6 +84,8 @@ public enum Backend {
return "CAFFE2";
case GLUON:
return "GLUON";
case TENSORFLOW:
return "TENSORFLOW";
default:
return "MXNET";
}
......
......@@ -239,6 +239,7 @@ public class EMADLGenerator {
String b = backend.getBackendString(backend);
String trainingDataHash = "";
String testDataHash = "";
if (architecture.get().getDataPath() != null) {
if (b.equals("CAFFE2")) {
trainingDataHash = getChecksumForFile(architecture.get().getDataPath() + "/train_lmdb/data.mdb");
......
......@@ -52,7 +52,7 @@ public class EMADLGeneratorCli {
.build();
public static final Option OPTION_BACKEND = Option.builder("b")
.longOpt("backend")
.desc("deep-learning-framework backend. Options: MXNET, CAFFE2, GLUON")
.desc("deep-learning-framework backend. Options: MXNET, CAFFE2, GLUON, TENSORFLOW")
.hasArg(true)
.required(false)
.build();
......
Loading checkpoint: model-0200.params
Epoch[200] Train-accuracy=0.100000
Epoch[200] Time cost=0.025
Epoch[200] Validation-accuracy=0.300000
Epoch[201] Train-accuracy=0.400000
Epoch[201] Time cost=0.016
Epoch[201] Validation-accuracy=0.200000
Epoch[202] Train-accuracy=0.200000
Epoch[202] Time cost=0.016
Epoch[202] Validation-accuracy=0.100000
Epoch[203] Train-accuracy=0.700000
Epoch[203] Time cost=0.016
Epoch[203] Validation-accuracy=0.300000
Epoch[204] Train-accuracy=1.000000
Epoch[204] Time cost=0.017
Saved checkpoint to "model/instanceTestCifar.CifarNetwork/model-0205.params"
Epoch[204] Validation-accuracy=0.200000
Epoch[205] Train-accuracy=0.300000
Epoch[205] Time cost=0.018
Epoch[205] Validation-accuracy=0.300000
Epoch[206] Train-accuracy=0.900000
Epoch[206] Time cost=0.017
Epoch[206] Validation-accuracy=0.300000
Epoch[207] Train-accuracy=0.900000
Epoch[207] Time cost=0.017
Epoch[207] Validation-accuracy=0.300000
Epoch[208] Train-accuracy=0.800000
Epoch[208] Time cost=0.016
Epoch[208] Validation-accuracy=0.200000
Epoch[209] Train-accuracy=0.800000
Epoch[209] Time cost=0.024
Saved checkpoint to "model/instanceTestCifar.CifarNetwork/model-0210.params"
Epoch[209] Validation-accuracy=0.300000
Saved checkpoint to "model/instanceTestCifar.CifarNetwork/model-0210.params"
Saved checkpoint to "model/instanceTestCifar.CifarNetwork/model_newest-0000.params"
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