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
generators
EMADL2CPP
Commits
f81f8ee5
Commit
f81f8ee5
authored
Oct 26, 2018
by
Carlos Alfredo Yeverino Rodriguez
Browse files
Added project files for new emadl model "lenet"
parent
1fde5334
Pipeline
#81032
passed with stages
in 4 minutes and 22 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/test/resources/models/lenet/ArgMax.emadl
0 → 100644
View file @
f81f8ee5
package
lenet
;
component
ArgMax
<
Z
(
1
:
oo
)
n
=
2
>{
ports
in
Q
^{
n
}
inputVector
,
out
Z
(
0
:
oo
)
maxIndex
,
out
Q
maxValue
;
implementation
Math
{
maxIndex
=
0
;
maxValue
=
inputVector
(
1
);
for
i
=
2
:
n
if
inputVector
(
i
)
>
maxValue
maxIndex
=
i
-
1
;
maxValue
=
inputVector
(
i
);
end
end
}
}
\ No newline at end of file
src/test/resources/models/lenet/LeNetNetwork.cnnt
0 → 100644
View file @
f81f8ee5
configuration LeNetNetwork{
num_epoch:1000
batch_size:256
context:gpu
eval_metric:accuracy
optimizer:adam{
learning_rate:0.001
learning_rate_policy:fixed
weight_decay:0.001
epsilon:0.00000001
beta1:0.9
beta2:0.999
}
}
src/test/resources/models/lenet/LeNetNetwork.emadl
0 → 100644
View file @
f81f8ee5
package
lenet
;
component
LeNetNetwork
<
Z
(
2
:
oo
)
classes
=
10
>{
ports
in
Z
(
0
:
255
)^{
1
,
28
,
28
}
image
,
out
Q
(
0
:
1
)^{
classes
}
predictions
;
implementation
CNN
{
image
->
Convolution
(
kernel
=(
5
,
5
),
channels
=
20
,
padding
=
"valid"
)
->
Pooling
(
pool_type
=
"max"
,
kernel
=(
2
,
2
),
stride
=(
2
,
2
),
padding
=
"valid"
)
->
Convolution
(
kernel
=(
5
,
5
),
channels
=
50
,
padding
=
"valid"
)
->
Pooling
(
pool_type
=
"max"
,
kernel
=(
2
,
2
),
stride
=(
2
,
2
),
padding
=
"valid"
)
->
FullyConnected
(
units
=
500
)
->
Relu
()
->
FullyConnected
(
units
=
classes
)
->
Softmax
()
->
predictions
}
}
src/test/resources/models/lenet/MnistClassifier.emadl
0 → 100644
View file @
f81f8ee5
package
lenet
;
import
Network
;
import
CalculateClass
;
component
MnistClassifier
{
ports
in
Z
(
0
:
255
)^{
1
,
28
,
28
}
image
,
out
Z
(
0
:
9
)
classIndex
,
out
Q
probability
;
instance
LeNetNetwork
<
10
>
net
;
instance
ArgMax
<
10
>
calculateClass
;
connect
image
->
net
.
image
;
connect
net
.
predictions
->
calculateClass
.
inputVector
;
connect
calculateClass
.
maxIndex
->
classIndex
;
connect
calculateClass
.
maxValue
->
probability
;
}
\ 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