Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
monticore
EmbeddedMontiArc
languages
CNNTrainLang
Commits
e69c5e50
Commit
e69c5e50
authored
Jul 18, 2019
by
Nicola Gatto
Browse files
Make neural network architecture a symbol
parent
3592294d
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/main/java/de/monticore/lang/monticar/cnntrain/_symboltable/ConfigurationSymbol.java
View file @
e69c5e50
...
...
@@ -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
Trained
Architecture
trainedArchitecture
;
private
NN
Architecture
Symbol
trainedArchitecture
;
public
static
final
ConfigurationSymbolKind
KIND
=
new
ConfigurationSymbolKind
();
...
...
@@ -76,11 +73,11 @@ public class ConfigurationSymbol extends CommonScopeSpanningSymbol {
return
Optional
.
ofNullable
(
this
.
rlRewardFunctionSymbol
);
}
public
Optional
<
Trained
Architecture
>
getTrainedArchitecture
()
{
public
Optional
<
NN
Architecture
Symbol
>
getTrainedArchitecture
()
{
return
Optional
.
ofNullable
(
trainedArchitecture
);
}
public
void
setTrainedArchitecture
(
Trained
Architecture
trainedArchitecture
)
{
public
void
setTrainedArchitecture
(
NN
Architecture
Symbol
trainedArchitecture
)
{
this
.
trainedArchitecture
=
trainedArchitecture
;
}
...
...
src/main/java/de/monticore/lang/monticar/cnntrain/_symboltable/NNArchitectureSymbol.java
0 → 100644
View file @
e69c5e50
/**
*
* ******************************************************************************
* 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
src/main/java/de/monticore/lang/monticar/cnntrain/
annotations/Trained
Architecture.java
→
src/main/java/de/monticore/lang/monticar/cnntrain/
_symboltable/NN
Architecture
SymbolKind
.java
View file @
e69c5e50
...
...
@@ -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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment