Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
C
CNNTrainLang
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
monticore
EmbeddedMontiArc
languages
CNNTrainLang
Commits
98b470bc
Commit
98b470bc
authored
Mar 06, 2020
by
Julian Treiber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added metric AccuracyWithIgnoreLabel
parent
e111d230
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
0 deletions
+41
-0
src/main/grammars/de/monticore/lang/monticar/CNNTrain.mc4
src/main/grammars/de/monticore/lang/monticar/CNNTrain.mc4
+5
-0
src/main/java/de/monticore/lang/monticar/cnntrain/_cocos/ParameterAlgorithmMapping.java
...g/monticar/cnntrain/_cocos/ParameterAlgorithmMapping.java
+2
-0
src/test/java/de/monticore/lang/monticar/cnntrain/SymtabTest.java
.../java/de/monticore/lang/monticar/cnntrain/SymtabTest.java
+1
-0
src/test/resources/valid_tests/AccuracyIgnoreLabel.cnnt
src/test/resources/valid_tests/AccuracyIgnoreLabel.cnnt
+33
-0
No files found.
src/main/grammars/de/monticore/lang/monticar/CNNTrain.mc4
View file @
98b470bc
...
@@ -47,6 +47,7 @@ grammar CNNTrain extends de.monticore.lang.monticar.Common2, de.monticore.Number
...
@@ -47,6 +47,7 @@ grammar CNNTrain extends de.monticore.lang.monticar.Common2, de.monticore.Number
interface
EvalMetricValue
extends
MultiParamValue
;
interface
EvalMetricValue
extends
MultiParamValue
;
AccuracyEvalMetric
implements
EvalMetricValue
=
name
:
"accuracy"
;
AccuracyEvalMetric
implements
EvalMetricValue
=
name
:
"accuracy"
;
BleuMetric
implements
EvalMetricValue
=
name
:
"bleu"
(
"{"
params
:
BleuEntry
*
"}"
)?;
BleuMetric
implements
EvalMetricValue
=
name
:
"bleu"
(
"{"
params
:
BleuEntry
*
"}"
)?;
AccIgnoreLabelMetric
implements
EvalMetricValue
=
name
:
"accuracy_ignore_label"
(
"{"
params
:
AccIgnoreLabelEntry
*
"}"
)?;
CrossEntropyEvalMetric
implements
EvalMetricValue
=
name
:
"cross_entropy"
;
CrossEntropyEvalMetric
implements
EvalMetricValue
=
name
:
"cross_entropy"
;
F1EvalMetric
implements
EvalMetricValue
=
name
:
"f1"
;
F1EvalMetric
implements
EvalMetricValue
=
name
:
"f1"
;
MAEEvalMetric
implements
EvalMetricValue
=
name
:
"mae"
;
MAEEvalMetric
implements
EvalMetricValue
=
name
:
"mae"
;
...
@@ -58,6 +59,10 @@ grammar CNNTrain extends de.monticore.lang.monticar.Common2, de.monticore.Number
...
@@ -58,6 +59,10 @@ grammar CNNTrain extends de.monticore.lang.monticar.Common2, de.monticore.Number
interface
BleuEntry
extends
Entry
;
interface
BleuEntry
extends
Entry
;
ExcludeBleuEntry
implements
BleuEntry
=
name
:
"exclude"
":"
value
:
IntegerListValue
;
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
;
EvalTrainEntry
implements
ConfigEntry
=
name
:
"eval_train"
":"
value
:
BooleanValue
;
LRPolicyValue
implements
ConfigValue
=(
fixed
:
"fixed"
LRPolicyValue
implements
ConfigValue
=(
fixed
:
"fixed"
...
...
src/main/java/de/monticore/lang/monticar/cnntrain/_cocos/ParameterAlgorithmMapping.java
View file @
98b470bc
...
@@ -43,6 +43,8 @@ class ParameterAlgorithmMapping {
...
@@ -43,6 +43,8 @@ class ParameterAlgorithmMapping {
ASTEvalMetricEntry
.
class
,
ASTEvalMetricEntry
.
class
,
ASTEvalTrainEntry
.
class
,
ASTEvalTrainEntry
.
class
,
ASTExcludeBleuEntry
.
class
,
ASTExcludeBleuEntry
.
class
,
ASTAxisAccIgnoreLabelEntry
.
class
,
ASTIgnoreLabelAccIgnoreLabelEntry
.
class
,
ASTNormalizeEntry
.
class
,
ASTNormalizeEntry
.
class
,
ASTNumEpochEntry
.
class
,
ASTNumEpochEntry
.
class
,
ASTLossEntry
.
class
,
ASTLossEntry
.
class
,
...
...
src/test/java/de/monticore/lang/monticar/cnntrain/SymtabTest.java
View file @
98b470bc
...
@@ -31,6 +31,7 @@ public class SymtabTest extends AbstractSymtabTest {
...
@@ -31,6 +31,7 @@ public class SymtabTest extends AbstractSymtabTest {
CNNTrainCompilationUnitSymbol
a
=
symTab
.<
CNNTrainCompilationUnitSymbol
>
resolve
(
CNNTrainCompilationUnitSymbol
a
=
symTab
.<
CNNTrainCompilationUnitSymbol
>
resolve
(
"SimpleConfig2"
,
"SimpleConfig2"
,
CNNTrainCompilationUnitSymbol
.
KIND
).
orElse
(
null
);
CNNTrainCompilationUnitSymbol
.
KIND
).
orElse
(
null
);
assertNotNull
(
a
);
assertNotNull
(
a
);
}
}
...
...
src/test/resources/valid_tests/AccuracyIgnoreLabel.cnnt
0 → 100644
View file @
98b470bc
/* (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
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment