Commit 53330fa7 authored by Nicola Gatto's avatar Nicola Gatto
Browse files

Get critic class name from file name

parent 537212db
Pipeline #162445 failed with stages
......@@ -133,7 +133,6 @@ public class CNNTrain2Gluon extends CNNTrainGenerator {
"actor-critic algorithm");
}
NNArchitectureSymbol genericArchitectureSymbol = configuration.getCriticNetwork().get();
final String criticComponentName = genericArchitectureSymbol.getName().replace('.', '_');
ArchitectureSymbol architectureSymbol
= ((ArchitectureAdapter)genericArchitectureSymbol).getArchitectureSymbol();
......@@ -144,11 +143,16 @@ public class CNNTrain2Gluon extends CNNTrainGenerator {
= gluonGenerator.generateStringsAllowMultipleIO(architectureSymbol, true);
final String creatorName = architectureFileContentMap.keySet().iterator().next();
final String criticInstanceName = creatorName.substring(
creatorName.indexOf('_') + 1, creatorName.lastIndexOf(".py"));
fileContentMap.putAll(architectureFileContentMap.entrySet().stream().collect(Collectors.toMap(
k -> REINFORCEMENT_LEARNING_FRAMEWORK_MODULE + "/" + k.getKey(),
Map.Entry::getValue))
);
ftlContext.put("criticInstanceName", criticComponentName);
ftlContext.put("criticInstanceName", criticInstanceName);
}
ftlContext.put("trainerName", trainerName);
......
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