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
generators
EMADL2CPP
Commits
fb5b86ba
Commit
fb5b86ba
authored
Dec 18, 2019
by
Christian Fuß
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adjusted tests
parent
7c896581
Pipeline
#220735
passed with stages
in 7 minutes and 13 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
src/test/resources/models/showAttendTell/Show_attend_tell.emadl
...st/resources/models/showAttendTell/Show_attend_tell.emadl
+0
-1
src/test/resources/models/showAttendTell/Show_attend_tell_images_as_input.emadl
...els/showAttendTell/Show_attend_tell_images_as_input.emadl
+2
-3
src/test/resources/target_code/gluon/CNNSupervisedTrainer_mnist_mnistClassifier_net.py
...e/gluon/CNNSupervisedTrainer_mnist_mnistClassifier_net.py
+3
-1
No files found.
src/test/resources/models/showAttendTell/Show_attend_tell.emadl
View file @
fb5b86ba
...
...
@@ -46,7 +46,6 @@ component Show_attend_tell{
FullyConnected
(
units
=
37758
)
->
Tanh
()
->
Dropout
(
p
=
0.25
)
->
Softmax
()
->
ArgMax
()
->
target
[
t
]
};
...
...
src/test/resources/models/showAttendTell/Show_attend_tell_images_as_input.emadl
View file @
fb5b86ba
...
...
@@ -17,8 +17,8 @@ component Show_attend_tell_images_as_input{
0
->
target
[
0
];
images
->
Convolution
(
kernel
=(
7
,
7
),
channels
=
128
,
stride
=(
7
,
7
),
padding
=
"
valid
"
)
->
Convolution
(
kernel
=(
4
,
4
),
channels
=
128
,
stride
=(
4
,
4
),
padding
=
"
valid
"
)
->
Convolution
(
kernel
=(
7
,
7
),
channels
=
128
,
stride
=(
7
,
7
),
padding
=
"
same
"
)
->
Convolution
(
kernel
=(
4
,
4
),
channels
=
128
,
stride
=(
4
,
4
),
padding
=
"
same
"
)
->
Reshape
(
shape
=(
64
,
128
))
->
features
;
...
...
@@ -52,7 +52,6 @@ component Show_attend_tell_images_as_input{
FullyConnected
(
units
=
37758
)
->
Tanh
()
->
Dropout
(
p
=
0.25
)
->
Softmax
()
->
ArgMax
()
->
target
[
t
]
};
...
...
src/test/resources/target_code/gluon/CNNSupervisedTrainer_mnist_mnistClassifier_net.py
View file @
fb5b86ba
...
...
@@ -54,7 +54,7 @@ class SoftmaxCrossEntropyLossIgnoreIndices(gluon.loss.Loss):
loss
=
-
(
pred
*
label
).
sum
(
axis
=
self
.
_axis
,
keepdims
=
True
)
# ignore some indices for loss, e.g. <pad> tokens in NLP applications
for
i
in
self
.
_ignore_indices
:
loss
=
loss
*
mx
.
nd
.
logical_not
(
mx
.
nd
.
equal
(
mx
.
nd
.
argmax
(
pred
,
axis
=
1
),
mx
.
nd
.
ones_like
(
mx
.
nd
.
argmax
(
pred
,
axis
=
1
))
*
i
))
loss
=
loss
*
mx
.
nd
.
logical_not
(
mx
.
nd
.
equal
(
mx
.
nd
.
argmax
(
pred
,
axis
=
1
),
mx
.
nd
.
ones_like
(
mx
.
nd
.
argmax
(
pred
,
axis
=
1
))
*
i
)
*
mx
.
nd
.
equal
(
mx
.
nd
.
argmax
(
pred
,
axis
=
1
),
label
)
)
return
loss
.
mean
(
axis
=
self
.
_batch_axis
,
exclude
=
True
)
@
mx
.
metric
.
register
...
...
@@ -278,6 +278,7 @@ class CNNSupervisedTrainer_mnist_mnistClassifier_net:
tic
=
None
for
epoch
in
range
(
begin_epoch
,
begin_epoch
+
num_epoch
):
train_iter
.
reset
()
for
batch_i
,
batch
in
enumerate
(
train_iter
):
with
autograd
.
record
():
...
...
@@ -320,6 +321,7 @@ class CNNSupervisedTrainer_mnist_mnistClassifier_net:
tic
=
None
train_test_iter
.
reset
()
metric
=
mx
.
metric
.
create
(
eval_metric
,
**
eval_metric_params
)
for
batch_i
,
batch
in
enumerate
(
train_test_iter
):
...
...
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