Aufgrund einer Wartung wird GitLab am 25.01 zwischen 8:00 und 9:00 Uhr kurzzeitig nicht zur Verfügung stehen. / Due to maintenance, GitLab will be temporarily unavailable on 25.01 between 8:00 and 9:00 am.

CNNTrain.mc4 20.5 KB
Newer Older
Bernhard Rumpe's avatar
BR-sy    
Bernhard Rumpe committed
1
/* (c) https://github.com/MontiCore/monticore */
Thomas Michael Timmermanns's avatar
Thomas Michael Timmermanns committed
2
package de.monticore.lang.monticar;
Thomas Michael Timmermanns's avatar
Thomas Michael Timmermanns committed
3

4
grammar CNNTrain extends de.monticore.lang.monticar.Common2, de.monticore.NumberUnit{
5
6
7
    symbol scope CNNTrainCompilationUnit =
                                ("package" package:(Name& || ".")+ ";")?  // optional package declaration
                                "configuration"
8
                                 name:Name&
9
10
11
                                 Configuration;

    Configuration =  "{"entries:ConfigEntry* "}";
12

Thomas Michael Timmermanns's avatar
Thomas Michael Timmermanns committed
13
14
15
16
17
    interface Entry;
    ast Entry = method String getName(){}
                method ASTConfigValue getValue(){};
    interface ConfigValue;
    interface ConfigEntry extends Entry;
18
19
    interface VariableReference;
    ast VariableReference = method String getName(){};
20

Nicola Gatto's avatar
Nicola Gatto committed
21
22
23
24
25
26
27
28
    // General Values
    DataVariable implements VariableReference = Name&;
    IntegerValue implements ConfigValue = NumberWithUnit;
    NumberValue implements ConfigValue = NumberWithUnit;
    StringValue implements ConfigValue = StringLiteral;
    BooleanValue implements ConfigValue = (TRUE:"true" | FALSE:"false");
    ComponentNameValue implements ConfigValue = Name ("."Name)*;
    DoubleVectorValue implements ConfigValue = "(" number:NumberWithUnit ("," number:NumberWithUnit)* ")";
29
    IntegerListValue implements ConfigValue = "[" number:NumberWithUnit ("," number:NumberWithUnit)* "]";
Nicola Gatto's avatar
Nicola Gatto committed
30

Thomas Michael Timmermanns's avatar
Thomas Michael Timmermanns committed
31
32
    NumEpochEntry implements ConfigEntry = name:"num_epoch" ":" value:IntegerValue;
    BatchSizeEntry implements ConfigEntry = name:"batch_size" ":" value:IntegerValue;
33
    LoadCheckpointEntry implements ConfigEntry = name:"load_checkpoint" ":" value:BooleanValue;
34
    CheckpointPeriodEntry implements ConfigEntry = name:"checkpoint_period" ":" value:IntegerValue;
35
    LoadPretrainedEntry implements ConfigEntry = name:"load_pretrained" ":" value:BooleanValue;
36
    LogPeriodEntry implements ConfigEntry = name:"log_period" ":" value:IntegerValue;
37
    NormalizeEntry implements ConfigEntry = name:"normalize" ":" value:BooleanValue;
38
39
40

    ShuffleDataEntry implements ConfigEntry = name:"shuffle_data" ":" value:BooleanValue;
    ClipGlobalGradNormEntry implements ConfigEntry = name:"clip_global_grad_norm" ":" value:NumberValue;
41
42
    
    InitializerEntry implements ConfigEntry = (name:"initializer" | name:"actor_initializer") ":" value:InitializerValue;
43

Nicola Gatto's avatar
Nicola Gatto committed
44
    OptimizerEntry implements ConfigEntry = (name:"optimizer" | name:"actor_optimizer") ":" value:OptimizerValue;
45
    TrainContextEntry implements ConfigEntry = name:"context" ":" value:TrainContextValue;
46
    LossEntry implements ConfigEntry = name:"loss" ":" value:LossValue;
47
    LossWeightsEntry implements ConfigEntry = name:"loss_weights" ":" value:DoubleVectorValue;
48
49
50
51
52
53

    EvalMetricEntry implements MultiParamConfigEntry = name:"eval_metric" ":" value:EvalMetricValue;

    interface EvalMetricValue extends MultiParamValue;
    AccuracyEvalMetric implements EvalMetricValue = name:"accuracy";
    BleuMetric implements EvalMetricValue = name:"bleu" ("{" params:BleuEntry* "}")?;
54
    AccIgnoreLabelMetric implements EvalMetricValue = name:"accuracy_ignore_label" ("{" params:AccIgnoreLabelEntry* "}")?;
55
56
57
58
59
60
61
62
63
64
    CrossEntropyEvalMetric implements EvalMetricValue = name:"cross_entropy";
    F1EvalMetric implements EvalMetricValue = name:"f1";
    MAEEvalMetric implements EvalMetricValue = name:"mae";
    MSEEvalMetric implements EvalMetricValue = name:"mse";
    PerplexityEvalMetric implements EvalMetricValue = name:"perplexity";
    RMSEEvalMetric implements EvalMetricValue = name:"rmse";
    TopKAccuracyEvalMetric implements EvalMetricValue = name:"top_k_accuracy";

    interface BleuEntry extends Entry;
    ExcludeBleuEntry implements BleuEntry = name:"exclude" ":" value:IntegerListValue;
65

66
67
    interface AccIgnoreLabelEntry extends Entry;
    AxisAccIgnoreLabelEntry implements AccIgnoreLabelEntry = name:"axis" ":" value:IntegerValue;
68
    IgnoreLabelAccIgnoreLabelEntry implements AccIgnoreLabelEntry = name:"metric_ignore_label" ":" value:IntegerValue;
69

70
71
    EvalTrainEntry implements ConfigEntry = name:"eval_train" ":" value:BooleanValue;

Thomas Michael Timmermanns's avatar
Thomas Michael Timmermanns committed
72
73
74
75
76
77
    LRPolicyValue implements ConfigValue =(fixed:"fixed"
                                         | step:"step"
                                         | exp:"exp"
                                         | inv:"inv"
                                         | poly:"poly"
                                         | sigmoid:"sigmoid");
78
                                         
79
    TrainContextValue implements ConfigValue = (cpu:"cpu" | gpu:"gpu");
80
81
82
    
    interface InitializerParamEntry extends Entry;
    
Nicola Gatto's avatar
Nicola Gatto committed
83
    interface OptimizerParamEntry extends Entry;
84

85
    interface LossValue extends MultiParamValue;
86
87
88
89
90

    L1Loss implements LossValue = name:"l1" ("{" params:Entry* "}")?;

    L2Loss implements LossValue = name:"l2" ("{" params:Entry* "}")?;

91
92
    EPELoss implements LossValue = name:"epe" ("{" params:Entry* "}")?;

Eyüp Harputlu's avatar
Eyüp Harputlu committed
93
94
    LogCoshLoss implements LossValue = name:"log_cosh" ("{" params:Entry* "}")?;

95
96
97
98
99
100
101
102
103
    interface HuberEntry extends Entry;
    HuberLoss implements LossValue = name:"huber" ("{" params:HuberEntry* "}")?;

    interface CrossEntropyEntry extends Entry;
    CrossEntropyLoss implements LossValue = name:"cross_entropy" ("{" params:CrossEntropyEntry* "}")?;

    interface SoftmaxCrossEntropyEntry extends Entry;
    SoftmaxCrossEntropyLoss implements LossValue = name:"softmax_cross_entropy" ("{" params:SoftmaxCrossEntropyEntry* "}")?;

104
105
106
    interface SoftmaxCrossEntropyIgnoreIndicesEntry extends Entry;
    SoftmaxCrossEntropyIgnoreIndicesLoss implements LossValue = name:"softmax_cross_entropy_ignore_indices" ("{" params:SoftmaxCrossEntropyIgnoreIndicesEntry* "}")?;

Julian Treiber's avatar
Julian Treiber committed
107
108
109
    interface DiceEntry extends Entry;
    DiceLoss implements LossValue = name:"dice_loss" ("{" params:DiceEntry* "}")?;

110
111
112
    interface SoftmaxCrossEntropyIgnoreLabelEntry extends Entry;
    SoftmaxCrossEntropyIgnoreLabelLoss implements LossValue = name:"softmax_cross_entropy_ignore_label" ("{" params:SoftmaxCrossEntropyIgnoreLabelEntry* "}")?;

113
114
115
116
117
118
119
120
121
122
123
124
125
126
    SigmoidBinaryCrossEntropyLoss implements LossValue = name:"sigmoid_binary_cross_entropy" ("{" params:Entry* "}")?;

    interface HingeEntry extends Entry;
    HingeLoss implements LossValue = name:"hinge" ("{" params:HingeEntry* "}")?;

    interface SquaredHingeEntry extends Entry;
    SquaredHingeLoss implements LossValue = name:"squared_hinge" ("{" params:SquaredHingeEntry* "}")?;

    interface LogisticEntry extends Entry;
    LogisticLoss implements LossValue = name:"logistic" ("{" params:LogisticEntry* "}")?;

    interface KullbackLeiblerEntry extends Entry;
    KullbackLeiblerLoss implements LossValue = name:"kullback_leibler" ("{" params:KullbackLeiblerEntry* "}")?;

127
128
129
130
    SparseLabelEntry implements CrossEntropyEntry, SoftmaxCrossEntropyEntry, SoftmaxCrossEntropyIgnoreIndicesEntry, DiceEntry, SoftmaxCrossEntropyIgnoreLabelEntry = name:"sparse_label" ":" value:BooleanValue;
    FromLogitsEntry implements SoftmaxCrossEntropyEntry, SoftmaxCrossEntropyIgnoreIndicesEntry, KullbackLeiblerEntry, DiceEntry, SoftmaxCrossEntropyIgnoreLabelEntry = name:"from_logits" ":" value:BooleanValue;
    LossAxisEntry implements CrossEntropyEntry, SoftmaxCrossEntropyEntry, SoftmaxCrossEntropyIgnoreIndicesEntry, DiceEntry,SoftmaxCrossEntropyIgnoreLabelEntry = name:"loss_axis" ":" value:IntegerValue;
    BatchAxisEntry implements CrossEntropyEntry, SoftmaxCrossEntropyEntry, SoftmaxCrossEntropyIgnoreIndicesEntry, DiceEntry, SoftmaxCrossEntropyIgnoreLabelEntry = name:"batch_axis" ":" value:IntegerValue;
131
    IgnoreIndicesEntry implements SoftmaxCrossEntropyIgnoreIndicesEntry = name:"ignore_indices" ":" value:IntegerValue;
132
    IgnoreLabelEntry implements SoftmaxCrossEntropyIgnoreLabelEntry = name:"loss_ignore_label" ":" value:IntegerValue;
133
134
    MarginEntry implements HingeEntry, SquaredHingeEntry = name:"margin" ":" value:NumberValue;
    LabelFormatEntry implements LogisticEntry = name:"label_format" ":" value:StringValue;
135
136
137
138
139
140
    
    interface InitializerValue extends ConfigValue;
    interface InitializerNormalEntry extends InitializerParamEntry;
    NormalInitializer implements InitializerValue = name:"normal" ("{" params:InitializerNormalEntry* "}")?;
    
    InitializerNormalSigma implements InitializerNormalEntry = name:"sigma" ":" value:NumberValue;
141

Thomas Michael Timmermanns's avatar
Thomas Michael Timmermanns committed
142
    interface OptimizerValue extends ConfigValue;
Nicola Gatto's avatar
Nicola Gatto committed
143
    interface SGDEntry extends OptimizerParamEntry;
Thomas Michael Timmermanns's avatar
Thomas Michael Timmermanns committed
144
145
    SGDOptimizer implements OptimizerValue = name:"sgd" ("{" params:SGDEntry* "}")?;

Nicola Gatto's avatar
Nicola Gatto committed
146
    interface AdamEntry extends OptimizerParamEntry;
Thomas Michael Timmermanns's avatar
Thomas Michael Timmermanns committed
147
148
    AdamOptimizer implements OptimizerValue = name:"adam" ("{" params:AdamEntry* "}")?;

149
150
    AdamWOptimizer implements OptimizerValue = name:"adamw" ("{" params:AdamEntry* "}")?;

Nicola Gatto's avatar
Nicola Gatto committed
151
    interface RmsPropEntry extends OptimizerParamEntry;
Thomas Michael Timmermanns's avatar
Thomas Michael Timmermanns committed
152
153
    RmsPropOptimizer implements OptimizerValue = name:"rmsprop" ("{" params:RmsPropEntry* "}")?;

Nicola Gatto's avatar
Nicola Gatto committed
154
    interface AdaGradEntry extends OptimizerParamEntry;
Thomas Michael Timmermanns's avatar
Thomas Michael Timmermanns committed
155
156
157
158
    AdaGradOptimizer implements OptimizerValue = name:"adagrad" ("{" params:AdaGradEntry* "}")?;

    NesterovOptimizer implements OptimizerValue = name:"nag" ("{" params:SGDEntry* "}")?;

Nicola Gatto's avatar
Nicola Gatto committed
159
    interface AdaDeltaEntry extends OptimizerParamEntry;
Thomas Michael Timmermanns's avatar
Thomas Michael Timmermanns committed
160
161
162
163
    AdaDeltaOptimizer implements OptimizerValue = name:"adadelta" ("{" params:AdaDeltaEntry* "}")?;

    interface GeneralOptimizerEntry extends SGDEntry,AdamEntry,RmsPropEntry,AdaGradEntry,AdaDeltaEntry;

164
    MinimumLearningRateEntry implements GeneralOptimizerEntry = name:"learning_rate_minimum" ":" value:NumberValue;
Thomas Michael Timmermanns's avatar
Thomas Michael Timmermanns committed
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
    LearningRateEntry implements GeneralOptimizerEntry = name:"learning_rate" ":" value:NumberValue;
    WeightDecayEntry implements GeneralOptimizerEntry = name:"weight_decay" ":" value:NumberValue;
    LRDecayEntry implements GeneralOptimizerEntry = name:"learning_rate_decay" ":" value:NumberValue;
    LRPolicyEntry implements GeneralOptimizerEntry = name:"learning_rate_policy" ":" value:LRPolicyValue;
    RescaleGradEntry implements GeneralOptimizerEntry = name:"rescale_grad" ":" value:NumberValue;
    ClipGradEntry implements GeneralOptimizerEntry = name:"clip_gradient" ":" value:NumberValue;
    StepSizeEntry implements GeneralOptimizerEntry = name:"step_size" ":" value:IntegerValue;


    MomentumEntry implements SGDEntry = name:"momentum" ":" value:NumberValue;
    Beta1Entry implements AdamEntry = name:"beta1" ":" value:NumberValue;
    Beta2Entry implements AdamEntry = name:"beta2" ":" value:NumberValue;
    EpsilonEntry implements AdamEntry,AdaGradEntry,RmsPropEntry,AdaDeltaEntry = name:"epsilon" ":" value:NumberValue;
    Gamma1Entry implements RmsPropEntry = name:"gamma1" ":" value:NumberValue;
    Gamma2Entry implements RmsPropEntry = name:"gamma2" ":" value:NumberValue;
    CenteredEntry implements RmsPropEntry = name:"centered" ":" value:BooleanValue;
    ClipWeightsEntry implements RmsPropEntry = name:"clip_weights" ":" value:NumberValue;
182
    RhoEntry implements AdaDeltaEntry,RmsPropEntry,HuberEntry = name:"rho" ":" value:NumberValue;
Thomas Michael Timmermanns's avatar
Thomas Michael Timmermanns committed
183

184
185
    UseTeacherForcing implements ConfigEntry = name:"use_teacher_forcing" ":" value:BooleanValue;

186
187
188
    // Visual attention Extension
    SaveAttentionImage implements ConfigEntry = name:"save_attention_image" ":" value:BooleanValue;

Nicola Gatto's avatar
Nicola Gatto committed
189
190
191
192
    // Reinforcement Extensions
    interface MultiParamValue extends ConfigValue;

    LearningMethodEntry implements ConfigEntry = name:"learning_method" ":" value:LearningMethodValue;
Nicola Gatto's avatar
Nicola Gatto committed
193
    RLAlgorithmEntry implements ConfigEntry = name:"rl_algorithm" ":" value:RLAlgorithmValue;
Nicola Gatto's avatar
Nicola Gatto committed
194
195
196
197
198
199
200
201
    NumEpisodesEntry implements ConfigEntry = name:"num_episodes" ":" value:IntegerValue;
    DiscountFactorEntry implements ConfigEntry = name:"discount_factor" ":" value:NumberValue;
    NumMaxStepsEntry implements ConfigEntry = name:"num_max_steps" ":" value:IntegerValue;
    TargetScoreEntry implements ConfigEntry = name:"target_score" ":" value:NumberValue;
    TrainingIntervalEntry implements ConfigEntry = name:"training_interval" ":" value:IntegerValue;
    SnapshotIntervalEntry implements ConfigEntry = name:"snapshot_interval" ":" value:IntegerValue;
    AgentNameEntry implements ConfigEntry = name:"agent_name" ":" value:StringValue;
    RewardFunctionEntry implements ConfigEntry = name:"reward_function" ":" value:ComponentNameValue;
Nicola Gatto's avatar
Nicola Gatto committed
202
203
    StartTrainingAtEntry implements ConfigEntry = name:"start_training_at" ":" value:IntegerValue;
    EvaluationSamplesEntry implements ConfigEntry = name:"evaluation_samples" ":" value:IntegerValue;
Nicola Gatto's avatar
Nicola Gatto committed
204

205
    LearningMethodValue implements ConfigValue = (supervisedLearning:"supervised" | reinforcement:"reinforcement" | gan:"gan");
Nicola Gatto's avatar
Nicola Gatto committed
206

207
    RLAlgorithmValue implements ConfigValue = (dqn:"dqn-algorithm" | ddpg:"ddpg-algorithm" | tdThree:"td3-algorithm");
Nicola Gatto's avatar
Nicola Gatto committed
208

Nicola Gatto's avatar
Nicola Gatto committed
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
    interface MultiParamConfigEntry extends ConfigEntry;

    // Replay Memory
    ReplayMemoryEntry implements MultiParamConfigEntry = name:"replay_memory" ":" value:ReplayMemoryValue;
    interface ReplayMemoryValue extends MultiParamValue;

    interface ReplayMemoryBufferEntry extends Entry;
    ReplayMemoryBufferValue implements ReplayMemoryValue = name:"buffer" ("{" params:ReplayMemoryBufferEntry* "}")?;

    ReplayMemoryOnlineValue implements ReplayMemoryValue = name:"online";

    interface ReplayMemoryCombinedEntry extends Entry;
    ReplayMemoryCombinedValue implements ReplayMemoryValue = name:"combined" ("{" params:ReplayMemoryCombinedEntry* "}")?;

    interface GeneralReplayMemoryEntry extends ReplayMemoryBufferEntry, ReplayMemoryCombinedEntry;

    MemorySizeEntry implements GeneralReplayMemoryEntry = name:"memory_size" ":" value:IntegerValue;
    SampleSizeEntry implements GeneralReplayMemoryEntry = name:"sample_size" ":" value:IntegerValue;

Nicola Gatto's avatar
Nicola Gatto committed
228
229
230
231
232
233
234
235
236
    // Strategy
    StrategyEntry implements MultiParamConfigEntry = name:"strategy" ":" value:StrategyValue;
    interface StrategyValue extends MultiParamValue;

    interface StrategyEpsGreedyEntry extends Entry;
    StrategyEpsGreedyValue implements StrategyValue = name:"epsgreedy" ("{" params:StrategyEpsGreedyEntry* "}")?;

    interface StrategyOrnsteinUhlenbeckEntry extends Entry;
    StrategyOrnsteinUhlenbeckValue implements StrategyValue = name:"ornstein_uhlenbeck" ("{" params:StrategyOrnsteinUhlenbeckEntry* "}")?;
Nicola Gatto's avatar
Nicola Gatto committed
237

238
239
240
    interface StrategyGaussianEntry extends Entry;
    StrategyGaussianValue implements StrategyValue = name:"gaussian" ("{" params:StrategyGaussianEntry* "}")?;

Nicola Gatto's avatar
Nicola Gatto committed
241
242
    StrategyGaussianNoiseVarianceEntry implements StrategyGaussianEntry = name: "noise_variance" ":" value:NumberValue;

Nicola Gatto's avatar
Nicola Gatto committed
243
244
245
    StrategyOUMu implements StrategyOrnsteinUhlenbeckEntry = name: "mu" ":" value:DoubleVectorValue;
    StrategyOUTheta implements StrategyOrnsteinUhlenbeckEntry = name: "theta" ":" value:DoubleVectorValue;
    StrategyOUSigma implements StrategyOrnsteinUhlenbeckEntry = name: "sigma" ":" value:DoubleVectorValue;
Nicola Gatto's avatar
Nicola Gatto committed
246

247
    interface GeneralStrategyEntry extends StrategyEpsGreedyEntry, StrategyOrnsteinUhlenbeckEntry, StrategyGaussianEntry;
Nicola Gatto's avatar
Nicola Gatto committed
248
249
250
251
252

    GreedyEpsilonEntry implements GeneralStrategyEntry = name:"epsilon" ":" value:NumberValue;
    MinEpsilonEntry implements GeneralStrategyEntry = name:"min_epsilon" ":" value:NumberValue;
    EpsilonDecayStartEntry implements GeneralStrategyEntry = name:"epsilon_decay_start" ":" value:IntegerValue;
    EpsilonDecayMethodEntry implements GeneralStrategyEntry = name:"epsilon_decay_method" ":" value:EpsilonDecayMethodValue;
Nicola Gatto's avatar
Nicola Gatto committed
253
    EpsilonDecayMethodValue implements ConfigValue = (linear:"linear" | no:"no");
254
    EpsilonDecayPerStepEntry implements GeneralStrategyEntry = name:"epsilon_decay_per_step" ":" value:BooleanValue;
Nicola Gatto's avatar
Nicola Gatto committed
255
    EpsilonDecayEntry implements GeneralStrategyEntry = name:"epsilon_decay" ":" value:NumberValue;
Nicola Gatto's avatar
Nicola Gatto committed
256
257
258
259
260
261
262
263
264
265

    // Environment
    EnvironmentEntry implements MultiParamConfigEntry = name:"environment" ":" value:EnvironmentValue;
    interface EnvironmentValue extends MultiParamValue;

    interface GymEnvironmentEntry extends Entry;
    GymEnvironmentValue implements EnvironmentValue = name:"gym" ("{" params:GymEnvironmentEntry* "}");
    GymEnvironmentNameEntry implements GymEnvironmentEntry = name:"name" ":" value:StringValue;

    interface RosEnvironmentEntry extends Entry;
Nicola Gatto's avatar
Nicola Gatto committed
266
    RosEnvironmentValue implements EnvironmentValue = name:"ros_interface" ("{" params:RosEnvironmentEntry* "}")?;
Nicola Gatto's avatar
Nicola Gatto committed
267
268
269
270
    RosEnvironmentStateTopicEntry implements RosEnvironmentEntry = name:"state_topic" ":" value:StringValue;
    RosEnvironmentActionTopicEntry implements RosEnvironmentEntry = name:"action_topic" ":" value:StringValue;
    RosEnvironmentResetTopicEntry implements RosEnvironmentEntry = name:"reset_topic" ":" value:StringValue;
    RosEnvironmentTerminalStateTopicEntry implements RosEnvironmentEntry = name:"terminal_state_topic" ":" value:StringValue;
Nicola Gatto's avatar
Nicola Gatto committed
271
272
273
274
275
276
277
278
    RosEnvironmentRewardTopicEntry implements RosEnvironmentEntry = name:"reward_topic" ":" value:StringValue;

    // DQN exclusive parameters
    UseFixTargetNetworkEntry implements ConfigEntry = name:"use_fix_target_network" ":" value:BooleanValue;
    TargetNetworkUpdateIntervalEntry implements ConfigEntry = name:"target_network_update_interval" ":" value:IntegerValue;
    UseDoubleDQNEntry implements ConfigEntry = name:"use_double_dqn" ":" value:BooleanValue;


279
    // DDPG and TD3 exclusive parameters
Nicola Gatto's avatar
Nicola Gatto committed
280
281
    CriticNetworkEntry implements ConfigEntry = name:"critic" ":" value:ComponentNameValue;
    SoftTargetUpdateRateEntry implements ConfigEntry = name:"soft_target_update_rate" ":" value:NumberValue;
282
    CriticInitializerEntry implements ConfigEntry = name:"critic_initializer" ":" value:InitializerValue;
Nicola Gatto's avatar
Nicola Gatto committed
283
    CriticOptimizerEntry implements ConfigEntry = name:"critic_optimizer" ":" value:OptimizerValue;
284
285
286
287
288

    // TD3 exclusive parameters
    PolicyNoiseEntry implements ConfigEntry = name:"policy_noise" ":" value:NumberValue;
    NoiseClipEntry implements ConfigEntry = name:"noise_clip" ":" value:NumberValue;
    PolicyDelayEntry implements ConfigEntry = name:"policy_delay" ":" value:IntegerValue;
289
290

    // GANs Extensions
291

Julian Dierkes's avatar
Julian Dierkes committed
292
    KValueEntry implements ConfigEntry = name:"k_value" ":" value:IntegerValue;
293
294
295
    GeneratorTargetNameEntry implements ConfigEntry = name:"generator_target_name" ":" value:StringValue;
    GeneratorLossEntry implements ConfigEntry = name:"generator_loss" ":" value:GeneratorLossValue;
    GeneratorLossValue implements ConfigValue = (l1: "l1" | l2: "l2");
Julian Dierkes's avatar
Julian Dierkes committed
296
    NoiseInputEntry implements ConfigEntry = name:"noise_input" ":" value:StringValue;
297
298
299
300
    GeneratorLossWeightEntry implements ConfigEntry = name:"generator_loss_weight" ":" value:NumberValue;
    DiscriminatorLossWeightEntry implements ConfigEntry = name:"discriminator_loss_weight" ":" value:NumberValue;

    PrintImagesEntry implements ConfigEntry = name:"print_images" ":" value:BooleanValue;
Julian Dierkes's avatar
Julian Dierkes committed
301

302
303
304
305
    interface MultiParamValueMapConfigEntry extends ConfigEntry;
    interface MultiParamValueMapParamValue extends ConfigValue;
    interface MultiParamValueMapTupleValue extends ConfigValue;

306
    DiscriminatorNetworkEntry implements ConfigEntry = name:"discriminator_name" ":" value:ComponentNameValue;
Julian Dierkes's avatar
Julian Dierkes committed
307
    DiscriminatorOptimizerEntry implements ConfigEntry = name:"discriminator_optimizer" ":" value:OptimizerValue;
Julian Dierkes's avatar
Julian Dierkes committed
308
    QNetworkEntry implements ConfigEntry = name:"qnet_name" ":" value:ComponentNameValue;
309
    PreprocessingEntry implements ConfigEntry = name:"preprocessing_name" ":" value:ComponentNameValue;
Julian Dierkes's avatar
Julian Dierkes committed
310

311
312
313
314
    // Noise Distribution Creator
    NoiseDistributionEntry implements MultiParamConfigEntry = name:"noise_distribution" ":" value:NoiseDistributionValue;
    interface NoiseDistributionValue extends MultiParamValue;

315
316
317
    interface NoiseDistributionParamEntry extends Entry;
    interface NoiseDistributionGaussianEntry extends NoiseDistributionParamEntry;

318
319
320
321
    NoiseDistributionGaussianValue implements NoiseDistributionValue = name:"gaussian" ("{" params:NoiseDistributionGaussianEntry* "}")?;

    MeanValueEntry implements NoiseDistributionGaussianEntry = name:"mean_value" ":" value:IntegerValue;
    SpreadValueEntry implements NoiseDistributionGaussianEntry = name:"spread_value" ":" value:IntegerValue;
322

323
324
    NoiseDistributionUniformValue implements NoiseDistributionValue = name:"uniform" ("{"  "}")?;

325
326
327
    // Constraint Distributions
    ConstraintDistributionEntry implements MultiParamValueMapConfigEntry  = name:"constraint_distributions" ":" value:ConstraintDistributionValue;
    ConstraintDistributionValue implements MultiParamValueMapParamValue = ("{" params:ConstraintDistributionParam* "}")?;
328
329
330
331
332
333
    ConstraintDistributionParam implements MultiParamValueMapTupleValue = name:StringValue ":" multiParamValue:NoiseDistributionValue;

    // Constraint losses
    ConstraintLossEntry implements MultiParamValueMapConfigEntry  = name:"constraint_losses" ":" value:ConstraintLossValue;
    ConstraintLossValue implements MultiParamValueMapParamValue = ("{" params:ConstraintLossParam* "}")?;
    ConstraintLossParam implements MultiParamValueMapTupleValue = name:StringValue ":" multiParamValue:LossValue;
Thomas Michael Timmermanns's avatar
Thomas Michael Timmermanns committed
334
}