diff --git a/README.md b/README.md index f3f1d77c095a24c008b65eabb0c4d4b248a7b7db..90c1b7b2799fd1e1916f21da0bcbc475a5b542c0 100644 --- a/README.md +++ b/README.md @@ -877,6 +877,7 @@ All predefined methods start with a capital letter and all constructed methods h * **networkPrefix** (string, required): name of the network to load. This is a prefix of the file names, e.g. for Gluon there willl be two files (symbol and params) wich start with networkName- (the prefix would be networkName- with the -) followed by epoch number (param file) and file endings. * **numInputs** (integer > 0, required): number of inputs the loaded network expects. * **outputShape** (integer tuple > 0, reqiured): The expected shape of the output. If the network does not provide this shape, it it will be transformed with a dense layer and a reshape. + * **trainable** (boolean, optional, default=true): whether weights of the imported model must be updated during the training. ## Predefined Unroll Types diff --git a/pom.xml b/pom.xml index 0cd5c56e636c7b5a9d5a59d5a509009ef0be8937..45986a49f02b88aef29ac96276c70ea5ed0a80bc 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ de.monticore.lang.monticar cnn-arch - 0.4.9-SNAPSHOT + 0.4.10-SNAPSHOT diff --git a/src/main/java/de/monticore/lang/monticar/cnnarch/predefined/AllPredefinedLayers.java b/src/main/java/de/monticore/lang/monticar/cnnarch/predefined/AllPredefinedLayers.java index c80ba9eee6fd73a1d77f36632f458347e27b29f4..843dba281d837a3ae37f72ac68cd716410e5dead 100644 --- a/src/main/java/de/monticore/lang/monticar/cnnarch/predefined/AllPredefinedLayers.java +++ b/src/main/java/de/monticore/lang/monticar/cnnarch/predefined/AllPredefinedLayers.java @@ -128,6 +128,7 @@ public class AllPredefinedLayers { public static final String NETWORK_PREFIX_NAME = "networkPrefix"; public static final String NUM_INPUTS_NAME = "numInputs"; public static final String OUTPUT_SHAPE_NAME = "outputShape"; + public static final String TRAINABLE = "trainable"; //parameters DotProductSelfAttention public static final String SCALE_FACTOR_NAME="scaleFactor"; diff --git a/src/main/java/de/monticore/lang/monticar/cnnarch/predefined/LoadNetwork.java b/src/main/java/de/monticore/lang/monticar/cnnarch/predefined/LoadNetwork.java index be473829e544ea1f06414fd5e1b399c9768fe5f4..f471083ad11c44379e2de5ecc8fa6e241acccec9 100644 --- a/src/main/java/de/monticore/lang/monticar/cnnarch/predefined/LoadNetwork.java +++ b/src/main/java/de/monticore/lang/monticar/cnnarch/predefined/LoadNetwork.java @@ -66,6 +66,11 @@ public class LoadNetwork extends PredefinedLayerDeclaration { new ParameterSymbol.Builder() .name(AllPredefinedLayers.OUTPUT_SHAPE_NAME) .constraints(Constraints.INTEGER_OR_INTEGER_TUPLE, Constraints.POSITIVE) + .build(), + new ParameterSymbol.Builder() + .name(AllPredefinedLayers.TRAINABLE) + .constraints(Constraints.BOOLEAN) + .defaultValue(true) .build())); declaration.setParameters(parameters); return declaration;