Commit c2be8008 authored by Christian Fuß's avatar Christian Fuß

added saveAttentionImage variable

parent 58e8130c
Pipeline #202119 passed with stages
in 19 minutes and 7 seconds
......@@ -139,6 +139,9 @@ grammar CNNTrain extends de.monticore.lang.monticar.Common2, de.monticore.Number
ClipWeightsEntry implements RmsPropEntry = name:"clip_weights" ":" value:NumberValue;
RhoEntry implements AdaDeltaEntry,RmsPropEntry,HuberEntry = name:"rho" ":" value:NumberValue;
// Visual attention Extension
SaveAttentionImage implements ConfigEntry = name:"save_attention_image" ":" value:BooleanValue;
// Reinforcement Extensions
interface MultiParamValue extends ConfigValue;
......
......@@ -47,7 +47,8 @@ class ParameterAlgorithmMapping {
ASTFromLogitsEntry.class,
ASTMarginEntry.class,
ASTLabelFormatEntry.class,
ASTRhoEntry.class
ASTRhoEntry.class,
ASTSaveAttentionImage.class
);
private static final List<Class> GENERAL_REINFORCEMENT_PARAMETERS = Lists.newArrayList(
......
......@@ -322,6 +322,14 @@ public class CNNTrainSymbolTableCreator extends CNNTrainSymbolTableCreatorTOP {
.map(n -> n.getNumber().get().intValue())
.collect(Collectors.toList());
}
@Override
public void endVisit(ASTSaveAttentionImage node) {
EntrySymbol entry = new EntrySymbol(node.getName());
entry.setValue(getValueSymbolForBoolean(node.getValue()));
addToScopeAndLinkWithNode(entry, node);
configuration.getEntryMap().put(node.getName(), entry);
}
@Override
public void visit(ASTLearningMethodEntry node) {
......
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