From 7cd16d164ea7f44ff170c5453765bb42ba2c9199 Mon Sep 17 00:00:00 2001 From: Nicola Gatto Date: Mon, 7 Oct 2019 15:59:09 +0200 Subject: [PATCH] Pipeline fix and new CNNTrain Integration --- pom.xml | 4 +- .../gluongenerator/CNNTrain2Gluon.java | 14 +- .../FunctionParameterChecker.java | 28 ++- .../FunctionParameterCheckerTest.java | 215 ++++++++++++++++++ .../resources/target_code/CNNBufferFile.h | 1 - .../target_code/CNNCreator_Alexnet.py | 1 - .../CNNCreator_CifarClassifierNetwork.py | 1 - .../resources/target_code/CNNCreator_VGG16.py | 1 - .../target_code/CNNDataLoader_Alexnet.py | 1 - .../CNNDataLoader_CifarClassifierNetwork.py | 1 - .../target_code/CNNDataLoader_VGG16.py | 1 - .../resources/target_code/CNNNet_Alexnet.py | 23 +- .../CNNNet_CifarClassifierNetwork.py | 1 - .../resources/target_code/CNNNet_VGG16.py | 1 - .../target_code/CNNPredictor_Alexnet.h | 1 - .../CNNPredictor_CifarClassifierNetwork.h | 1 - .../target_code/CNNPredictor_VGG16.h | 1 - .../CNNSupervisedTrainer_Alexnet.py | 1 - ...upervisedTrainer_CifarClassifierNetwork.py | 1 - .../target_code/CNNSupervisedTrainer_VGG16.py | 1 - .../target_code/CNNTrainer_emptyConfig.py | 1 - .../target_code/CNNTrainer_fullConfig.py | 1 - .../target_code/CNNTrainer_simpleConfig.py | 1 - .../CNNTrainer_reinforcementConfig1.py | 1 - .../reinforcement_learning/agent.py | 1 - .../reinforcement_learning/cnnarch_logger.py | 1 - .../reinforcement_learning/environment.py | 1 - .../reinforcement_learning/replay_memory.py | 1 - .../reinforcement_learning/strategy.py | 1 - .../reinforcement_learning/util.py | 1 - .../ReinforcementConfig1/start_training.sh | 3 +- .../CNNTrainer_reinforcementConfig2.py | 1 - .../reinforcement_learning/agent.py | 1 - .../reinforcement_learning/cnnarch_logger.py | 1 - .../reinforcement_learning/environment.py | 1 - .../reinforcement_learning/replay_memory.py | 1 - .../reinforcement_learning/strategy.py | 1 - .../reinforcement_learning/util.py | 1 - .../ReinforcementConfig2/start_training.sh | 1 - .../CNNTrainer_reinforcementConfig3.py | 1 - .../reinforcement_learning/agent.py | 1 - .../reinforcement_learning/cnnarch_logger.py | 1 - .../reinforcement_learning/environment.py | 1 - .../reinforcement_learning/replay_memory.py | 1 - .../reinforcement_learning/strategy.py | 1 - .../reinforcement_learning/util.py | 1 - .../ReinforcementConfig3/start_training.sh | 1 - .../target_code/cmake/FindArmadillo.cmake | 1 - .../ddpg/CNNTrainer_actorNetwork.py | 1 - .../CNNCreator_CriticNetwork.py | 1 - .../CNNNet_CriticNetwork.py | 1 - .../ddpg/reinforcement_learning/agent.py | 1 - .../reinforcement_learning/cnnarch_logger.py | 1 - .../reinforcement_learning/environment.py | 1 - .../reinforcement_learning/replay_memory.py | 1 - .../ddpg/reinforcement_learning/strategy.py | 1 - .../ddpg/reinforcement_learning/util.py | 1 - .../target_code/ddpg/start_training.sh | 1 - .../reinforcement_learning/agent.py | 1 - .../reinforcement_learning/environment.py | 1 - .../reinforcement_learning/replay_memory.py | 1 - .../reinforcement_learning/strategy.py | 1 - .../reinforcement_learning/util.py | 1 - .../ros-ddpg/CNNTrainer_rosActorNetwork.py | 1 - .../CNNCreator_RosCriticNetwork.py | 1 - .../CNNNet_RosCriticNetwork.py | 1 - .../ros-ddpg/reinforcement_learning/agent.py | 1 - .../reinforcement_learning/cnnarch_logger.py | 1 - .../reinforcement_learning/environment.py | 1 - .../reinforcement_learning/replay_memory.py | 1 - .../reinforcement_learning/strategy.py | 1 - .../ros-ddpg/reinforcement_learning/util.py | 1 - .../target_code/ros-ddpg/start_training.sh | 1 - .../target_code/td3/CNNTrainer_tD3Config.py | 1 - .../CNNCreator_CriticNetwork.py | 1 - .../CNNNet_CriticNetwork.py | 1 - .../td3/reinforcement_learning/agent.py | 1 - .../reinforcement_learning/cnnarch_logger.py | 1 - .../td3/reinforcement_learning/environment.py | 1 - .../reinforcement_learning/replay_memory.py | 1 - .../td3/reinforcement_learning/strategy.py | 1 - .../td3/reinforcement_learning/util.py | 1 - .../target_code/td3/start_training.sh | 1 - 83 files changed, 271 insertions(+), 93 deletions(-) create mode 100644 src/test/java/de/monticore/lang/monticar/cnnarch/gluongenerator/reinforcement/FunctionParameterCheckerTest.java diff --git a/pom.xml b/pom.xml index 0a43658..5bf7ba0 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ de.monticore.lang.monticar cnnarch-gluon-generator - 0.2.8-SNAPSHOT + 0.2.9-SNAPSHOT @@ -17,7 +17,7 @@ 0.3.3-SNAPSHOT - 0.3.6-SNAPSHOT + 0.3.7-SNAPSHOT 0.0.4-SNAPSHOT 0.1.4 0.0.2-SNAPSHOT diff --git a/src/main/java/de/monticore/lang/monticar/cnnarch/gluongenerator/CNNTrain2Gluon.java b/src/main/java/de/monticore/lang/monticar/cnnarch/gluongenerator/CNNTrain2Gluon.java index 44ec4a0..91858ef 100644 --- a/src/main/java/de/monticore/lang/monticar/cnnarch/gluongenerator/CNNTrain2Gluon.java +++ b/src/main/java/de/monticore/lang/monticar/cnnarch/gluongenerator/CNNTrain2Gluon.java @@ -151,7 +151,14 @@ public class CNNTrain2Gluon extends CNNTrainGenerator { // Generate Reward function if necessary if (configuration.getRlRewardFunction().isPresent()) { - generateRewardFunction(configuration.getRlRewardFunction().get(), Paths.get(rootProjectModelsDir)); + if (configuration.getTrainedArchitecture().isPresent()) { + generateRewardFunction(configuration.getTrainedArchitecture().get(), + configuration.getRlRewardFunction().get(), Paths.get(rootProjectModelsDir)); + } else { + Log.error("No architecture model for the trained neural network but is required for " + + "reinforcement learning configuration."); + } + } ftlContext.put("trainerName", trainerName); @@ -167,7 +174,8 @@ public class CNNTrain2Gluon extends CNNTrainGenerator { return fileContentMap; } - private void generateRewardFunction(RewardFunctionSymbol rewardFunctionSymbol, Path modelsDirPath) { + private void generateRewardFunction(NNArchitectureSymbol trainedArchitecture, + RewardFunctionSymbol rewardFunctionSymbol, Path modelsDirPath) { GeneratorPythonWrapperStandaloneApi pythonWrapperApi = new GeneratorPythonWrapperStandaloneApi(); List fullNameOfComponent = rewardFunctionSymbol.getRewardFunctionComponentName(); @@ -200,7 +208,7 @@ public class CNNTrain2Gluon extends CNNTrainGenerator { componentPortInformation = pythonWrapperApi.generate(emaSymbol, pythonWrapperOutputPath); } RewardFunctionParameterAdapter functionParameter = new RewardFunctionParameterAdapter(componentPortInformation); - new FunctionParameterChecker().check(functionParameter); + new FunctionParameterChecker().check(functionParameter, trainedArchitecture); rewardFunctionSymbol.setRewardFunctionParameter(functionParameter); } diff --git a/src/main/java/de/monticore/lang/monticar/cnnarch/gluongenerator/reinforcement/FunctionParameterChecker.java b/src/main/java/de/monticore/lang/monticar/cnnarch/gluongenerator/reinforcement/FunctionParameterChecker.java index 9e84b6c..82a1e03 100644 --- a/src/main/java/de/monticore/lang/monticar/cnnarch/gluongenerator/reinforcement/FunctionParameterChecker.java +++ b/src/main/java/de/monticore/lang/monticar/cnnarch/gluongenerator/reinforcement/FunctionParameterChecker.java @@ -1,8 +1,11 @@ /* (c) https://github.com/MontiCore/monticore */ package de.monticore.lang.monticar.cnnarch.gluongenerator.reinforcement; +import de.monticore.lang.monticar.cnntrain._symboltable.NNArchitectureSymbol; import de.se_rwth.commons.logging.Log; +import java.util.List; + /** * */ @@ -11,21 +14,42 @@ public class FunctionParameterChecker { private String inputTerminalParameterName; private String outputParameterName; private RewardFunctionParameterAdapter rewardFunctionParameter; + private NNArchitectureSymbol trainedArchitecture; public FunctionParameterChecker() { } - public void check(final RewardFunctionParameterAdapter rewardFunctionParameter) { + public void check(final RewardFunctionParameterAdapter rewardFunctionParameter, + final NNArchitectureSymbol trainedArchitecture) { + assert rewardFunctionParameter != null; + assert trainedArchitecture != null; this.rewardFunctionParameter = rewardFunctionParameter; + this.trainedArchitecture = trainedArchitecture; + retrieveParameterNames(); checkHasExactlyTwoInputs(); checkHasExactlyOneOutput(); checkHasStateAndTerminalInput(); - checkInputStateDimension(); checkInputTerminalTypeAndDimension(); + checkStateDimensionEqualsTrainedArchitectureState(); + checkInputStateDimension(); checkOutputDimension(); } + private void checkStateDimensionEqualsTrainedArchitectureState() { + failIfConditionFails(stateInputOfNNArchitectureIsEqualToRewardState(), + "State dimension of trained architecture is not equal to reward state dimensions."); + } + + private boolean stateInputOfNNArchitectureIsEqualToRewardState() { + assert trainedArchitecture.getInputs().size() == 1: "Trained architecture is not a policy network."; + final String nnStateInputName = trainedArchitecture.getInputs().get(0); + final List dimensions = trainedArchitecture.getDimensions().get(nnStateInputName); + + return rewardFunctionParameter.getInputPortDimensionOfPort(inputStateParameterName).isPresent() + && rewardFunctionParameter.getInputPortDimensionOfPort(inputStateParameterName).get().equals(dimensions); + } + private void checkHasExactlyTwoInputs() { failIfConditionFails(functionHasTwoInputs(), "Reward function must have exactly two input parameters: " + "One input needs to represents the environment's state and another input needs to be a " diff --git a/src/test/java/de/monticore/lang/monticar/cnnarch/gluongenerator/reinforcement/FunctionParameterCheckerTest.java b/src/test/java/de/monticore/lang/monticar/cnnarch/gluongenerator/reinforcement/FunctionParameterCheckerTest.java new file mode 100644 index 0000000..b0ce6b9 --- /dev/null +++ b/src/test/java/de/monticore/lang/monticar/cnnarch/gluongenerator/reinforcement/FunctionParameterCheckerTest.java @@ -0,0 +1,215 @@ +package de.monticore.lang.monticar.cnnarch.gluongenerator.reinforcement; + +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Lists; +import de.monticore.lang.monticar.cnntrain._symboltable.NNArchitectureSymbol; +import de.monticore.lang.monticar.generator.pythonwrapper.symbolservices.data.ComponentPortInformation; +import de.monticore.lang.monticar.generator.pythonwrapper.symbolservices.data.EmadlType; +import de.monticore.lang.monticar.generator.pythonwrapper.symbolservices.data.PortDirection; +import de.monticore.lang.monticar.generator.pythonwrapper.symbolservices.data.PortVariable; +import de.se_rwth.commons.logging.Finding; +import de.se_rwth.commons.logging.Log; +import org.junit.Before; +import org.junit.Test; + +import java.util.List; +import java.util.Map; + +import static org.junit.Assert.*; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +public class FunctionParameterCheckerTest { + private static final List STATE_DIMENSIONS = Lists.newArrayList(3,2,4); + private static final PortVariable STATE_PORT = PortVariable.multidimensionalVariableFrom("input1", EmadlType.Q, + PortDirection.INPUT, STATE_DIMENSIONS); + private static final PortVariable TERMINAL_PORT = PortVariable.primitiveVariableFrom("input2", EmadlType.B, + PortDirection.INPUT); + private static final PortVariable OUTPUT_PORT = PortVariable.primitiveVariableFrom("output1", EmadlType.Q, + PortDirection.OUTPUT); + private static final String COMPONENT_NAME = "TestRewardComponent"; + + FunctionParameterChecker uut = new FunctionParameterChecker(); + + @Before + public void setup() { + Log.getFindings().clear(); + Log.enableFailQuick(false); + } + + @Test + public void validReward() { + // given + RewardFunctionParameterAdapter adapter = getValidRewardAdapter(); + + // when + uut.check(adapter, getValidTrainedArchitecture()); + List findings = Log.getFindings(); + + assertEquals(0, findings.stream().filter(Finding::isError).count()); + } + + @Test + public void invalidRewardWithOneInput() { + // given + RewardFunctionParameterAdapter adapter = getComponentWithOneInput(); + + // when + uut.check(adapter, getValidTrainedArchitecture()); + List findings = Log.getFindings(); + + assertTrue(findings.stream().anyMatch(Finding::isError)); + } + + @Test + public void invalidRewardWithTwoOutputs() { + // given + RewardFunctionParameterAdapter adapter = getComponentWithTwoOutputs(); + + // when + uut.check(adapter, getValidTrainedArchitecture()); + List findings = Log.getFindings(); + + assertTrue(findings.stream().anyMatch(Finding::isError)); + } + + @Test + public void invalidRewardWithTerminalHasQType() { + // given + RewardFunctionParameterAdapter adapter = getComponentWithTwoQInputs(); + + // when + uut.check(adapter, getValidTrainedArchitecture()); + List findings = Log.getFindings(); + + assertTrue(findings.stream().anyMatch(Finding::isError)); + } + + @Test + public void invalidRewardWithNonScalarOutput() { + // given + RewardFunctionParameterAdapter adapter = getComponentWithNonScalarOutput(); + + // when + uut.check(adapter, getValidTrainedArchitecture()); + List findings = Log.getFindings(); + + assertTrue(findings.stream().filter(Finding::isError).count() == 1); + } + + @Test + public void invalidRewardStateUnequalToTrainedArchitectureState1() { + // given + RewardFunctionParameterAdapter adapter = getValidRewardAdapter(); + NNArchitectureSymbol trainedArchitectureWithDifferenDimension = getTrainedArchitectureWithStateDimensions( + Lists.newArrayList(6)); + + // when + uut.check(adapter, trainedArchitectureWithDifferenDimension); + List findings = Log.getFindings(); + + assertTrue(findings.stream().filter(Finding::isError).count() == 1); + } + + @Test + public void invalidRewardStateUnequalToTrainedArchitectureState2() { + // given + RewardFunctionParameterAdapter adapter = getValidRewardAdapter(); + NNArchitectureSymbol trainedArchitectureWithDifferenDimension = getTrainedArchitectureWithStateDimensions( + Lists.newArrayList(3, 8)); + + // when + uut.check(adapter, trainedArchitectureWithDifferenDimension); + List findings = Log.getFindings(); + + assertTrue(findings.stream().filter(Finding::isError).count() == 1); + } + + @Test + public void invalidRewardStateUnequalToTrainedArchitectureState3() { + // given + RewardFunctionParameterAdapter adapter = getValidRewardAdapter(); + NNArchitectureSymbol trainedArchitectureWithDifferenDimension = getTrainedArchitectureWithStateDimensions( + Lists.newArrayList(2,4,3)); + + // when + uut.check(adapter, trainedArchitectureWithDifferenDimension); + List findings = Log.getFindings(); + + assertTrue(findings.stream().filter(Finding::isError).count() == 1); + } + + private RewardFunctionParameterAdapter getComponentWithNonScalarOutput() { + ComponentPortInformation componentPortInformation = new ComponentPortInformation(COMPONENT_NAME); + componentPortInformation.addAllInputs(getValidInputPortVariables()); + List outputs = Lists.newArrayList(PortVariable.multidimensionalVariableFrom( + "output", EmadlType.Q, PortDirection.OUTPUT, Lists.newArrayList(2,2))); + componentPortInformation.addAllOutputs(outputs); + return new RewardFunctionParameterAdapter(componentPortInformation); + } + + private RewardFunctionParameterAdapter getComponentWithTwoQInputs() { + ComponentPortInformation componentPortInformation + = new ComponentPortInformation(COMPONENT_NAME); + List inputs = Lists.newArrayList(STATE_PORT, + PortVariable.multidimensionalVariableFrom("input2", EmadlType.Q, PortDirection.INPUT, + Lists.newArrayList(2,3,2))); + componentPortInformation.addAllInputs(inputs); + componentPortInformation.addAllOutputs(getValidOutputPorts()); + return new RewardFunctionParameterAdapter(componentPortInformation); + } + + private RewardFunctionParameterAdapter getComponentWithTwoOutputs() { + ComponentPortInformation componentPortInformation + = new ComponentPortInformation(COMPONENT_NAME); + componentPortInformation.addAllInputs(getValidInputPortVariables()); + List outputs = getValidOutputPorts(); + outputs.add(PortVariable.primitiveVariableFrom("output2", EmadlType.B, PortDirection.OUTPUT)); + componentPortInformation.addAllOutputs(outputs); + return new RewardFunctionParameterAdapter(componentPortInformation); + } + + private RewardFunctionParameterAdapter getComponentWithOneInput() { + ComponentPortInformation componentPortInformation + = new ComponentPortInformation(COMPONENT_NAME); + componentPortInformation.addAllInputs(Lists.newArrayList(STATE_PORT)); + componentPortInformation.addAllOutputs(getValidOutputPorts()); + return new RewardFunctionParameterAdapter(componentPortInformation); + } + + private RewardFunctionParameterAdapter getValidRewardAdapter() { + ComponentPortInformation componentPortInformation + = new ComponentPortInformation(COMPONENT_NAME); + componentPortInformation.addAllInputs(getValidInputPortVariables()); + componentPortInformation.addAllOutputs(getValidOutputPorts()); + return new RewardFunctionParameterAdapter(componentPortInformation); + } + + private List getValidOutputPorts() { + return Lists.newArrayList(OUTPUT_PORT); + } + + private List getValidInputPortVariables() { + return Lists.newArrayList(STATE_PORT, TERMINAL_PORT); + } + + private NNArchitectureSymbol getValidTrainedArchitecture() { + NNArchitectureSymbol nnArchitectureSymbol = mock(NNArchitectureSymbol.class); + final String stateInputName = "stateInput"; + when(nnArchitectureSymbol.getInputs()).thenReturn(Lists.newArrayList(stateInputName)); + when(nnArchitectureSymbol.getDimensions()).thenReturn(ImmutableMap.>builder() + .put(stateInputName, STATE_DIMENSIONS) + .build()); + return nnArchitectureSymbol; + } + + private NNArchitectureSymbol getTrainedArchitectureWithStateDimensions(final List dimensions) { + NNArchitectureSymbol nnArchitectureSymbol = mock(NNArchitectureSymbol.class); + final String stateInputName = "stateInput"; + when(nnArchitectureSymbol.getInputs()).thenReturn(Lists.newArrayList(stateInputName)); + when(nnArchitectureSymbol.getDimensions()).thenReturn(ImmutableMap.>builder() + .put(stateInputName, dimensions) + .build()); + return nnArchitectureSymbol; + } +} \ No newline at end of file diff --git a/src/test/resources/target_code/CNNBufferFile.h b/src/test/resources/target_code/CNNBufferFile.h index 7908de6..c0d8dd9 100644 --- a/src/test/resources/target_code/CNNBufferFile.h +++ b/src/test/resources/target_code/CNNBufferFile.h @@ -1,4 +1,3 @@ -/* (c) https://github.com/MontiCore/monticore */ #ifndef CNNBUFFERFILE_H #define CNNBUFFERFILE_H diff --git a/src/test/resources/target_code/CNNCreator_Alexnet.py b/src/test/resources/target_code/CNNCreator_Alexnet.py index 108fe6e..9b2dc27 100644 --- a/src/test/resources/target_code/CNNCreator_Alexnet.py +++ b/src/test/resources/target_code/CNNCreator_Alexnet.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import mxnet as mx import logging import os diff --git a/src/test/resources/target_code/CNNCreator_CifarClassifierNetwork.py b/src/test/resources/target_code/CNNCreator_CifarClassifierNetwork.py index d927167..f84c6bd 100644 --- a/src/test/resources/target_code/CNNCreator_CifarClassifierNetwork.py +++ b/src/test/resources/target_code/CNNCreator_CifarClassifierNetwork.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import mxnet as mx import logging import os diff --git a/src/test/resources/target_code/CNNCreator_VGG16.py b/src/test/resources/target_code/CNNCreator_VGG16.py index 0d54de5..5be6f05 100644 --- a/src/test/resources/target_code/CNNCreator_VGG16.py +++ b/src/test/resources/target_code/CNNCreator_VGG16.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import mxnet as mx import logging import os diff --git a/src/test/resources/target_code/CNNDataLoader_Alexnet.py b/src/test/resources/target_code/CNNDataLoader_Alexnet.py index 88eb540..3a4b61c 100644 --- a/src/test/resources/target_code/CNNDataLoader_Alexnet.py +++ b/src/test/resources/target_code/CNNDataLoader_Alexnet.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import os import h5py import mxnet as mx diff --git a/src/test/resources/target_code/CNNDataLoader_CifarClassifierNetwork.py b/src/test/resources/target_code/CNNDataLoader_CifarClassifierNetwork.py index b9c2dcf..c5477ed 100644 --- a/src/test/resources/target_code/CNNDataLoader_CifarClassifierNetwork.py +++ b/src/test/resources/target_code/CNNDataLoader_CifarClassifierNetwork.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import os import h5py import mxnet as mx diff --git a/src/test/resources/target_code/CNNDataLoader_VGG16.py b/src/test/resources/target_code/CNNDataLoader_VGG16.py index 97b80eb..f14204c 100644 --- a/src/test/resources/target_code/CNNDataLoader_VGG16.py +++ b/src/test/resources/target_code/CNNDataLoader_VGG16.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import os import h5py import mxnet as mx diff --git a/src/test/resources/target_code/CNNNet_Alexnet.py b/src/test/resources/target_code/CNNNet_Alexnet.py index 243f29e..a01ba0e 100644 --- a/src/test/resources/target_code/CNNNet_Alexnet.py +++ b/src/test/resources/target_code/CNNNet_Alexnet.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import mxnet as mx import numpy as np from mxnet import gluon @@ -91,13 +90,14 @@ class Net_0(gluon.HybridBlock): else: self.input_normalization_data_ = NoNormalization() - self.conv1_padding = Padding(padding=(0,0,0,0,2,1,2,1)) + self.conv1_padding = Padding(padding=(0,0,-1,0,0,0,0,0)) self.conv1_ = gluon.nn.Conv2D(channels=96, kernel_size=(11,11), strides=(4,4), use_bias=True) # conv1_, output shape: {[96,55,55]} + self.pool1_padding = Padding(padding=(0,0,-1,0,0,0,0,0)) self.pool1_ = gluon.nn.MaxPool2D( pool_size=(3,3), strides=(2,2)) @@ -114,6 +114,7 @@ class Net_0(gluon.HybridBlock): use_bias=True) # conv2_1_, output shape: {[128,27,27]} + self.pool2_1_padding = Padding(padding=(0,0,-1,0,0,0,0,0)) self.pool2_1_ = gluon.nn.MaxPool2D( pool_size=(3,3), strides=(2,2)) @@ -127,6 +128,7 @@ class Net_0(gluon.HybridBlock): use_bias=True) # conv2_2_, output shape: {[128,27,27]} + self.pool2_2_padding = Padding(padding=(0,0,-1,0,0,0,0,0)) self.pool2_2_ = gluon.nn.MaxPool2D( pool_size=(3,3), strides=(2,2)) @@ -162,6 +164,7 @@ class Net_0(gluon.HybridBlock): use_bias=True) # conv5_1_, output shape: {[128,13,13]} + self.pool5_1_padding = Padding(padding=(0,0,-1,0,0,0,0,0)) self.pool5_1_ = gluon.nn.MaxPool2D( pool_size=(3,3), strides=(2,2)) @@ -183,6 +186,7 @@ class Net_0(gluon.HybridBlock): use_bias=True) # conv5_2_, output shape: {[128,13,13]} + self.pool5_2_padding = Padding(padding=(0,0,-1,0,0,0,0,0)) self.pool5_2_ = gluon.nn.MaxPool2D( pool_size=(3,3), strides=(2,2)) @@ -217,7 +221,8 @@ class Net_0(gluon.HybridBlock): beta=0.75, knorm=2, nsize=5) - pool1_ = self.pool1_(lrn1_) + pool1_padding = self.pool1_padding(lrn1_) + pool1_ = self.pool1_(pool1_padding) relu1_ = self.relu1_(pool1_) split1_ = self.split1_(relu1_) get2_1_ = split1_[0] @@ -228,7 +233,8 @@ class Net_0(gluon.HybridBlock): beta=0.75, knorm=2, nsize=5) - pool2_1_ = self.pool2_1_(lrn2_1_) + pool2_1_padding = self.pool2_1_padding(lrn2_1_) + pool2_1_ = self.pool2_1_(pool2_1_padding) relu2_1_ = self.relu2_1_(pool2_1_) get2_2_ = split1_[1] conv2_2_padding = self.conv2_2_padding(get2_2_) @@ -238,7 +244,8 @@ class Net_0(gluon.HybridBlock): beta=0.75, knorm=2, nsize=5) - pool2_2_ = self.pool2_2_(lrn2_2_) + pool2_2_padding = self.pool2_2_padding(lrn2_2_) + pool2_2_ = self.pool2_2_(pool2_2_padding) relu2_2_ = self.relu2_2_(pool2_2_) concatenate3_ = self.concatenate3_(relu2_1_, relu2_2_) conv3_padding = self.conv3_padding(concatenate3_) @@ -251,7 +258,8 @@ class Net_0(gluon.HybridBlock): relu4_1_ = self.relu4_1_(conv4_1_) conv5_1_padding = self.conv5_1_padding(relu4_1_) conv5_1_ = self.conv5_1_(conv5_1_padding) - pool5_1_ = self.pool5_1_(conv5_1_) + pool5_1_padding = self.pool5_1_padding(conv5_1_) + pool5_1_ = self.pool5_1_(pool5_1_padding) relu5_1_ = self.relu5_1_(pool5_1_) get4_2_ = split3_[1] conv4_2_padding = self.conv4_2_padding(get4_2_) @@ -259,7 +267,8 @@ class Net_0(gluon.HybridBlock): relu4_2_ = self.relu4_2_(conv4_2_) conv5_2_padding = self.conv5_2_padding(relu4_2_) conv5_2_ = self.conv5_2_(conv5_2_padding) - pool5_2_ = self.pool5_2_(conv5_2_) + pool5_2_padding = self.pool5_2_padding(conv5_2_) + pool5_2_ = self.pool5_2_(pool5_2_padding) relu5_2_ = self.relu5_2_(pool5_2_) concatenate6_ = self.concatenate6_(relu5_1_, relu5_2_) fc6_ = self.fc6_(concatenate6_) diff --git a/src/test/resources/target_code/CNNNet_CifarClassifierNetwork.py b/src/test/resources/target_code/CNNNet_CifarClassifierNetwork.py index 0cd0b9a..d0f832f 100644 --- a/src/test/resources/target_code/CNNNet_CifarClassifierNetwork.py +++ b/src/test/resources/target_code/CNNNet_CifarClassifierNetwork.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import mxnet as mx import numpy as np from mxnet import gluon diff --git a/src/test/resources/target_code/CNNNet_VGG16.py b/src/test/resources/target_code/CNNNet_VGG16.py index 0db7a8a..6d12447 100644 --- a/src/test/resources/target_code/CNNNet_VGG16.py +++ b/src/test/resources/target_code/CNNNet_VGG16.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import mxnet as mx import numpy as np from mxnet import gluon diff --git a/src/test/resources/target_code/CNNPredictor_Alexnet.h b/src/test/resources/target_code/CNNPredictor_Alexnet.h index 6c8c1a4..af175fb 100644 --- a/src/test/resources/target_code/CNNPredictor_Alexnet.h +++ b/src/test/resources/target_code/CNNPredictor_Alexnet.h @@ -1,4 +1,3 @@ -/* (c) https://github.com/MontiCore/monticore */ #ifndef CNNPREDICTOR_ALEXNET #define CNNPREDICTOR_ALEXNET diff --git a/src/test/resources/target_code/CNNPredictor_CifarClassifierNetwork.h b/src/test/resources/target_code/CNNPredictor_CifarClassifierNetwork.h index 929002f..32d6fff 100644 --- a/src/test/resources/target_code/CNNPredictor_CifarClassifierNetwork.h +++ b/src/test/resources/target_code/CNNPredictor_CifarClassifierNetwork.h @@ -1,4 +1,3 @@ -/* (c) https://github.com/MontiCore/monticore */ #ifndef CNNPREDICTOR_CIFARCLASSIFIERNETWORK #define CNNPREDICTOR_CIFARCLASSIFIERNETWORK diff --git a/src/test/resources/target_code/CNNPredictor_VGG16.h b/src/test/resources/target_code/CNNPredictor_VGG16.h index bfe5aeb..47251ef 100644 --- a/src/test/resources/target_code/CNNPredictor_VGG16.h +++ b/src/test/resources/target_code/CNNPredictor_VGG16.h @@ -1,4 +1,3 @@ -/* (c) https://github.com/MontiCore/monticore */ #ifndef CNNPREDICTOR_VGG16 #define CNNPREDICTOR_VGG16 diff --git a/src/test/resources/target_code/CNNSupervisedTrainer_Alexnet.py b/src/test/resources/target_code/CNNSupervisedTrainer_Alexnet.py index 5b8d88e..d3bbd66 100644 --- a/src/test/resources/target_code/CNNSupervisedTrainer_Alexnet.py +++ b/src/test/resources/target_code/CNNSupervisedTrainer_Alexnet.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import mxnet as mx import logging import numpy as np diff --git a/src/test/resources/target_code/CNNSupervisedTrainer_CifarClassifierNetwork.py b/src/test/resources/target_code/CNNSupervisedTrainer_CifarClassifierNetwork.py index 0ff367c..f063455 100644 --- a/src/test/resources/target_code/CNNSupervisedTrainer_CifarClassifierNetwork.py +++ b/src/test/resources/target_code/CNNSupervisedTrainer_CifarClassifierNetwork.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import mxnet as mx import logging import numpy as np diff --git a/src/test/resources/target_code/CNNSupervisedTrainer_VGG16.py b/src/test/resources/target_code/CNNSupervisedTrainer_VGG16.py index 13b8e22..57f412c 100644 --- a/src/test/resources/target_code/CNNSupervisedTrainer_VGG16.py +++ b/src/test/resources/target_code/CNNSupervisedTrainer_VGG16.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import mxnet as mx import logging import numpy as np diff --git a/src/test/resources/target_code/CNNTrainer_emptyConfig.py b/src/test/resources/target_code/CNNTrainer_emptyConfig.py index 3493e78..28c2c2a 100644 --- a/src/test/resources/target_code/CNNTrainer_emptyConfig.py +++ b/src/test/resources/target_code/CNNTrainer_emptyConfig.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import logging import mxnet as mx import CNNCreator_emptyConfig diff --git a/src/test/resources/target_code/CNNTrainer_fullConfig.py b/src/test/resources/target_code/CNNTrainer_fullConfig.py index 92b55d8..efcc2a3 100644 --- a/src/test/resources/target_code/CNNTrainer_fullConfig.py +++ b/src/test/resources/target_code/CNNTrainer_fullConfig.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import logging import mxnet as mx import CNNCreator_fullConfig diff --git a/src/test/resources/target_code/CNNTrainer_simpleConfig.py b/src/test/resources/target_code/CNNTrainer_simpleConfig.py index 21979b6..db5e077 100644 --- a/src/test/resources/target_code/CNNTrainer_simpleConfig.py +++ b/src/test/resources/target_code/CNNTrainer_simpleConfig.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import logging import mxnet as mx import CNNCreator_simpleConfig diff --git a/src/test/resources/target_code/ReinforcementConfig1/CNNTrainer_reinforcementConfig1.py b/src/test/resources/target_code/ReinforcementConfig1/CNNTrainer_reinforcementConfig1.py index c67132e..b5853fa 100644 --- a/src/test/resources/target_code/ReinforcementConfig1/CNNTrainer_reinforcementConfig1.py +++ b/src/test/resources/target_code/ReinforcementConfig1/CNNTrainer_reinforcementConfig1.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore from reinforcement_learning.agent import DqnAgent from reinforcement_learning.util import AgentSignalHandler from reinforcement_learning.cnnarch_logger import ArchLogger diff --git a/src/test/resources/target_code/ReinforcementConfig1/reinforcement_learning/agent.py b/src/test/resources/target_code/ReinforcementConfig1/reinforcement_learning/agent.py index c558a5c..148c898 100644 --- a/src/test/resources/target_code/ReinforcementConfig1/reinforcement_learning/agent.py +++ b/src/test/resources/target_code/ReinforcementConfig1/reinforcement_learning/agent.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import mxnet as mx import numpy as np import time diff --git a/src/test/resources/target_code/ReinforcementConfig1/reinforcement_learning/cnnarch_logger.py b/src/test/resources/target_code/ReinforcementConfig1/reinforcement_learning/cnnarch_logger.py index 03bbb48..4cd0c7d 100644 --- a/src/test/resources/target_code/ReinforcementConfig1/reinforcement_learning/cnnarch_logger.py +++ b/src/test/resources/target_code/ReinforcementConfig1/reinforcement_learning/cnnarch_logger.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import logging import sys import os diff --git a/src/test/resources/target_code/ReinforcementConfig1/reinforcement_learning/environment.py b/src/test/resources/target_code/ReinforcementConfig1/reinforcement_learning/environment.py index bb4ca71..051f3c4 100644 --- a/src/test/resources/target_code/ReinforcementConfig1/reinforcement_learning/environment.py +++ b/src/test/resources/target_code/ReinforcementConfig1/reinforcement_learning/environment.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import abc import logging logging.basicConfig(level=logging.INFO) diff --git a/src/test/resources/target_code/ReinforcementConfig1/reinforcement_learning/replay_memory.py b/src/test/resources/target_code/ReinforcementConfig1/reinforcement_learning/replay_memory.py index 8107f0a..954f266 100644 --- a/src/test/resources/target_code/ReinforcementConfig1/reinforcement_learning/replay_memory.py +++ b/src/test/resources/target_code/ReinforcementConfig1/reinforcement_learning/replay_memory.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import numpy as np diff --git a/src/test/resources/target_code/ReinforcementConfig1/reinforcement_learning/strategy.py b/src/test/resources/target_code/ReinforcementConfig1/reinforcement_learning/strategy.py index eb14997..8e4c279 100644 --- a/src/test/resources/target_code/ReinforcementConfig1/reinforcement_learning/strategy.py +++ b/src/test/resources/target_code/ReinforcementConfig1/reinforcement_learning/strategy.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import numpy as np diff --git a/src/test/resources/target_code/ReinforcementConfig1/reinforcement_learning/util.py b/src/test/resources/target_code/ReinforcementConfig1/reinforcement_learning/util.py index 89aca7a..78e7795 100644 --- a/src/test/resources/target_code/ReinforcementConfig1/reinforcement_learning/util.py +++ b/src/test/resources/target_code/ReinforcementConfig1/reinforcement_learning/util.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import signal import sys import numpy as np diff --git a/src/test/resources/target_code/ReinforcementConfig1/start_training.sh b/src/test/resources/target_code/ReinforcementConfig1/start_training.sh index 8193a85..d04ec2b 100644 --- a/src/test/resources/target_code/ReinforcementConfig1/start_training.sh +++ b/src/test/resources/target_code/ReinforcementConfig1/start_training.sh @@ -1,3 +1,2 @@ #!/bin/bash -# (c) https://github.com/MontiCore/monticore -python CNNTrainer_reinforcementConfig1.py +python CNNTrainer_reinforcementConfig1.py \ No newline at end of file diff --git a/src/test/resources/target_code/ReinforcementConfig2/CNNTrainer_reinforcementConfig2.py b/src/test/resources/target_code/ReinforcementConfig2/CNNTrainer_reinforcementConfig2.py index 1e89a1b..d7c3cc9 100644 --- a/src/test/resources/target_code/ReinforcementConfig2/CNNTrainer_reinforcementConfig2.py +++ b/src/test/resources/target_code/ReinforcementConfig2/CNNTrainer_reinforcementConfig2.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore from reinforcement_learning.agent import DqnAgent from reinforcement_learning.util import AgentSignalHandler from reinforcement_learning.cnnarch_logger import ArchLogger diff --git a/src/test/resources/target_code/ReinforcementConfig2/reinforcement_learning/agent.py b/src/test/resources/target_code/ReinforcementConfig2/reinforcement_learning/agent.py index c558a5c..148c898 100644 --- a/src/test/resources/target_code/ReinforcementConfig2/reinforcement_learning/agent.py +++ b/src/test/resources/target_code/ReinforcementConfig2/reinforcement_learning/agent.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import mxnet as mx import numpy as np import time diff --git a/src/test/resources/target_code/ReinforcementConfig2/reinforcement_learning/cnnarch_logger.py b/src/test/resources/target_code/ReinforcementConfig2/reinforcement_learning/cnnarch_logger.py index 03bbb48..4cd0c7d 100644 --- a/src/test/resources/target_code/ReinforcementConfig2/reinforcement_learning/cnnarch_logger.py +++ b/src/test/resources/target_code/ReinforcementConfig2/reinforcement_learning/cnnarch_logger.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import logging import sys import os diff --git a/src/test/resources/target_code/ReinforcementConfig2/reinforcement_learning/environment.py b/src/test/resources/target_code/ReinforcementConfig2/reinforcement_learning/environment.py index f6a0ba3..381ec9e 100644 --- a/src/test/resources/target_code/ReinforcementConfig2/reinforcement_learning/environment.py +++ b/src/test/resources/target_code/ReinforcementConfig2/reinforcement_learning/environment.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import abc import logging logging.basicConfig(level=logging.INFO) diff --git a/src/test/resources/target_code/ReinforcementConfig2/reinforcement_learning/replay_memory.py b/src/test/resources/target_code/ReinforcementConfig2/reinforcement_learning/replay_memory.py index 8107f0a..954f266 100644 --- a/src/test/resources/target_code/ReinforcementConfig2/reinforcement_learning/replay_memory.py +++ b/src/test/resources/target_code/ReinforcementConfig2/reinforcement_learning/replay_memory.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import numpy as np diff --git a/src/test/resources/target_code/ReinforcementConfig2/reinforcement_learning/strategy.py b/src/test/resources/target_code/ReinforcementConfig2/reinforcement_learning/strategy.py index 20591b7..d2d2386 100644 --- a/src/test/resources/target_code/ReinforcementConfig2/reinforcement_learning/strategy.py +++ b/src/test/resources/target_code/ReinforcementConfig2/reinforcement_learning/strategy.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import numpy as np diff --git a/src/test/resources/target_code/ReinforcementConfig2/reinforcement_learning/util.py b/src/test/resources/target_code/ReinforcementConfig2/reinforcement_learning/util.py index b09ef63..1d8b38c 100644 --- a/src/test/resources/target_code/ReinforcementConfig2/reinforcement_learning/util.py +++ b/src/test/resources/target_code/ReinforcementConfig2/reinforcement_learning/util.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import signal import sys import numpy as np diff --git a/src/test/resources/target_code/ReinforcementConfig2/start_training.sh b/src/test/resources/target_code/ReinforcementConfig2/start_training.sh index 446cd1f..5f1944d 100644 --- a/src/test/resources/target_code/ReinforcementConfig2/start_training.sh +++ b/src/test/resources/target_code/ReinforcementConfig2/start_training.sh @@ -1,3 +1,2 @@ #!/bin/bash -# (c) https://github.com/MontiCore/monticore python CNNTrainer_reinforcementConfig2.py diff --git a/src/test/resources/target_code/ReinforcementConfig3/CNNTrainer_reinforcementConfig3.py b/src/test/resources/target_code/ReinforcementConfig3/CNNTrainer_reinforcementConfig3.py index 9458622..6af8211 100644 --- a/src/test/resources/target_code/ReinforcementConfig3/CNNTrainer_reinforcementConfig3.py +++ b/src/test/resources/target_code/ReinforcementConfig3/CNNTrainer_reinforcementConfig3.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore from reinforcement_learning.agent import DqnAgent from reinforcement_learning.util import AgentSignalHandler from reinforcement_learning.cnnarch_logger import ArchLogger diff --git a/src/test/resources/target_code/ReinforcementConfig3/reinforcement_learning/agent.py b/src/test/resources/target_code/ReinforcementConfig3/reinforcement_learning/agent.py index c558a5c..148c898 100644 --- a/src/test/resources/target_code/ReinforcementConfig3/reinforcement_learning/agent.py +++ b/src/test/resources/target_code/ReinforcementConfig3/reinforcement_learning/agent.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import mxnet as mx import numpy as np import time diff --git a/src/test/resources/target_code/ReinforcementConfig3/reinforcement_learning/cnnarch_logger.py b/src/test/resources/target_code/ReinforcementConfig3/reinforcement_learning/cnnarch_logger.py index 03bbb48..4cd0c7d 100644 --- a/src/test/resources/target_code/ReinforcementConfig3/reinforcement_learning/cnnarch_logger.py +++ b/src/test/resources/target_code/ReinforcementConfig3/reinforcement_learning/cnnarch_logger.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import logging import sys import os diff --git a/src/test/resources/target_code/ReinforcementConfig3/reinforcement_learning/environment.py b/src/test/resources/target_code/ReinforcementConfig3/reinforcement_learning/environment.py index 3cc0ed8..1cdbcf6 100644 --- a/src/test/resources/target_code/ReinforcementConfig3/reinforcement_learning/environment.py +++ b/src/test/resources/target_code/ReinforcementConfig3/reinforcement_learning/environment.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import abc import logging logging.basicConfig(level=logging.INFO) diff --git a/src/test/resources/target_code/ReinforcementConfig3/reinforcement_learning/replay_memory.py b/src/test/resources/target_code/ReinforcementConfig3/reinforcement_learning/replay_memory.py index 8107f0a..954f266 100644 --- a/src/test/resources/target_code/ReinforcementConfig3/reinforcement_learning/replay_memory.py +++ b/src/test/resources/target_code/ReinforcementConfig3/reinforcement_learning/replay_memory.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import numpy as np diff --git a/src/test/resources/target_code/ReinforcementConfig3/reinforcement_learning/strategy.py b/src/test/resources/target_code/ReinforcementConfig3/reinforcement_learning/strategy.py index 20591b7..d2d2386 100644 --- a/src/test/resources/target_code/ReinforcementConfig3/reinforcement_learning/strategy.py +++ b/src/test/resources/target_code/ReinforcementConfig3/reinforcement_learning/strategy.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import numpy as np diff --git a/src/test/resources/target_code/ReinforcementConfig3/reinforcement_learning/util.py b/src/test/resources/target_code/ReinforcementConfig3/reinforcement_learning/util.py index b09ef63..1d8b38c 100644 --- a/src/test/resources/target_code/ReinforcementConfig3/reinforcement_learning/util.py +++ b/src/test/resources/target_code/ReinforcementConfig3/reinforcement_learning/util.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import signal import sys import numpy as np diff --git a/src/test/resources/target_code/ReinforcementConfig3/start_training.sh b/src/test/resources/target_code/ReinforcementConfig3/start_training.sh index 5d98d36..84a67d1 100644 --- a/src/test/resources/target_code/ReinforcementConfig3/start_training.sh +++ b/src/test/resources/target_code/ReinforcementConfig3/start_training.sh @@ -1,3 +1,2 @@ #!/bin/bash -# (c) https://github.com/MontiCore/monticore python CNNTrainer_reinforcementConfig3.py diff --git a/src/test/resources/target_code/cmake/FindArmadillo.cmake b/src/test/resources/target_code/cmake/FindArmadillo.cmake index 10a9b62..a2b17fa 100644 --- a/src/test/resources/target_code/cmake/FindArmadillo.cmake +++ b/src/test/resources/target_code/cmake/FindArmadillo.cmake @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore # Automatically generated file # # - Try to find Armadillo diff --git a/src/test/resources/target_code/ddpg/CNNTrainer_actorNetwork.py b/src/test/resources/target_code/ddpg/CNNTrainer_actorNetwork.py index 180ee7d..b09af8e 100644 --- a/src/test/resources/target_code/ddpg/CNNTrainer_actorNetwork.py +++ b/src/test/resources/target_code/ddpg/CNNTrainer_actorNetwork.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore from reinforcement_learning.agent import DdpgAgent from reinforcement_learning.util import AgentSignalHandler from reinforcement_learning.cnnarch_logger import ArchLogger diff --git a/src/test/resources/target_code/ddpg/reinforcement_learning/CNNCreator_CriticNetwork.py b/src/test/resources/target_code/ddpg/reinforcement_learning/CNNCreator_CriticNetwork.py index 4caa127..17e0094 100644 --- a/src/test/resources/target_code/ddpg/reinforcement_learning/CNNCreator_CriticNetwork.py +++ b/src/test/resources/target_code/ddpg/reinforcement_learning/CNNCreator_CriticNetwork.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import mxnet as mx import logging import os diff --git a/src/test/resources/target_code/ddpg/reinforcement_learning/CNNNet_CriticNetwork.py b/src/test/resources/target_code/ddpg/reinforcement_learning/CNNNet_CriticNetwork.py index 4e46dce..e7f610f 100644 --- a/src/test/resources/target_code/ddpg/reinforcement_learning/CNNNet_CriticNetwork.py +++ b/src/test/resources/target_code/ddpg/reinforcement_learning/CNNNet_CriticNetwork.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import mxnet as mx import numpy as np from mxnet import gluon diff --git a/src/test/resources/target_code/ddpg/reinforcement_learning/agent.py b/src/test/resources/target_code/ddpg/reinforcement_learning/agent.py index c558a5c..148c898 100644 --- a/src/test/resources/target_code/ddpg/reinforcement_learning/agent.py +++ b/src/test/resources/target_code/ddpg/reinforcement_learning/agent.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import mxnet as mx import numpy as np import time diff --git a/src/test/resources/target_code/ddpg/reinforcement_learning/cnnarch_logger.py b/src/test/resources/target_code/ddpg/reinforcement_learning/cnnarch_logger.py index 03bbb48..4cd0c7d 100644 --- a/src/test/resources/target_code/ddpg/reinforcement_learning/cnnarch_logger.py +++ b/src/test/resources/target_code/ddpg/reinforcement_learning/cnnarch_logger.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import logging import sys import os diff --git a/src/test/resources/target_code/ddpg/reinforcement_learning/environment.py b/src/test/resources/target_code/ddpg/reinforcement_learning/environment.py index f6a0ba3..381ec9e 100644 --- a/src/test/resources/target_code/ddpg/reinforcement_learning/environment.py +++ b/src/test/resources/target_code/ddpg/reinforcement_learning/environment.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import abc import logging logging.basicConfig(level=logging.INFO) diff --git a/src/test/resources/target_code/ddpg/reinforcement_learning/replay_memory.py b/src/test/resources/target_code/ddpg/reinforcement_learning/replay_memory.py index 8107f0a..954f266 100644 --- a/src/test/resources/target_code/ddpg/reinforcement_learning/replay_memory.py +++ b/src/test/resources/target_code/ddpg/reinforcement_learning/replay_memory.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import numpy as np diff --git a/src/test/resources/target_code/ddpg/reinforcement_learning/strategy.py b/src/test/resources/target_code/ddpg/reinforcement_learning/strategy.py index 20591b7..d2d2386 100644 --- a/src/test/resources/target_code/ddpg/reinforcement_learning/strategy.py +++ b/src/test/resources/target_code/ddpg/reinforcement_learning/strategy.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import numpy as np diff --git a/src/test/resources/target_code/ddpg/reinforcement_learning/util.py b/src/test/resources/target_code/ddpg/reinforcement_learning/util.py index b09ef63..1d8b38c 100644 --- a/src/test/resources/target_code/ddpg/reinforcement_learning/util.py +++ b/src/test/resources/target_code/ddpg/reinforcement_learning/util.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import signal import sys import numpy as np diff --git a/src/test/resources/target_code/ddpg/start_training.sh b/src/test/resources/target_code/ddpg/start_training.sh index 916be74..699ab07 100644 --- a/src/test/resources/target_code/ddpg/start_training.sh +++ b/src/test/resources/target_code/ddpg/start_training.sh @@ -1,3 +1,2 @@ #!/bin/bash -# (c) https://github.com/MontiCore/monticore python CNNTrainer_actorNetwork.py diff --git a/src/test/resources/target_code/reinforcement_learning/agent.py b/src/test/resources/target_code/reinforcement_learning/agent.py index c558a5c..148c898 100644 --- a/src/test/resources/target_code/reinforcement_learning/agent.py +++ b/src/test/resources/target_code/reinforcement_learning/agent.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import mxnet as mx import numpy as np import time diff --git a/src/test/resources/target_code/reinforcement_learning/environment.py b/src/test/resources/target_code/reinforcement_learning/environment.py index 141d763..5d9a342 100644 --- a/src/test/resources/target_code/reinforcement_learning/environment.py +++ b/src/test/resources/target_code/reinforcement_learning/environment.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import abc import logging logging.basicConfig(level=logging.INFO) diff --git a/src/test/resources/target_code/reinforcement_learning/replay_memory.py b/src/test/resources/target_code/reinforcement_learning/replay_memory.py index 419ffc7..274c5ad 100644 --- a/src/test/resources/target_code/reinforcement_learning/replay_memory.py +++ b/src/test/resources/target_code/reinforcement_learning/replay_memory.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import numpy as np class ReplayMemoryBuilder(object): diff --git a/src/test/resources/target_code/reinforcement_learning/strategy.py b/src/test/resources/target_code/reinforcement_learning/strategy.py index d38e908..ee4549d 100644 --- a/src/test/resources/target_code/reinforcement_learning/strategy.py +++ b/src/test/resources/target_code/reinforcement_learning/strategy.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import numpy as np diff --git a/src/test/resources/target_code/reinforcement_learning/util.py b/src/test/resources/target_code/reinforcement_learning/util.py index 1248745..af0f64a 100644 --- a/src/test/resources/target_code/reinforcement_learning/util.py +++ b/src/test/resources/target_code/reinforcement_learning/util.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import signal import sys import numpy as np diff --git a/src/test/resources/target_code/ros-ddpg/CNNTrainer_rosActorNetwork.py b/src/test/resources/target_code/ros-ddpg/CNNTrainer_rosActorNetwork.py index 26e81b6..261623f 100644 --- a/src/test/resources/target_code/ros-ddpg/CNNTrainer_rosActorNetwork.py +++ b/src/test/resources/target_code/ros-ddpg/CNNTrainer_rosActorNetwork.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore from reinforcement_learning.agent import DdpgAgent from reinforcement_learning.util import AgentSignalHandler from reinforcement_learning.cnnarch_logger import ArchLogger diff --git a/src/test/resources/target_code/ros-ddpg/reinforcement_learning/CNNCreator_RosCriticNetwork.py b/src/test/resources/target_code/ros-ddpg/reinforcement_learning/CNNCreator_RosCriticNetwork.py index 32ab28f..aaa2382 100644 --- a/src/test/resources/target_code/ros-ddpg/reinforcement_learning/CNNCreator_RosCriticNetwork.py +++ b/src/test/resources/target_code/ros-ddpg/reinforcement_learning/CNNCreator_RosCriticNetwork.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import mxnet as mx import logging import os diff --git a/src/test/resources/target_code/ros-ddpg/reinforcement_learning/CNNNet_RosCriticNetwork.py b/src/test/resources/target_code/ros-ddpg/reinforcement_learning/CNNNet_RosCriticNetwork.py index 4e46dce..e7f610f 100644 --- a/src/test/resources/target_code/ros-ddpg/reinforcement_learning/CNNNet_RosCriticNetwork.py +++ b/src/test/resources/target_code/ros-ddpg/reinforcement_learning/CNNNet_RosCriticNetwork.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import mxnet as mx import numpy as np from mxnet import gluon diff --git a/src/test/resources/target_code/ros-ddpg/reinforcement_learning/agent.py b/src/test/resources/target_code/ros-ddpg/reinforcement_learning/agent.py index c558a5c..148c898 100644 --- a/src/test/resources/target_code/ros-ddpg/reinforcement_learning/agent.py +++ b/src/test/resources/target_code/ros-ddpg/reinforcement_learning/agent.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import mxnet as mx import numpy as np import time diff --git a/src/test/resources/target_code/ros-ddpg/reinforcement_learning/cnnarch_logger.py b/src/test/resources/target_code/ros-ddpg/reinforcement_learning/cnnarch_logger.py index 03bbb48..4cd0c7d 100644 --- a/src/test/resources/target_code/ros-ddpg/reinforcement_learning/cnnarch_logger.py +++ b/src/test/resources/target_code/ros-ddpg/reinforcement_learning/cnnarch_logger.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import logging import sys import os diff --git a/src/test/resources/target_code/ros-ddpg/reinforcement_learning/environment.py b/src/test/resources/target_code/ros-ddpg/reinforcement_learning/environment.py index b8c5b16..aef8128 100644 --- a/src/test/resources/target_code/ros-ddpg/reinforcement_learning/environment.py +++ b/src/test/resources/target_code/ros-ddpg/reinforcement_learning/environment.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import abc import logging logging.basicConfig(level=logging.INFO) diff --git a/src/test/resources/target_code/ros-ddpg/reinforcement_learning/replay_memory.py b/src/test/resources/target_code/ros-ddpg/reinforcement_learning/replay_memory.py index 8107f0a..954f266 100644 --- a/src/test/resources/target_code/ros-ddpg/reinforcement_learning/replay_memory.py +++ b/src/test/resources/target_code/ros-ddpg/reinforcement_learning/replay_memory.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import numpy as np diff --git a/src/test/resources/target_code/ros-ddpg/reinforcement_learning/strategy.py b/src/test/resources/target_code/ros-ddpg/reinforcement_learning/strategy.py index 20591b7..d2d2386 100644 --- a/src/test/resources/target_code/ros-ddpg/reinforcement_learning/strategy.py +++ b/src/test/resources/target_code/ros-ddpg/reinforcement_learning/strategy.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import numpy as np diff --git a/src/test/resources/target_code/ros-ddpg/reinforcement_learning/util.py b/src/test/resources/target_code/ros-ddpg/reinforcement_learning/util.py index b09ef63..1d8b38c 100644 --- a/src/test/resources/target_code/ros-ddpg/reinforcement_learning/util.py +++ b/src/test/resources/target_code/ros-ddpg/reinforcement_learning/util.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import signal import sys import numpy as np diff --git a/src/test/resources/target_code/ros-ddpg/start_training.sh b/src/test/resources/target_code/ros-ddpg/start_training.sh index f945440..d14e30c 100644 --- a/src/test/resources/target_code/ros-ddpg/start_training.sh +++ b/src/test/resources/target_code/ros-ddpg/start_training.sh @@ -1,3 +1,2 @@ #!/bin/bash -# (c) https://github.com/MontiCore/monticore python CNNTrainer_rosActorNetwork.py diff --git a/src/test/resources/target_code/td3/CNNTrainer_tD3Config.py b/src/test/resources/target_code/td3/CNNTrainer_tD3Config.py index c92a1fc..4b184a4 100644 --- a/src/test/resources/target_code/td3/CNNTrainer_tD3Config.py +++ b/src/test/resources/target_code/td3/CNNTrainer_tD3Config.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore from reinforcement_learning.agent import TwinDelayedDdpgAgent from reinforcement_learning.util import AgentSignalHandler from reinforcement_learning.cnnarch_logger import ArchLogger diff --git a/src/test/resources/target_code/td3/reinforcement_learning/CNNCreator_CriticNetwork.py b/src/test/resources/target_code/td3/reinforcement_learning/CNNCreator_CriticNetwork.py index 4caa127..17e0094 100644 --- a/src/test/resources/target_code/td3/reinforcement_learning/CNNCreator_CriticNetwork.py +++ b/src/test/resources/target_code/td3/reinforcement_learning/CNNCreator_CriticNetwork.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import mxnet as mx import logging import os diff --git a/src/test/resources/target_code/td3/reinforcement_learning/CNNNet_CriticNetwork.py b/src/test/resources/target_code/td3/reinforcement_learning/CNNNet_CriticNetwork.py index 4e46dce..e7f610f 100644 --- a/src/test/resources/target_code/td3/reinforcement_learning/CNNNet_CriticNetwork.py +++ b/src/test/resources/target_code/td3/reinforcement_learning/CNNNet_CriticNetwork.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import mxnet as mx import numpy as np from mxnet import gluon diff --git a/src/test/resources/target_code/td3/reinforcement_learning/agent.py b/src/test/resources/target_code/td3/reinforcement_learning/agent.py index c558a5c..148c898 100644 --- a/src/test/resources/target_code/td3/reinforcement_learning/agent.py +++ b/src/test/resources/target_code/td3/reinforcement_learning/agent.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import mxnet as mx import numpy as np import time diff --git a/src/test/resources/target_code/td3/reinforcement_learning/cnnarch_logger.py b/src/test/resources/target_code/td3/reinforcement_learning/cnnarch_logger.py index 03bbb48..4cd0c7d 100644 --- a/src/test/resources/target_code/td3/reinforcement_learning/cnnarch_logger.py +++ b/src/test/resources/target_code/td3/reinforcement_learning/cnnarch_logger.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import logging import sys import os diff --git a/src/test/resources/target_code/td3/reinforcement_learning/environment.py b/src/test/resources/target_code/td3/reinforcement_learning/environment.py index f6a0ba3..381ec9e 100644 --- a/src/test/resources/target_code/td3/reinforcement_learning/environment.py +++ b/src/test/resources/target_code/td3/reinforcement_learning/environment.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import abc import logging logging.basicConfig(level=logging.INFO) diff --git a/src/test/resources/target_code/td3/reinforcement_learning/replay_memory.py b/src/test/resources/target_code/td3/reinforcement_learning/replay_memory.py index 8107f0a..954f266 100644 --- a/src/test/resources/target_code/td3/reinforcement_learning/replay_memory.py +++ b/src/test/resources/target_code/td3/reinforcement_learning/replay_memory.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import numpy as np diff --git a/src/test/resources/target_code/td3/reinforcement_learning/strategy.py b/src/test/resources/target_code/td3/reinforcement_learning/strategy.py index 20591b7..d2d2386 100644 --- a/src/test/resources/target_code/td3/reinforcement_learning/strategy.py +++ b/src/test/resources/target_code/td3/reinforcement_learning/strategy.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import numpy as np diff --git a/src/test/resources/target_code/td3/reinforcement_learning/util.py b/src/test/resources/target_code/td3/reinforcement_learning/util.py index b09ef63..1d8b38c 100644 --- a/src/test/resources/target_code/td3/reinforcement_learning/util.py +++ b/src/test/resources/target_code/td3/reinforcement_learning/util.py @@ -1,4 +1,3 @@ -# (c) https://github.com/MontiCore/monticore import signal import sys import numpy as np diff --git a/src/test/resources/target_code/td3/start_training.sh b/src/test/resources/target_code/td3/start_training.sh index 7f2aefa..92d00e7 100644 --- a/src/test/resources/target_code/td3/start_training.sh +++ b/src/test/resources/target_code/td3/start_training.sh @@ -1,3 +1,2 @@ #!/bin/bash -# (c) https://github.com/MontiCore/monticore python CNNTrainer_tD3Config.py -- GitLab