Commit 98b470bc authored by Julian Treiber's avatar Julian Treiber

added metric AccuracyWithIgnoreLabel

parent e111d230
......@@ -47,6 +47,7 @@ grammar CNNTrain extends de.monticore.lang.monticar.Common2, de.monticore.Number
interface EvalMetricValue extends MultiParamValue;
AccuracyEvalMetric implements EvalMetricValue = name:"accuracy";
BleuMetric implements EvalMetricValue = name:"bleu" ("{" params:BleuEntry* "}")?;
AccIgnoreLabelMetric implements EvalMetricValue = name:"accuracy_ignore_label" ("{" params:AccIgnoreLabelEntry* "}")?;
CrossEntropyEvalMetric implements EvalMetricValue = name:"cross_entropy";
F1EvalMetric implements EvalMetricValue = name:"f1";
MAEEvalMetric implements EvalMetricValue = name:"mae";
......@@ -58,6 +59,10 @@ grammar CNNTrain extends de.monticore.lang.monticar.Common2, de.monticore.Number
interface BleuEntry extends Entry;
ExcludeBleuEntry implements BleuEntry = name:"exclude" ":" value:IntegerListValue;
interface AccIgnoreLabelEntry extends Entry;
AxisAccIgnoreLabelEntry implements AccIgnoreLabelEntry = name:"axis" ":" value:IntegerValue;
IgnoreLabelAccIgnoreLabelEntry implements AccIgnoreLabelEntry = name:"ignore_label" ":" value:IntegerValue;
EvalTrainEntry implements ConfigEntry = name:"eval_train" ":" value:BooleanValue;
LRPolicyValue implements ConfigValue =(fixed:"fixed"
......
......@@ -43,6 +43,8 @@ class ParameterAlgorithmMapping {
ASTEvalMetricEntry.class,
ASTEvalTrainEntry.class,
ASTExcludeBleuEntry.class,
ASTAxisAccIgnoreLabelEntry.class,
ASTIgnoreLabelAccIgnoreLabelEntry.class,
ASTNormalizeEntry.class,
ASTNumEpochEntry.class,
ASTLossEntry.class,
......
......@@ -31,6 +31,7 @@ public class SymtabTest extends AbstractSymtabTest {
CNNTrainCompilationUnitSymbol a = symTab.<CNNTrainCompilationUnitSymbol>resolve(
"SimpleConfig2",
CNNTrainCompilationUnitSymbol.KIND).orElse(null);
assertNotNull(a);
}
......
/* (c) https://github.com/MontiCore/monticore */
configuration FullConfig{
num_epoch : 5
batch_size : 100
load_pretrained : true
eval_metric : accuracy_ignore_label{
axis : 1
ignore_label : 255
}
loss: dice_loss{
sparse_label: true
from_logits: true
loss_axis : -1
batch_axis : 0
}
context : gpu
normalize : true
optimizer : rmsprop{
learning_rate : 0.001
learning_rate_minimum : 0.00001
weight_decay : 0.01
learning_rate_decay : 0.9
learning_rate_policy : step
step_size : 1000
rescale_grad : 1.1
clip_gradient : 10
gamma1 : 0.9
gamma2 : 0.9
epsilon : 0.000001
centered : true
clip_weights : 10
}
}
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