Commit a19ac91b authored by Christian Fuß's avatar Christian Fuß
Browse files

changed OneHOt size parameter name

parent be89fbfd
......@@ -20,7 +20,6 @@
*/
package de.monticore.lang.monticar.cnnarch._symboltable;
import com.google.gson.internal.Streams;
import de.monticore.lang.monticar.cnnarch.helper.ErrorCodes;
import de.monticore.lang.monticar.cnnarch.predefined.AllPredefinedLayers;
import de.monticore.lang.monticar.ranges._ast.ASTRange;
......@@ -119,9 +118,9 @@ abstract public class PredefinedLayerDeclaration extends LayerDeclarationSymbol
//check input for onehot layer
protected static void errorIfInputSizeUnequalToOnehotSize(List<ArchTypeSymbol> inputTypes, LayerSymbol layer){
if (!inputTypes.isEmpty() && layer.getIntValue(AllPredefinedLayers.ONE_HOT_SIZE_NAME).get() != 0) {
if (!inputTypes.isEmpty() && layer.getIntValue(AllPredefinedLayers.SIZE_NAME).get() != 0) {
int inputChannels = inputTypes.get(0).getChannels();
int onehotSize = layer.getIntValue(AllPredefinedLayers.ONE_HOT_SIZE_NAME).get();
int onehotSize = layer.getIntValue(AllPredefinedLayers.SIZE_NAME).get();
if (onehotSize != inputChannels){
Log.error("0" + ErrorCodes.INVALID_ELEMENT_INPUT_SHAPE +
......
......@@ -64,7 +64,7 @@ public class AllPredefinedLayers {
public static final String BETA_NAME = "beta";
public static final String PADDING_NAME = "padding";
public static final String POOL_TYPE_NAME = "pool_type";
public static final String ONE_HOT_SIZE_NAME = "size";
public static final String SIZE_NAME = "size";
public static final String BEAMSEARCH_MAX_LENGTH_NAME = "max_length";
public static final String BEAMSEARCH_WIDTH_NAME = "width";
......
......@@ -42,7 +42,7 @@ public class OneHot extends PredefinedLayerDeclaration {
channels = inputTypes.get(0).getChannels();
return Collections.singletonList(new ArchTypeSymbol.Builder()
.channels(layer.getIntValue(AllPredefinedLayers.ONE_HOT_SIZE_NAME).get())
.channels(layer.getIntValue(AllPredefinedLayers.SIZE_NAME).get())
.height(1)
.width(1)
.elementType("0", "1")
......@@ -59,7 +59,7 @@ public class OneHot extends PredefinedLayerDeclaration {
OneHot declaration = new OneHot();
List<VariableSymbol> parameters = new ArrayList<>(Arrays.asList(
new VariableSymbol.Builder()
.name(AllPredefinedLayers.ONE_HOT_SIZE_NAME)
.name(AllPredefinedLayers.SIZE_NAME)
.constraints(Constraints.POSITIVE, Constraints.INTEGER)
.defaultValue(channels)
.build()));
......
Supports Markdown
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