Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
macaon2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexis Nasr
macaon2
Commits
35341ccf
Commit
35341ccf
authored
Apr 11, 2018
by
Franck Dary
Browse files
Options
Downloads
Patches
Plain Diff
Added a way to ensure neural network shape is not changing during decoding
parent
4ccc8d2f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
maca_trans_parser/src/maca_tm_train.c
+0
-1
0 additions, 1 deletion
maca_trans_parser/src/maca_tm_train.c
mlp/include/mlp.h
+0
-1
0 additions, 1 deletion
mlp/include/mlp.h
mlp/src/mlp.cpp
+7
-9
7 additions, 9 deletions
mlp/src/mlp.cpp
with
7 additions
and
11 deletions
maca_trans_parser/src/maca_tm_train.c
+
0
−
1
View file @
35341ccf
...
...
@@ -211,7 +211,6 @@ void train_nn(context * ctx)
classifier_print_desc_file
(
classif
->
filename
,
classif
);
classifier_delete_mlp
(
classif
);
//classifier_init_mlp(classif, new Mlp(classif->mlp_model_filename, classif->mlp_struct_filename, ctx->maca_data_path));
}
}
...
...
This diff is collapsed.
Click to expand it.
mlp/include/mlp.h
+
0
−
1
View file @
35341ccf
...
...
@@ -69,7 +69,6 @@ class Mlp{
Mlp
(
std
::
vector
<
Layer
>
layers
,
unsigned
int
batch_size
=
0
);
Mlp
(
char
*
model_filename
,
char
*
struct_filename
,
char
*
absolute_path
);
unsigned
int
predict
(
int
*
features
,
int
nb_features
);
unsigned
int
predict
(
float
*
features
,
int
nb_features
);
void
train
(
int
nb_iter_max
,
Fann_file
&
fann_train
,
Fann_file
&
fann_dev
,
std
::
function
<
void
(
std
::
vector
<
std
::
vector
<
float
>
>&
,
...
...
This diff is collapsed.
Click to expand it.
mlp/src/mlp.cpp
+
7
−
9
View file @
35341ccf
...
...
@@ -162,21 +162,19 @@ unsigned int Mlp::predict(dynet::Expression x){
return
argmax
;
}
unsigned
int
Mlp
::
predict
(
in
t
*
features
,
int
nb_features
){
unsigned
int
Mlp
::
predict
(
floa
t
*
features
,
int
nb_features
){
computation_graph
.
clear
();
unsigned
int
nb_inputs
=
layers
[
0
].
input_dim
;
std
::
vector
<
float
>
features_vector
(
features
,
features
+
nb_features
);
dynet
::
Expression
x
=
input
(
computation_graph
,
{
nb_inputs
},
features_vector
);
return
predict
(
x
);
if
(
features_vector
.
size
()
!=
nb_inputs
)
{
fprintf
(
stderr
,
"ERROR (%s) : example size=%lu nb_inputs=%u mismatch
\n
"
,
__func__
,
features_vector
.
size
(),
nb_inputs
);
exit
(
1
);
}
unsigned
int
Mlp
::
predict
(
float
*
features
,
int
nb_features
){
computation_graph
.
clear
();
unsigned
int
nb_inputs
=
layers
[
0
].
input_dim
;
std
::
vector
<
float
>
features_vector
(
features
,
features
+
nb_features
);
dynet
::
Expression
x
=
input
(
computation_graph
,
{
nb_inputs
},
features_vector
);
return
predict
(
x
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment