Aufgrund einer Wartung wird GitLab am 19.10. zwischen 8:00 und 9:00 Uhr kurzzeitig nicht zur Verfügung stehen. / Due to maintenance, GitLab will be temporarily unavailable on 19.10. between 8:00 and 9:00 am.

Commit e69c5e50 authored by Nicola Gatto's avatar Nicola Gatto
Browse files

Make neural network architecture a symbol

parent 3592294d
......@@ -20,11 +20,8 @@
*/
package de.monticore.lang.monticar.cnntrain._symboltable;
import com.google.common.collect.Lists;
import de.monticore.lang.monticar.cnntrain.annotations.TrainedArchitecture;
import de.monticore.symboltable.CommonScopeSpanningSymbol;
import javax.swing.text.html.Option;
import java.util.*;
public class ConfigurationSymbol extends CommonScopeSpanningSymbol {
......@@ -34,7 +31,7 @@ public class ConfigurationSymbol extends CommonScopeSpanningSymbol {
private OptimizerSymbol criticOptimizer;
private LossSymbol loss;
private RewardFunctionSymbol rlRewardFunctionSymbol;
private TrainedArchitecture trainedArchitecture;
private NNArchitectureSymbol trainedArchitecture;
public static final ConfigurationSymbolKind KIND = new ConfigurationSymbolKind();
......@@ -76,11 +73,11 @@ public class ConfigurationSymbol extends CommonScopeSpanningSymbol {
return Optional.ofNullable(this.rlRewardFunctionSymbol);
}
public Optional<TrainedArchitecture> getTrainedArchitecture() {
public Optional<NNArchitectureSymbol> getTrainedArchitecture() {
return Optional.ofNullable(trainedArchitecture);
}
public void setTrainedArchitecture(TrainedArchitecture trainedArchitecture) {
public void setTrainedArchitecture(NNArchitectureSymbol trainedArchitecture) {
this.trainedArchitecture = trainedArchitecture;
}
......
/**
*
* ******************************************************************************
* MontiCAR Modeling Family, www.se-rwth.de
* Copyright (c) 2017, Software Engineering Group at RWTH Aachen,
* All rights reserved.
*
* This project is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this project. If not, see <http://www.gnu.org/licenses/>.
* *******************************************************************************
*/
package de.monticore.lang.monticar.cnntrain._symboltable;
import de.monticore.lang.monticar.cnntrain.annotations.Range;
import de.monticore.symboltable.SymbolKind;
import java.util.List;
import java.util.Map;
public abstract class NNArchitectureSymbol extends de.monticore.symboltable.CommonSymbol {
public static final NNArchitectureSymbolKind KIND = NNArchitectureSymbolKind.INSTANCE;
public NNArchitectureSymbol(String name) {
super(name, KIND);
}
abstract public List<String> getInputs();
abstract public List<String> getOutputs();
abstract public Map<String, List<Integer>> getDimensions();
abstract public Map<String, Range> getRanges();
abstract public Map<String, String> getTypes();
}
\ No newline at end of file
......@@ -18,16 +18,21 @@
* License along with this project. If not, see <http://www.gnu.org/licenses/>.
* *******************************************************************************
*/
package de.monticore.lang.monticar.cnntrain.annotations;
package de.monticore.lang.monticar.cnntrain._symboltable;
import java.util.List;
import java.util.Map;
import de.monticore.symboltable.SymbolKind;
public interface TrainedArchitecture {
public List<String> getInputs();
public List<String> getOutputs();
public Map<String, List<Integer>> getDimensions();
public Map<String, Range> getRanges();
public Map<String, String> getTypes();
public class NNArchitectureSymbolKind implements SymbolKind {
public static final NNArchitectureSymbolKind INSTANCE = new NNArchitectureSymbolKind();
private static final String NAME = "de.monticore.lang.monticar.cnntrain._symboltable.NNArchitectureSymbolKind";
@Override
public String getName() {
return NAME;
}
@Override
public boolean isKindOf(SymbolKind kind) {
return NAME.equals(kind.getName()) || SymbolKind.super.isKindOf(kind);
}
}
\ No newline at end of file
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