Aufgrund einer Störung des s3 Storage, könnten in nächster Zeit folgende GitLab Funktionen nicht zur Verfügung stehen: LFS, Container Registry, Job Artifacs, Uploads (Wiki, Bilder, Projekt-Exporte). Wir bitten um Verständnis. Es wird mit Hochdruck an der Behebung des Problems gearbeitet. Weitere Informationen zur Störung des Object Storage finden Sie hier: https://maintenance.itc.rwth-aachen.de/ticket/status/messages/59-object-storage-pilot

Commit e1ae811a authored by nilsfreyer's avatar nilsfreyer
Browse files

added getBackendString method for Caffe2 - Hashing

parent 0ea9d834
Pipeline #102756 failed with stages
in 2 minutes and 2 seconds
...@@ -47,4 +47,13 @@ public enum Backend { ...@@ -47,4 +47,13 @@ public enum Backend {
return Optional.empty(); return Optional.empty();
} }
} }
public static String getBackendString(Backend backend){
switch (backend){
case CAFFE2:
return "CAFFE2";
default:
return "MXNET";
}
}
} }
...@@ -63,11 +63,14 @@ public class EMADLGenerator { ...@@ -63,11 +63,14 @@ public class EMADLGenerator {
private GeneratorEMAMOpt2CPP emamGen; private GeneratorEMAMOpt2CPP emamGen;
private CNNArchGenerator cnnArchGenerator; private CNNArchGenerator cnnArchGenerator;
private CNNTrainGenerator cnnTrainGenerator; private CNNTrainGenerator cnnTrainGenerator;
private Backend backend;
private String modelsPath; private String modelsPath;
public EMADLGenerator(Backend backend) { public EMADLGenerator(Backend backend) {
this.backend = backend;
emamGen = new GeneratorEMAMOpt2CPP(); emamGen = new GeneratorEMAMOpt2CPP();
emamGen.useArmadilloBackend(); emamGen.useArmadilloBackend();
emamGen.setGenerationTargetPath("./target/generated-sources-emadl/"); emamGen.setGenerationTargetPath("./target/generated-sources-emadl/");
...@@ -220,9 +223,17 @@ public class EMADLGenerator { ...@@ -220,9 +223,17 @@ public class EMADLGenerator {
// This is not the real path to the training data! Adapt accordingly once sub-task 4 is solved // This is not the real path to the training data! Adapt accordingly once sub-task 4 is solved
String componentConfigFilename = componentInstance.getComponentType().getReferencedSymbol().getFullName().replaceAll("\\.", "/"); String componentConfigFilename = componentInstance.getComponentType().getReferencedSymbol().getFullName().replaceAll("\\.", "/");
String trainingDataHash = getChecksumForFile(architecture.get().getDataPath() + "/train.h5");
String testDataHash = getChecksumForFile(architecture.get().getDataPath() + "/test.h5");
String b = backend.getBackendString(backend);
String trainingDataHash = "";
String testDataHash = "";
if(b.equals("CAFFE2")){
trainingDataHash = getChecksumForFile(architecture.get().getDataPath() + "/train_lmdb/data.mdb");
testDataHash = getChecksumForFile(architecture.get().getDataPath() + "/test_lmdb/data.mdb");
}else{
trainingDataHash = getChecksumForFile(architecture.get().getDataPath() + "/train.h5");
testDataHash = getChecksumForFile(architecture.get().getDataPath() + "/test.h5");
}
String trainingHash = emadlHash + "#" + cnntHash + "#" + trainingDataHash + "#" + testDataHash; String trainingHash = emadlHash + "#" + cnntHash + "#" + trainingDataHash + "#" + testDataHash;
boolean alreadyTrained = newHashes.contains(trainingHash) || isAlreadyTrained(trainingHash, componentInstance); boolean alreadyTrained = newHashes.contains(trainingHash) || isAlreadyTrained(trainingHash, componentInstance);
......
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