Commit bbc114e1 authored by Julian Dierkes's avatar Julian Dierkes

introduced tests for intra GAN CoCos

parent 3da28b6f
Pipeline #264530 failed with stages
......@@ -281,7 +281,6 @@ grammar CNNTrain extends de.monticore.lang.monticar.Common2, de.monticore.Number
GeneratorLossWeightEntry implements ConfigEntry = name:"generator_loss_weight" ":" value:NumberValue;
DiscriminatorLossWeightEntry implements ConfigEntry = name:"discriminator_loss_weight" ":" value:NumberValue;
SpeedPeriodEntry implements ConfigEntry = name:"speed_period" ":" value:IntegerValue;
PrintImagesEntry implements ConfigEntry = name:"print_images" ":" value:BooleanValue;
interface MultiParamValueMapConfigEntry extends ConfigEntry;
......
......@@ -21,6 +21,12 @@ class ASTConfigurationUtils {
&& ((ASTLearningMethodEntry)e).getValue().isPresentReinforcement());
}
static boolean isGANLearning(final ASTConfiguration configuration) {
return configuration.getEntriesList().stream().anyMatch(e ->
(e instanceof ASTLearningMethodEntry)
&& ((ASTLearningMethodEntry)e).getValue().isPresentGan());
}
static boolean hasEnvironment(final ASTConfiguration configuration) {
return configuration.getEntriesList().stream().anyMatch(e -> e instanceof ASTEnvironmentEntry);
}
......@@ -108,4 +114,32 @@ class ASTConfigurationUtils {
}
return false;
}
static boolean hasGeneratorLoss(final ASTConfiguration node) {
return node.getEntriesList().stream().anyMatch(e -> e instanceof ASTGeneratorLossEntry);
}
static boolean hasGeneratorTargetName(final ASTConfiguration node) {
return node.getEntriesList().stream().anyMatch(e -> e instanceof ASTGeneratorTargetNameEntry);
}
static boolean hasNoiseName(final ASTConfiguration node) {
return node.getEntriesList().stream().anyMatch(e -> e instanceof ASTNoiseInputEntry);
}
static boolean hasNoiseDistribution(final ASTConfiguration node) {
return node.getEntriesList().stream().anyMatch(e -> e instanceof ASTNoiseDistributionEntry);
}
static boolean hasConstraintDistribution(final ASTConfiguration node) {
return node.getEntriesList().stream().anyMatch(e -> e instanceof ASTConstraintDistributionEntry);
}
static boolean hasConstraintLosses(final ASTConfiguration node) {
return node.getEntriesList().stream().anyMatch(e -> e instanceof ASTConstraintLossEntry);
}
static boolean hasQNetwork(final ASTConfiguration node) {
return node.getEntriesList().stream().anyMatch(e -> e instanceof ASTQNetworkEntry);
}
}
......@@ -27,7 +27,12 @@ public class CNNTrainCocos {
.addCoCo(new CheckRlAlgorithmParameter())
.addCoCo(new CheckDiscreteRLAlgorithmUsesDiscreteStrategy())
.addCoCo(new CheckContinuousRLAlgorithmUsesContinuousStrategy())
.addCoCo(new CheckRosEnvironmentHasOnlyOneRewardSpecification());
.addCoCo(new CheckRosEnvironmentHasOnlyOneRewardSpecification())
.addCoCo(new CheckConstraintDistributionQNetworkDependency())
.addCoCo(new CheckConstraintLossesQNetworkDependency())
.addCoCo(new CheckGeneratorLossTargetNameDependency())
.addCoCo(new CheckNoiseInputDistributionDependency())
.addCoCo(new CheckNoiseInputMissing());
}
public static void checkAll(CNNTrainCompilationUnitSymbol compilationUnit){
......@@ -54,8 +59,7 @@ public class CNNTrainCocos {
public static void checkGANCocos(final ConfigurationSymbol configurationSymbol) {
CNNTrainConfigurationSymbolChecker checker = new CNNTrainConfigurationSymbolChecker()
.addCoCo(new CheckGANNetworkPorts())
.addCoCo(new CheckGANConfigurationDependencies());
.addCoCo(new CheckGANNetworkPorts());
checker.checkAll(configurationSymbol);
}
}
\ No newline at end of file
/**
* (c) https://github.com/MontiCore/monticore
*
* The license generally applicable for this project
* can be found under https://github.com/MontiCore/monticore.
*/
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.cnntrain._cocos;
import de.monticore.lang.monticar.cnntrain._ast.ASTConfiguration;
import de.monticore.lang.monticar.cnntrain.helper.ErrorCodes;
import de.se_rwth.commons.logging.Log;
import static de.monticore.lang.monticar.cnntrain._cocos.ASTConfigurationUtils.*;
public class CheckConstraintDistributionQNetworkDependency implements CNNTrainASTConfigurationCoCo {
@Override
public void check(final ASTConfiguration node) {
if (isGANLearning(node) && hasConstraintDistribution(node)) {
if (!hasQNetwork(node)) {
Log.error("0" + ErrorCodes.REQUIRED_PARAMETER_MISSING +
" Constraint distributions are given but q-network is missing");
}
}
}
}
/**
* (c) https://github.com/MontiCore/monticore
*
* The license generally applicable for this project
* can be found under https://github.com/MontiCore/monticore.
*/
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.cnntrain._cocos;
import de.monticore.lang.monticar.cnntrain._ast.ASTConfiguration;
import de.monticore.lang.monticar.cnntrain.helper.ErrorCodes;
import de.se_rwth.commons.logging.Log;
import static de.monticore.lang.monticar.cnntrain._cocos.ASTConfigurationUtils.*;
public class CheckConstraintLossesQNetworkDependency implements CNNTrainASTConfigurationCoCo {
@Override
public void check(final ASTConfiguration node) {
if (isGANLearning(node) && hasConstraintLosses(node)) {
if (!hasQNetwork(node)) {
Log.error("0" + ErrorCodes.REQUIRED_PARAMETER_MISSING +
" Constraint losses are given but q-network is missing");
}
}
}
}
......@@ -32,4 +32,5 @@ public class CheckDiscreteRLAlgorithmUsesDiscreteStrategy implements CNNTrainAST
}
}
}
}
/**
* (c) https://github.com/MontiCore/monticore
*
* The license generally applicable for this project
* can be found under https://github.com/MontiCore/monticore.
*/
package de.monticore.lang.monticar.cnntrain._cocos;
import de.monticore.lang.monticar.cnntrain._ast.ASTEntry;
import de.monticore.lang.monticar.cnntrain._ast.ASTLearningMethodEntry;
import de.monticore.lang.monticar.cnntrain._symboltable.ConfigurationSymbol;
import de.monticore.lang.monticar.cnntrain._symboltable.LearningMethod;
import de.monticore.lang.monticar.cnntrain.helper.ConfigEntryNameConstants;
import de.monticore.lang.monticar.cnntrain.helper.ErrorCodes;
import de.se_rwth.commons.logging.Log;
import sun.security.krb5.internal.ccache.CredentialsCache;
public class CheckGANConfigurationDependencies implements CNNTrainConfigurationSymbolCoCo{
public CheckGANConfigurationDependencies() { }
@Override
public void check(ConfigurationSymbol configurationSymbol) {
if(configurationSymbol.getLearningMethod() == LearningMethod.GAN) {
if (configurationSymbol.getEntry(ConfigEntryNameConstants.GENERATOR_LOSS) != null)
if (configurationSymbol.getEntry(ConfigEntryNameConstants.GENERATOR_TARGET_NAME) == null)
Log.error("0" + ErrorCodes.REQUIRED_PARAMETER_MISSING +
" Generator loss specified but conditional input is missing");
if (configurationSymbol.getEntry(ConfigEntryNameConstants.GENERATOR_TARGET_NAME) != null)
if (configurationSymbol.getEntry(ConfigEntryNameConstants.GENERATOR_LOSS) == null)
Log.error("0" + ErrorCodes.REQUIRED_PARAMETER_MISSING +
" Conditional input specified but generator loss is missing");
if (configurationSymbol.getEntry(ConfigEntryNameConstants.LOSS) != null)
Log.error("0" + ErrorCodes.UNSUPPORTED_PARAMETER +
" Loss parameter not valid for GAN learning");
if (configurationSymbol.getEntry(ConfigEntryNameConstants.NOISE_INPUT) != null)
if (configurationSymbol.getEntry(ConfigEntryNameConstants.NOISE_DISTRIBUTION) == null)
Log.error("0" + ErrorCodes.REQUIRED_PARAMETER_MISSING +
" Noise input specified but noise distribution parameter is missing");
if (configurationSymbol.getEntry(ConfigEntryNameConstants.CONSTRAINT_DISTRIBUTION) != null)
if (configurationSymbol.getEntry(ConfigEntryNameConstants.QNETWORK_NAME) == null)
Log.error("0" + ErrorCodes.REQUIRED_PARAMETER_MISSING +
" Constraint distributions are given but q-network is missing");
if (configurationSymbol.getEntry(ConfigEntryNameConstants.CONSTRAINT_LOSS) != null)
if (configurationSymbol.getEntry(ConfigEntryNameConstants.QNETWORK_NAME) == null)
Log.error("0" + ErrorCodes.REQUIRED_PARAMETER_MISSING +
" Constraint losses are given but q-network is missing");
if (configurationSymbol.getEntry(ConfigEntryNameConstants.NOISE_INPUT) == null)
Log.warn(" No noise input specified. Are you sure this is correct?");
}
}
}
/**
* (c) https://github.com/MontiCore/monticore
*
* The license generally applicable for this project
* can be found under https://github.com/MontiCore/monticore.
*/
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.cnntrain._cocos;
import de.monticore.lang.monticar.cnntrain._ast.ASTConfiguration;
import de.monticore.lang.monticar.cnntrain.helper.ErrorCodes;
import de.se_rwth.commons.logging.Log;
import static de.monticore.lang.monticar.cnntrain._cocos.ASTConfigurationUtils.*;
public class CheckGeneratorLossTargetNameDependency implements CNNTrainASTConfigurationCoCo {
@Override
public void check(final ASTConfiguration node) {
if (isGANLearning(node) && hasGeneratorLoss(node)) {
if (!hasGeneratorTargetName(node)) {
Log.error("0" + ErrorCodes.REQUIRED_PARAMETER_MISSING +
" Generator loss specified but conditional input is missing");
}
}
else if (isGANLearning(node) && hasGeneratorTargetName(node)) {
if (!hasGeneratorLoss(node)) {
Log.error("0" + ErrorCodes.REQUIRED_PARAMETER_MISSING +
" Conditional input specified but generator loss is missing");
}
}
}
}
......@@ -7,7 +7,6 @@
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.cnntrain._cocos;
import com.google.common.collect.Lists;
import de.monticore.lang.monticar.cnntrain._ast.*;
import de.monticore.lang.monticar.cnntrain._symboltable.LearningMethod;
import de.monticore.lang.monticar.cnntrain.helper.ErrorCodes;
......@@ -53,14 +52,24 @@ public class CheckLearningParameterCombination implements CNNTrainASTEntryCoCo {
= parameterAlgorithmMapping.isSupervisedLearningParameter(node.getClass());
final boolean reinforcementLearningParameter
= parameterAlgorithmMapping.isReinforcementLearningParameter(node.getClass());
final boolean ganLearningParameter
= parameterAlgorithmMapping.isGANLearningParameter(node.getClass());
assert (supervisedLearningParameter || reinforcementLearningParameter) :
assert (supervisedLearningParameter || reinforcementLearningParameter || ganLearningParameter) :
"Parameter " + node.getName() + " is not checkable, because it is unknown to Condition";
if (supervisedLearningParameter && !reinforcementLearningParameter) {
if (supervisedLearningParameter && !reinforcementLearningParameter && !ganLearningParameter) {
setLearningMethodOrLogErrorIfActualLearningMethodIsNotSupervised(node);
} else if(!supervisedLearningParameter && reinforcementLearningParameter) {
} else if(!supervisedLearningParameter && reinforcementLearningParameter && !ganLearningParameter) {
setLearningMethodOrLogErrorIfActualLearningMethodIsNotReinforcement(node);
} else if(!supervisedLearningParameter && !reinforcementLearningParameter && ganLearningParameter) {
setLearningMethodOrLogErrorIfActualLearningMethodIsNotGAN(node);
} else if(learningMethodKnown && learningMethod.equals(LearningMethod.REINFORCEMENT)
&& supervisedLearningParameter && !reinforcementLearningParameter) {
setLearningMethodOrLogErrorIfActualLearningMethodIsNotSupervised(node);
} else if(learningMethodKnown && learningMethod.equals(LearningMethod.REINFORCEMENT)
&& ganLearningParameter && !reinforcementLearningParameter) {
setLearningMethodOrLogErrorIfActualLearningMethodIsNotGAN(node);
}
}
......@@ -88,11 +97,25 @@ public class CheckLearningParameterCombination implements CNNTrainASTEntryCoCo {
}
}
private void setLearningMethodOrLogErrorIfActualLearningMethodIsNotGAN(ASTEntry node) {
if (isLearningMethodKnown()) {
if (!learningMethod.equals(LearningMethod.GAN)) {
Log.error("0" + ErrorCodes.UNSUPPORTED_PARAMETER + " Parameter "
+ node.getName() + " is not supported for " + this.learningMethod + " learning.",
node.get_SourcePositionStart());
}
} else {
setLearningMethodToGAN();
}
}
private void evaluateLearningMethodEntry(ASTEntry node) {
ASTLearningMethodValue learningMethodValue = (ASTLearningMethodValue)node.getValue();
LearningMethod evaluatedLearningMethod;
if(learningMethodValue.isPresentReinforcement())
evaluatedLearningMethod = LearningMethod.REINFORCEMENT;
else if(learningMethodValue.isPresentGan())
evaluatedLearningMethod = LearningMethod.GAN;
else
evaluatedLearningMethod = LearningMethod.SUPERVISED;
......@@ -126,6 +149,9 @@ public class CheckLearningParameterCombination implements CNNTrainASTEntryCoCo {
if (learningMethod.equals(LearningMethod.REINFORCEMENT)) {
return parameterAlgorithmMapping.getAllReinforcementParameters();
}
if (learningMethod.equals(LearningMethod.GAN)) {
return parameterAlgorithmMapping.getAllGANParameters();
}
return parameterAlgorithmMapping.getAllSupervisedParameters();
}
......@@ -134,6 +160,8 @@ public class CheckLearningParameterCombination implements CNNTrainASTEntryCoCo {
private void setLearningMethod(final LearningMethod learningMethod) {
if (learningMethod.equals(LearningMethod.REINFORCEMENT))
setLearningMethodToReinforcement();
else if (learningMethod.equals(LearningMethod.GAN))
setLearningMethodToGAN();
else
setLearningMethodToSupervised();
}
......@@ -147,4 +175,9 @@ public class CheckLearningParameterCombination implements CNNTrainASTEntryCoCo {
this.learningMethod = LearningMethod.REINFORCEMENT;
this.learningMethodKnown = true;
}
private void setLearningMethodToGAN() {
this.learningMethod = LearningMethod.GAN;
this.learningMethodKnown = true;
}
}
/**
* (c) https://github.com/MontiCore/monticore
*
* The license generally applicable for this project
* can be found under https://github.com/MontiCore/monticore.
*/
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.cnntrain._cocos;
import de.monticore.lang.monticar.cnntrain._ast.ASTConfiguration;
import de.monticore.lang.monticar.cnntrain.helper.ErrorCodes;
import de.se_rwth.commons.logging.Log;
import static de.monticore.lang.monticar.cnntrain._cocos.ASTConfigurationUtils.*;
public class CheckNoiseInputDistributionDependency implements CNNTrainASTConfigurationCoCo {
@Override
public void check(final ASTConfiguration node) {
if (isGANLearning(node) && hasNoiseName(node)) {
if (!hasNoiseDistribution(node)) {
Log.error("0" + ErrorCodes.REQUIRED_PARAMETER_MISSING +
" Noise input specified but noise distribution parameter is missing");
}
}
}
}
/**
* (c) https://github.com/MontiCore/monticore
*
* The license generally applicable for this project
* can be found under https://github.com/MontiCore/monticore.
*/
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.cnntrain._cocos;
import de.monticore.lang.monticar.cnntrain._ast.ASTConfiguration;
import de.monticore.lang.monticar.cnntrain.helper.ConfigEntryNameConstants;
import de.monticore.lang.monticar.cnntrain.helper.ErrorCodes;
import de.se_rwth.commons.logging.Log;
import static de.monticore.lang.monticar.cnntrain._cocos.ASTConfigurationUtils.*;
public class CheckNoiseInputMissing implements CNNTrainASTConfigurationCoCo {
@Override
public void check(final ASTConfiguration node) {
if (isGANLearning(node)) {
if (!hasNoiseName(node)) {
Log.warn(ErrorCodes.MISSING_PARAMETER_VALUE_CODE + " No noise input specified. Are you sure this is correct?");
}
}
}
}
......@@ -137,8 +137,26 @@ class ParameterAlgorithmMapping {
ASTNoiseInputEntry.class,
ASTGeneratorLossWeightEntry.class,
ASTDiscriminatorLossWeightEntry.class,
ASTSpeedPeriodEntry.class,
ASTPrintImagesEntry.class
ASTPrintImagesEntry.class,
ASTMeanValueEntry.class,
ASTSpreadValueEntry.class,
ASTBatchSizeEntry.class,
ASTLoadCheckpointEntry.class,
ASTCheckpointPeriodEntry.class,
ASTLoadPretrainedEntry.class,
ASTLogPeriodEntry.class,
ASTNormalizeEntry.class,
ASTNumEpochEntry.class,
ASTLossWeightsEntry.class,
ASTSparseLabelEntry.class,
ASTLossAxisEntry.class,
ASTBatchAxisEntry.class,
ASTFromLogitsEntry.class,
ASTIgnoreIndicesEntry.class,
ASTIgnoreLabelEntry.class,
ASTMarginEntry.class,
ASTLabelFormatEntry.class,
ASTRhoEntry.class
);
ParameterAlgorithmMapping() {
......@@ -164,13 +182,11 @@ class ParameterAlgorithmMapping {
boolean isSupervisedLearningParameter(Class<? extends ASTEntry> entryClazz) {
return GENERAL_PARAMETERS.contains(entryClazz)
|| EXCLUSIVE_SUPERVISED_PARAMETERS.contains(entryClazz);
|| EXCLUSIVE_SUPERVISED_PARAMETERS.contains(entryClazz);
}
boolean isGANLearningParameter(Class<? extends ASTEntry> entryClazz) {
return GENERAL_PARAMETERS.contains(entryClazz)
|| EXCLUSIVE_SUPERVISED_PARAMETERS.contains(entryClazz)
|| GENERAL_GAN_PARAMETERS.contains(entryClazz);
}
......@@ -196,7 +212,6 @@ class ParameterAlgorithmMapping {
List<Class> getAllGANParameters() {
return ImmutableList.<Class> builder()
.addAll(GENERAL_PARAMETERS)
.addAll(EXCLUSIVE_SUPERVISED_PARAMETERS)
.addAll(GENERAL_GAN_PARAMETERS)
.build();
}
......@@ -215,7 +230,6 @@ class ParameterAlgorithmMapping {
return ImmutableList.<Class> builder()
.addAll(GENERAL_PARAMETERS)
.addAll(EXCLUSIVE_SUPERVISED_PARAMETERS)
.addAll(GENERAL_GAN_PARAMETERS)
.build();
}
}
......@@ -168,14 +168,6 @@ public class CNNTrainSymbolTableCreator extends CNNTrainSymbolTableCreatorTOP {
configuration.getEntryMap().put(node.getName(), entry);
}
@Override
public void endVisit(ASTSpeedPeriodEntry node) {
EntrySymbol entry = new EntrySymbol(node.getName());
entry.setValue(getValueSymbolForInteger(node.getValue()));
addToScopeAndLinkWithNode(entry, node);
configuration.getEntryMap().put(node.getName(), entry);
}
@Override
public void endVisit(ASTPrintImagesEntry node) {
EntrySymbol entry = new EntrySymbol(node.getName());
......
......@@ -59,7 +59,6 @@ public class ConfigEntryNameConstants {
public static final String NOISE_INPUT = "noise_input";
public static final String GENERATOR_LOSS_WEIGHT = "generator_loss_weight";
public static final String DISCRIMINATOR_LOSS_WEIGHT = "discriminator_loss_weight";
public static final String SPEED_PERIOD_ENTRY = "speed_period";
public static final String PRINT_IMAGES = "print_images";
}
......@@ -12,6 +12,8 @@ import de.monticore.lang.monticar.cnntrain._ast.ASTCNNTrainCompilationUnit;
import de.monticore.lang.monticar.cnntrain._ast.ASTCNNTrainNode;
import de.monticore.lang.monticar.cnntrain._cocos.CNNTrainCoCoChecker;
import de.monticore.lang.monticar.cnntrain._cocos.CNNTrainCocos;
import de.monticore.lang.monticar.cnntrain._cocos.CNNTrainConfigurationSymbolChecker;
import de.monticore.lang.monticar.cnntrain._cocos.CNNTrainConfigurationSymbolCoCo;
import de.monticore.lang.monticar.cnntrain._symboltable.CNNTrainCompilationUnitSymbol;
import de.monticore.lang.monticar.cnntrain._symboltable.ConfigurationSymbol;
import de.monticore.symboltable.Scope;
......
......@@ -70,6 +70,15 @@ public class AllCoCoTest extends AbstractCoCoTest{
checkValid("valid_tests", "ReinforcementWithRosReward");
}
@Test
public void testValidDefaultGANConfig() { checkValid("valid_tests", "DefaultGANConfig"); }
@Test
public void testValidInfoGANDefaultGANConfig() { checkValid("valid_tests", "InfoGANConfig"); }
@Test
public void testValidImageGANConfig() { checkValid("valid_tests", "ImageGANConfig"); }
@Test
public void testInvalidEntryRepetition() {
checkInvalid(new CNNTrainCoCoChecker().addCoCo(new CheckEntryRepetition()),
......@@ -195,4 +204,39 @@ public class AllCoCoTest extends AbstractCoCoTest{
"invalid_cocos_tests", "CheckRLParameterOnlyWithLearningMethodSet",
new ExpectedErrorInfo(1, ErrorCodes.REQUIRED_PARAMETER_MISSING));
}
@Test
public void testInvalidGeneratorLossTargetNameDependency () {
checkInvalid(new CNNTrainCoCoChecker().addCoCo(new CheckGeneratorLossTargetNameDependency()),
"invalid_cocos_tests", "CheckGeneratorLossTargetNameDependency",
new ExpectedErrorInfo(1, ErrorCodes.REQUIRED_PARAMETER_MISSING));
}
@Test
public void testInvalidConstraintDistributionQNetworkDependency () {
checkInvalid(new CNNTrainCoCoChecker().addCoCo(new CheckConstraintDistributionQNetworkDependency()),
"invalid_cocos_tests", "CheckConstraintDistributionQNetworkDependency",
new ExpectedErrorInfo(1, ErrorCodes.REQUIRED_PARAMETER_MISSING));
}
@Test
public void testInvalidConstraintLossQNetworkDependency () {
checkInvalid(new CNNTrainCoCoChecker().addCoCo(new CheckConstraintLossesQNetworkDependency()),
"invalid_cocos_tests", "CheckConstraintLossQNetworkDependency",
new ExpectedErrorInfo(1, ErrorCodes.REQUIRED_PARAMETER_MISSING));
}
@Test
public void testInvalidInputDistributionDependency () {
checkInvalid(new CNNTrainCoCoChecker().addCoCo(new CheckNoiseInputDistributionDependency()),
"invalid_cocos_tests", "CheckInputDistributionDependency",
new ExpectedErrorInfo(1, ErrorCodes.REQUIRED_PARAMETER_MISSING));
}
@Test
public void testInvalidNoiseInputMissing () {
checkInvalid(new CNNTrainCoCoChecker().addCoCo(new CheckNoiseInputMissing()),
"invalid_cocos_tests", "CheckInputMissing",
new ExpectedErrorInfo(1, ErrorCodes.MISSING_PARAMETER_VALUE_CODE));
}
}
/* (c) https://github.com/MontiCore/monticore */
configuration CheckConstraintDistributionQNetworkDependency {
learning_method: gan
discriminator_name: mnistGenerator.Discriminator
num_epoch: 10
batch_size: 64
normalize: false
context: cpu
noise_input: "noise"
print_images: true
log_period: 10
load_checkpoint: false
generator_loss_weight: 0.5
discriminator_loss_weight: 0.5
k_value: 1
optimizer: adam{
learning_rate: 0.0002
beta1: 0.5
}
discriminator_optimizer: adam{
learning_rate: 0.0002
beta1:0.5
}
noise_distribution: gaussian{
mean_value: 0
spread_value: 1
}
constraint_distributions: { "c1": gaussian{ mean_value: 0
spread_value: 1 } }
}
/* (c) https://github.com/MontiCore/monticore */
configuration CheckConstraintLossQNetworkDependency {
learning_method: gan
discriminator_name: mnistGenerator.Discriminator
num_epoch: 10
batch_size: 64
normalize: false
context: cpu
noise_input: "noise"
print_images: true
log_period: 10
load_checkpoint: false
generator_loss_weight: 0.5
discriminator_loss_weight: 0.5
k_value: 1
optimizer: adam{
learning_rate: 0.0002