Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tarot
tarot
Commits
49654891
Commit
49654891
authored
Dec 04, 2019
by
Vivien Kraus
Browse files
Use a C locale to print the model
This lets me use commas as separators.
parent
43109655
Changes
1
Show whitespace changes
Inline
Side-by-side
src/tarot-app/tarot_perceptron_bootstrap.c
View file @
49654891
...
@@ -465,11 +465,12 @@ self_learn (TarotPerceptron * perceptron)
...
@@ -465,11 +465,12 @@ self_learn (TarotPerceptron * perceptron)
double
update
=
tarot_perceptron_learn_game
(
perceptron
,
game
);
double
update
=
tarot_perceptron_learn_game
(
perceptron
,
game
);
char
*
xml
=
tarot_game_save_to_xml_alloc
(
game
);
char
*
xml
=
tarot_game_save_to_xml_alloc
(
game
);
tarot_perceptron_save_alloc
(
perceptron
,
&
n
,
&
weights
);
tarot_perceptron_save_alloc
(
perceptron
,
&
n
,
&
weights
);
setlocale
(
LC_NUMERIC
,
"C"
);
for
(
w
=
0
;
w
<
n
;
w
++
)
for
(
w
=
0
;
w
<
n
;
w
++
)
{
{
if
(
w
!=
0
)
if
(
w
!=
0
)
{
{
printf
(
"
\t
"
);
printf
(
"
,
"
);
}
}
printf
(
"%f"
,
weights
[
w
]);
printf
(
"%f"
,
weights
[
w
]);
if
(
weights
[
w
]
>
max_weight
||
-
weights
[
w
]
>
max_weight
)
if
(
weights
[
w
]
>
max_weight
||
-
weights
[
w
]
>
max_weight
)
...
@@ -485,6 +486,7 @@ self_learn (TarotPerceptron * perceptron)
...
@@ -485,6 +486,7 @@ self_learn (TarotPerceptron * perceptron)
}
}
}
}
printf
(
"
\n
"
);
printf
(
"
\n
"
);
setlocale
(
LC_NUMERIC
,
""
);
fprintf
(
stderr
,
"%g
\t
%g
\t
%g
\t
%g
\n
"
,
current_exploration
,
update
,
fprintf
(
stderr
,
"%g
\t
%g
\t
%g
\t
%g
\n
"
,
current_exploration
,
update
,
metric
,
max_weight
);
metric
,
max_weight
);
free
(
weights
);
free
(
weights
);
...
...
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