Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
monticore
EmbeddedMontiArc
languages
CNNArchLang
Commits
ab89351a
Commit
ab89351a
authored
Oct 20, 2020
by
Julian Johannes Steinsberger-Dührßen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
variable name changes
parent
139baf52
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
35 deletions
+33
-35
src/main/java/de/monticore/lang/monticar/cnnarch/_symboltable/SerialCompositeElementSymbol.java
...ar/cnnarch/_symboltable/SerialCompositeElementSymbol.java
+4
-4
src/main/java/de/monticore/lang/monticar/cnnarch/predefined/AllPredefinedLayers.java
...lang/monticar/cnnarch/predefined/AllPredefinedLayers.java
+9
-11
src/main/java/de/monticore/lang/monticar/cnnarch/predefined/DotProductSelfAttention.java
.../monticar/cnnarch/predefined/DotProductSelfAttention.java
+3
-3
src/main/java/de/monticore/lang/monticar/cnnarch/predefined/EpisodicMemory.java
...core/lang/monticar/cnnarch/predefined/EpisodicMemory.java
+15
-15
src/main/java/de/monticore/lang/monticar/cnnarch/predefined/LoadNetwork.java
...nticore/lang/monticar/cnnarch/predefined/LoadNetwork.java
+2
-2
No files found.
src/main/java/de/monticore/lang/monticar/cnnarch/_symboltable/SerialCompositeElementSymbol.java
View file @
ab89351a
...
...
@@ -13,7 +13,7 @@ import java.util.*;
public
class
SerialCompositeElementSymbol
extends
CompositeElementSymbol
{
protected
List
<
List
<
ArchitectureElementSymbol
>>
episodicSubNetworks
=
new
ArrayList
<>(
new
ArrayList
<>());
protected
boolean
anyEpisodicLocalAdaption
=
false
;
protected
boolean
anyEpisodicLocalAdapt
at
ion
=
false
;
protected
void
setElements
(
List
<
ArchitectureElementSymbol
>
elements
)
{
ArchitectureElementSymbol
previous
=
null
;
...
...
@@ -60,10 +60,10 @@ public class SerialCompositeElementSymbol extends CompositeElementSymbol {
public
List
<
List
<
ArchitectureElementSymbol
>>
getEpisodicSubNetworks
()
{
return
episodicSubNetworks
;
}
protected
void
setAnyEpisodicLocalAdaptation
(
boolean
value
)
{
anyEpisodicLocalAdaptation
=
value
;
}
protected
void
setAnyEpisodicLocalAdaption
(
boolean
isUsed
){
anyEpisodicLocalAdaption
=
isUsed
;
}
public
boolean
getAnyEpisodicLocalAdaption
(){
return
anyEpisodicLocalAdaption
;
}
public
boolean
getAnyEpisodicLocalAdaptation
()
{
return
anyEpisodicLocalAdaptation
;
}
@Override
public
void
setInputElement
(
ArchitectureElementSymbol
inputElement
)
{
...
...
src/main/java/de/monticore/lang/monticar/cnnarch/predefined/AllPredefinedLayers.java
View file @
ab89351a
...
...
@@ -117,9 +117,15 @@ public class AllPredefinedLayers {
public
static
final
String
REPLAY_BATCH_SIZE_NAME
=
"replayBatchSize"
;
public
static
final
String
REPLAY_STEPS_NAME
=
"replaySteps"
;
public
static
final
String
REPLAY_GRADIENT_STEPS_NAME
=
"replayGradientSteps"
;
public
static
final
String
USE_LOCAL_ADAPTION_NAME
=
"useLocalAdaption"
;
public
static
final
String
LOCAL_ADAPTION_K_NAME
=
"localAdaptionK"
;
public
static
final
String
LOCAL_ADAPTION_GRADIENT_STEPS_NAME
=
"localAdaptionGradientSteps"
;
public
static
final
String
USE_LOCAL_ADAPTATION_NAME
=
"useLocalAdaptation"
;
public
static
final
String
LOCAL_ADAPTATION_K_NAME
=
"localAdaptationK"
;
public
static
final
String
LOCAL_ADAPTATION_GRADIENT_STEPS_NAME
=
"localAdaptationGradientSteps"
;
public
static
final
String
MAX_STORED_SAMPLES_NAME
=
"maxStoredSamples"
;
public
static
final
String
MEMORY_REPLACEMENT_STRATEGY_NAME
=
"memoryReplacementStrategy"
;
public
static
final
String
MEMORY_STORE_PROB_NAME
=
"memoryStoreProb"
;
public
static
final
String
QUERY_NET_DIR_NAME
=
"queryNetDir"
;
public
static
final
String
QUERY_NET_PREFIX_NAME
=
"queryNetPrefix"
;
public
static
final
String
QUERY_NET_NUM_INPUTS_NAME
=
"queryNetNumInputs"
;
//parameters for large memory layer
public
static
final
String
SUB_KEY_SIZE_NAME
=
"subKeySize"
;
...
...
@@ -128,14 +134,6 @@ public class AllPredefinedLayers {
public
static
final
String
K_NAME
=
"k"
;
public
static
final
String
NUM_HEADS_NAME
=
"numHeads"
;
public
static
final
String
VALUES_DIM_NAME
=
"valuesDim"
;
public
static
final
String
MEMORY_REPLACEMENT_STRATEGY_NAME
=
"memoryReplacementStrategy"
;
//parameters for episodic memory layer
public
static
final
String
MAX_STORED_SAMPLES_NAME
=
"maxStoredSamples"
;
public
static
final
String
REPLAY_MEMORY_STORE_PROB_NAME
=
"replayMemoryStoreProb"
;
public
static
final
String
QUERY_NET_DIR_NAME
=
"queryNetDir"
;
public
static
final
String
QUERY_NET_PREFIX_NAME
=
"queryNetPrefix"
;
public
static
final
String
QUERY_NET_NUM_INPUTS_NAME
=
"queryNetNumInputs"
;
//possible String values
public
static
final
String
PADDING_VALID
=
"valid"
;
...
...
src/main/java/de/monticore/lang/monticar/cnnarch/predefined/DotProductSelfAttention.java
View file @
ab89351a
...
...
@@ -50,7 +50,7 @@ public class DotProductSelfAttention extends PredefinedLayerDeclaration {
List
<
ParameterSymbol
>
parameters
=
new
ArrayList
<>(
Arrays
.
asList
(
new
ParameterSymbol
.
Builder
()
.
name
(
AllPredefinedLayers
.
SCALE_FACTOR_NAME
)
.
constraints
(
Constraints
.
POSITIVE
)
.
constraints
(
Constraints
.
POSITIVE
_OR_MINUS_ONE
)
.
defaultValue
(-
1
)
.
build
(),
new
ParameterSymbol
.
Builder
()
...
...
@@ -60,12 +60,12 @@ public class DotProductSelfAttention extends PredefinedLayerDeclaration {
.
build
(),
new
ParameterSymbol
.
Builder
()
.
name
(
AllPredefinedLayers
.
DIM_KEYS_NAME
)
.
constraints
(
Constraints
.
INTEGER
,
Constraints
.
POSITIVE
)
.
constraints
(
Constraints
.
INTEGER
,
Constraints
.
POSITIVE
_OR_MINUS_ONE
)
.
defaultValue
(-
1
)
.
build
(),
new
ParameterSymbol
.
Builder
()
.
name
(
AllPredefinedLayers
.
DIM_VALUES_NAME
)
.
constraints
(
Constraints
.
INTEGER
,
Constraints
.
POSITIVE
)
.
constraints
(
Constraints
.
INTEGER
,
Constraints
.
POSITIVE
_OR_MINUS_ONE
)
.
defaultValue
(-
1
)
.
build
(),
new
ParameterSymbol
.
Builder
()
...
...
src/main/java/de/monticore/lang/monticar/cnnarch/predefined/EpisodicMemory.java
View file @
ab89351a
...
...
@@ -74,29 +74,34 @@ public class EpisodicMemory extends PredefinedLayerDeclaration {
.
defaultValue
(
1
)
.
build
(),
new
ParameterSymbol
.
Builder
()
.
name
(
AllPredefinedLayers
.
REPLAY_MEMORY_STORE_PROB_NAME
)
.
constraints
(
Constraints
.
NUMBER
,
Constraints
.
BETWEEN_ZERO_AND_ONE
)
.
defaultValue
(
1
)
.
build
(),
new
ParameterSymbol
.
Builder
()
.
name
(
AllPredefinedLayers
.
USE_LOCAL_ADAPTION_NAME
)
.
name
(
AllPredefinedLayers
.
USE_LOCAL_ADAPTATION_NAME
)
.
constraints
(
Constraints
.
BOOLEAN
)
.
defaultValue
(
true
)
.
build
(),
new
ParameterSymbol
.
Builder
()
.
name
(
AllPredefinedLayers
.
LOCAL_ADAPTION_GRADIENT_STEPS_NAME
)
.
name
(
AllPredefinedLayers
.
LOCAL_ADAPT
AT
ION_GRADIENT_STEPS_NAME
)
.
constraints
(
Constraints
.
INTEGER
,
Constraints
.
POSITIVE
)
.
defaultValue
(
1
)
.
build
(),
new
ParameterSymbol
.
Builder
()
.
name
(
AllPredefinedLayers
.
LOCAL_ADAPTATION_K_NAME
)
.
constraints
(
Constraints
.
INTEGER
,
Constraints
.
POSITIVE
)
.
defaultValue
(
1
)
.
build
(),
new
ParameterSymbol
.
Builder
()
.
name
(
AllPredefinedLayers
.
MEMORY_STORE_PROB_NAME
)
.
constraints
(
Constraints
.
NUMBER
,
Constraints
.
BETWEEN_ZERO_AND_ONE
)
.
defaultValue
(
1
)
.
build
(),
new
ParameterSymbol
.
Builder
()
.
name
(
AllPredefinedLayers
.
MAX_STORED_SAMPLES_NAME
)
.
constraints
(
Constraints
.
INTEGER
,
Constraints
.
POSITIVE_OR_MINUS_ONE
)
.
defaultValue
(-
1
)
.
build
(),
new
ParameterSymbol
.
Builder
()
.
name
(
AllPredefinedLayers
.
LOCAL_ADAPTION_K
_NAME
)
.
constraints
(
Constraints
.
INTEGER
,
Constraints
.
POSITIV
E
)
.
defaultValue
(
1
)
.
name
(
AllPredefinedLayers
.
MEMORY_REPLACEMENT_STRATEGY
_NAME
)
.
constraints
(
Constraints
.
MEMORY_REPLACEMENT_STRATEGY_TYP
E
)
.
defaultValue
(
AllPredefinedLayers
.
REPLACE_OLDEST
)
.
build
(),
new
ParameterSymbol
.
Builder
()
.
name
(
AllPredefinedLayers
.
QUERY_NET_DIR_NAME
)
...
...
@@ -109,11 +114,6 @@ public class EpisodicMemory extends PredefinedLayerDeclaration {
new
ParameterSymbol
.
Builder
()
.
name
(
AllPredefinedLayers
.
QUERY_NET_NUM_INPUTS_NAME
)
.
constraints
(
Constraints
.
INTEGER
,
Constraints
.
POSITIVE
)
.
build
(),
new
ParameterSymbol
.
Builder
()
.
name
(
AllPredefinedLayers
.
MEMORY_REPLACEMENT_STRATEGY_NAME
)
.
constraints
(
Constraints
.
MEMORY_REPLACEMENT_STRATEGY_TYPE
)
.
defaultValue
(
AllPredefinedLayers
.
REPLACE_OLDEST
)
.
build
()));
declaration
.
setParameters
(
parameters
);
return
declaration
;
...
...
src/main/java/de/monticore/lang/monticar/cnnarch/predefined/LoadNetwork.java
View file @
ab89351a
...
...
@@ -61,11 +61,11 @@ public class LoadNetwork extends PredefinedLayerDeclaration {
.
build
(),
new
ParameterSymbol
.
Builder
()
.
name
(
AllPredefinedLayers
.
NUM_INPUTS_NAME
)
.
constraints
(
Constraints
.
INTEGER
)
.
constraints
(
Constraints
.
INTEGER
,
Constraints
.
POSITIVE
)
.
build
(),
new
ParameterSymbol
.
Builder
()
.
name
(
AllPredefinedLayers
.
OUTPUT_SHAPE_NAME
)
.
constraints
(
Constraints
.
INTEGER_OR_INTEGER_TUPLE
)
.
constraints
(
Constraints
.
INTEGER_OR_INTEGER_TUPLE
,
Constraints
.
POSITIVE
)
.
build
()));
declaration
.
setParameters
(
parameters
);
return
declaration
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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