Commit 8a0652b8 authored by Nicola Gatto's avatar Nicola Gatto
Browse files

Add parameter noise variance

parent 11efa54b
Pipeline #161467 failed with stages
......@@ -179,6 +179,8 @@ grammar CNNTrain extends de.monticore.lang.monticar.Common2, de.monticore.Number
interface StrategyGaussianEntry extends Entry;
StrategyGaussianValue implements StrategyValue = name:"gaussian" ("{" params:StrategyGaussianEntry* "}")?;
StrategyGaussianNoiseVarianceEntry implements StrategyGaussianEntry = name: "noise_variance" ":" value:NumberValue;
StrategyOUMu implements StrategyOrnsteinUhlenbeckEntry = name: "mu" ":" value:DoubleVectorValue;
StrategyOUTheta implements StrategyOrnsteinUhlenbeckEntry = name: "theta" ":" value:DoubleVectorValue;
StrategyOUSigma implements StrategyOrnsteinUhlenbeckEntry = name: "sigma" ":" value:DoubleVectorValue;
......
......@@ -105,7 +105,8 @@ class ParameterAlgorithmMapping {
ASTCriticOptimizerEntry.class,
ASTStrategyOUMu.class,
ASTStrategyOUTheta.class,
ASTStrategyOUSigma.class
ASTStrategyOUSigma.class,
ASTStrategyGaussianNoiseVarianceEntry.class
);
private static final List<Class> EXCLUSIVE_TD3_PARAMETERS = Lists.newArrayList(
......@@ -117,7 +118,8 @@ class ParameterAlgorithmMapping {
ASTStrategyOUSigma.class,
ASTPolicyNoiseEntry.class,
ASTNoiseClipEntry.class,
ASTPolicyDelayEntry.class
ASTPolicyDelayEntry.class,
ASTStrategyGaussianNoiseVarianceEntry.class
);
ParameterAlgorithmMapping() {
......
......@@ -532,6 +532,14 @@ public class CNNTrainSymbolTableCreator extends CNNTrainSymbolTableCreatorTOP {
configuration.getEntryMap().put(node.getName(), entry);
}
@Override
public void visit(ASTStrategyGaussianNoiseVarianceEntry node) {
EntrySymbol entry = new EntrySymbol(node.getName());
entry.setValue(getValueSymbolForDouble(node.getValue()));
addToScopeAndLinkWithNode(entry, node);
configuration.getEntryMap().put(node.getName(), entry);
}
@Override
public void visit(ASTPolicyDelayEntry node) {
EntrySymbol entry = new EntrySymbol(node.getName());
......
......@@ -23,6 +23,7 @@ configuration TD3Config {
strategy : gaussian {
epsilon: 1.0
min_epsilon: 0.001
noise_variance: 0.5
epsilon_decay_per_step: true
epsilon_decay_method: linear
epsilon_decay : 0.0001
......
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