Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
old_macaon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Franck Dary
old_macaon
Commits
41db42dc
Commit
41db42dc
authored
6 years ago
by
Franck Dary
Browse files
Options
Downloads
Patches
Plain Diff
Corrected a bug where multiple train of the same exp could be launched with different parameters
parent
4876271c
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
maca_common/include/ProgramParameters.hpp
+1
-0
1 addition, 0 deletions
maca_common/include/ProgramParameters.hpp
maca_common/src/ProgramParameters.cpp
+1
-0
1 addition, 0 deletions
maca_common/src/ProgramParameters.cpp
trainer/src/macaon_train.cpp
+19
-1
19 additions, 1 deletion
trainer/src/macaon_train.cpp
with
21 additions
and
1 deletion
maca_common/include/ProgramParameters.hpp
+
1
−
0
View file @
41db42dc
...
@@ -15,6 +15,7 @@ struct ProgramParameters
...
@@ -15,6 +15,7 @@ struct ProgramParameters
static
std
::
string
baseExpName
;
static
std
::
string
baseExpName
;
static
std
::
string
langPath
;
static
std
::
string
langPath
;
static
std
::
string
templatePath
;
static
std
::
string
templatePath
;
static
std
::
string
newTemplatePath
;
static
std
::
string
templateName
;
static
std
::
string
templateName
;
static
std
::
string
tmFilename
;
static
std
::
string
tmFilename
;
static
std
::
string
tmName
;
static
std
::
string
tmName
;
...
...
This diff is collapsed.
Click to expand it.
maca_common/src/ProgramParameters.cpp
+
1
−
0
View file @
41db42dc
...
@@ -10,6 +10,7 @@ std::string ProgramParameters::baseExpName;
...
@@ -10,6 +10,7 @@ std::string ProgramParameters::baseExpName;
std
::
string
ProgramParameters
::
expPath
;
std
::
string
ProgramParameters
::
expPath
;
std
::
string
ProgramParameters
::
langPath
;
std
::
string
ProgramParameters
::
langPath
;
std
::
string
ProgramParameters
::
templatePath
;
std
::
string
ProgramParameters
::
templatePath
;
std
::
string
ProgramParameters
::
newTemplatePath
;
std
::
string
ProgramParameters
::
templateName
;
std
::
string
ProgramParameters
::
templateName
;
std
::
string
ProgramParameters
::
tmFilename
;
std
::
string
ProgramParameters
::
tmFilename
;
std
::
string
ProgramParameters
::
tmName
;
std
::
string
ProgramParameters
::
tmName
;
...
...
This diff is collapsed.
Click to expand it.
trainer/src/macaon_train.cpp
+
19
−
1
View file @
41db42dc
...
@@ -135,6 +135,7 @@ void updatePaths()
...
@@ -135,6 +135,7 @@ void updatePaths()
ProgramParameters
::
mcdFilename
=
ProgramParameters
::
expPath
+
ProgramParameters
::
mcdName
;
ProgramParameters
::
mcdFilename
=
ProgramParameters
::
expPath
+
ProgramParameters
::
mcdName
;
ProgramParameters
::
trainFilename
=
ProgramParameters
::
expPath
+
ProgramParameters
::
trainName
;
ProgramParameters
::
trainFilename
=
ProgramParameters
::
expPath
+
ProgramParameters
::
trainName
;
ProgramParameters
::
devFilename
=
ProgramParameters
::
expPath
+
ProgramParameters
::
devName
;
ProgramParameters
::
devFilename
=
ProgramParameters
::
expPath
+
ProgramParameters
::
devName
;
ProgramParameters
::
newTemplatePath
=
ProgramParameters
::
langPath
+
"bin/"
+
ProgramParameters
::
baseExpName
+
slash
;
}
}
/// @brief Create the folder containing the current experiment from the template frolder
/// @brief Create the folder containing the current experiment from the template frolder
...
@@ -163,7 +164,7 @@ macaon_decode --lang $LANG --tm machine.tm --bd test.bd -I $INPUT --mcd $MCD --e
...
@@ -163,7 +164,7 @@ macaon_decode --lang $LANG --tm machine.tm --bd test.bd -I $INPUT --mcd $MCD --e
if
(
system
((
"rm -r "
+
ProgramParameters
::
expPath
+
" 2> /dev/null"
).
c_str
())){}
if
(
system
((
"rm -r "
+
ProgramParameters
::
expPath
+
" 2> /dev/null"
).
c_str
())){}
if
(
system
((
"mkdir "
+
ProgramParameters
::
expPath
).
c_str
())){}
if
(
system
((
"mkdir "
+
ProgramParameters
::
expPath
).
c_str
())){}
if
(
system
((
"cp -r "
+
ProgramParameters
::
t
emplatePath
+
"* "
+
ProgramParameters
::
expPath
+
"."
).
c_str
())){}
if
(
system
((
"cp -r "
+
ProgramParameters
::
newT
emplatePath
+
"* "
+
ProgramParameters
::
expPath
+
"."
).
c_str
())){}
if
(
system
((
"echo
\'
"
+
decode
+
"
\'
> "
+
ProgramParameters
::
expPath
+
"decode.sh"
).
c_str
())){}
if
(
system
((
"echo
\'
"
+
decode
+
"
\'
> "
+
ProgramParameters
::
expPath
+
"decode.sh"
).
c_str
())){}
if
(
system
((
"chmod +x "
+
ProgramParameters
::
expPath
+
"decode.sh"
).
c_str
())){}
if
(
system
((
"chmod +x "
+
ProgramParameters
::
expPath
+
"decode.sh"
).
c_str
())){}
if
(
system
((
"ln -f -s "
+
ProgramParameters
::
expPath
+
"decode.sh "
+
ProgramParameters
::
langPath
+
"bin/maca_tm_"
+
ProgramParameters
::
expName
).
c_str
())){}
if
(
system
((
"ln -f -s "
+
ProgramParameters
::
expPath
+
"decode.sh "
+
ProgramParameters
::
langPath
+
"bin/maca_tm_"
+
ProgramParameters
::
expName
).
c_str
())){}
...
@@ -198,6 +199,18 @@ void launchTraining()
...
@@ -198,6 +199,18 @@ void launchTraining()
trainer
->
train
();
trainer
->
train
();
}
}
void
createTemplatePath
()
{
if
(
system
((
"rm -r "
+
ProgramParameters
::
newTemplatePath
+
" 2> /dev/null"
).
c_str
())){}
if
(
system
((
"mkdir "
+
ProgramParameters
::
newTemplatePath
).
c_str
())){}
if
(
system
((
"cp -r "
+
ProgramParameters
::
templatePath
+
"* "
+
ProgramParameters
::
newTemplatePath
+
"."
).
c_str
())){}
}
void
removeTemplatePath
()
{
if
(
system
((
"rm -r "
+
ProgramParameters
::
newTemplatePath
+
" 2> /dev/null"
).
c_str
())){}
}
/// @brief Train a TransitionMachine to predict and add information to a structured input file, by using annotated examples.
/// @brief Train a TransitionMachine to predict and add information to a structured input file, by using annotated examples.
///
///
/// @param argc The number of arguments given to this program.
/// @param argc The number of arguments given to this program.
...
@@ -238,6 +251,8 @@ int main(int argc, char * argv[])
...
@@ -238,6 +251,8 @@ int main(int argc, char * argv[])
if
(
ProgramParameters
::
nbTrain
)
if
(
ProgramParameters
::
nbTrain
)
{
{
updatePaths
();
createTemplatePath
();
for
(
int
i
=
0
;
i
<
ProgramParameters
::
nbTrain
;
i
++
)
for
(
int
i
=
0
;
i
<
ProgramParameters
::
nbTrain
;
i
++
)
{
{
fprintf
(
stderr
,
"Training number %d / %d :
\n
"
,
i
+
1
,
ProgramParameters
::
nbTrain
);
fprintf
(
stderr
,
"Training number %d / %d :
\n
"
,
i
+
1
,
ProgramParameters
::
nbTrain
);
...
@@ -247,13 +262,16 @@ int main(int argc, char * argv[])
...
@@ -247,13 +262,16 @@ int main(int argc, char * argv[])
Dict
::
deleteDicts
();
Dict
::
deleteDicts
();
launchTraining
();
launchTraining
();
}
}
removeTemplatePath
();
}
}
else
else
{
{
createTemplatePath
();
updatePaths
();
updatePaths
();
createExpPath
();
createExpPath
();
Dict
::
deleteDicts
();
Dict
::
deleteDicts
();
launchTraining
();
launchTraining
();
removeTemplatePath
();
}
}
return
0
;
return
0
;
...
...
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