Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Franck Dary
macaon
Commits
567e4969
Commit
567e4969
authored
Jun 29, 2020
by
Franck Dary
Browse files
Added seed program argument
parent
dd942e18
Changes
1
Hide whitespace changes
Inline
Side-by-side
trainer/src/MacaonTrain.cpp
View file @
567e4969
...
...
@@ -41,6 +41,8 @@ po::options_description MacaonTrain::getOptionsDescription()
"Description of what should happen during training"
)
(
"loss"
,
po
::
value
<
std
::
string
>
()
->
default_value
(
"CrossEntropy"
),
"Loss function to use during training : CrossEntropy | bce | mse | hinge"
)
(
"seed"
,
po
::
value
<
int
>
()
->
default_value
(
100
),
"Number of examples per batch"
)
(
"help,h"
,
"Produce this help message"
);
desc
.
add
(
req
).
add
(
opt
);
...
...
@@ -131,6 +133,10 @@ int MacaonTrain::main()
auto
trainStrategyStr
=
variables
[
"trainStrategy"
].
as
<
std
::
string
>
();
auto
lossFunction
=
variables
[
"loss"
].
as
<
std
::
string
>
();
auto
explorationThreshold
=
variables
[
"explorationThreshold"
].
as
<
float
>
();
auto
seed
=
variables
[
"seed"
].
as
<
int
>
();
std
::
srand
(
seed
);
torch
::
manual_seed
(
seed
);
auto
trainStrategy
=
parseTrainStrategy
(
trainStrategyStr
);
...
...
Write
Preview
Supports
Markdown
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