Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hybrid-ads
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Joshua Moerman
hybrid-ads
Commits
e392f656
Commit
e392f656
authored
9 years ago
by
Joshua Moerman
Browse files
Options
Downloads
Patches
Plain Diff
Adds some options to the learning graph tool
parent
0e2547be
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/learning_graph.cpp
+21
-7
21 additions, 7 deletions
src/learning_graph.cpp
with
21 additions
and
7 deletions
src/learning_graph.cpp
+
21
−
7
View file @
e392f656
...
...
@@ -17,9 +17,12 @@ static const char USAGE[] =
R"(Generate a statistical learning graph from multiple runs
Usage:
learning_graph <file> ...
learning_graph
[options]
<file> ...
Options:
--testing_only Only count the figures for testing
--learning_only Only count the figures for learning
--accumulate Accumulates the data
-h, --help Show this screen
--version Show version
)"
;
...
...
@@ -73,12 +76,24 @@ void print_quantiles(C const & container, S && selector, ostream & out) {
out
<<
selector
(
sorted_container
.
back
());
}
auto
all
(
datapoint
const
&
p
)
{
return
p
.
learning_queries
+
p
.
learning_inputs
+
p
.
testing_queries
+
p
.
testing_inputs
;
}
auto
testing
(
datapoint
const
&
p
)
{
return
p
.
testing_queries
+
p
.
testing_inputs
;
}
auto
learning
(
datapoint
const
&
p
)
{
return
p
.
learning_queries
+
p
.
learning_inputs
;
}
int
main
(
int
argc
,
char
*
argv
[])
{
const
auto
args
=
docopt
::
docopt
(
USAGE
,
{
argv
+
1
,
argv
+
argc
},
true
,
__DATE__
__TIME__
);
const
auto
field
=
args
.
at
(
"--testing_only"
).
asBool
()
?
&
testing
:
args
.
at
(
"--learning_only"
).
asBool
()
?
&
learning
:
&
all
;
vector
<
future
<
dataset
>>
dataset_futures
;
for
(
auto
const
&
filename
:
args
.
at
(
"<file>"
).
asStringList
())
{
dataset_futures
.
emplace_back
(
async
([
filename
]
{
dataset_futures
.
emplace_back
(
async
([
filename
,
&
args
]
{
fstream
file
(
filename
);
if
(
!
file
)
throw
runtime_error
(
"Could not open file "
+
filename
);
...
...
@@ -89,7 +104,8 @@ int main(int argc, char * argv[]) {
s
.
push_back
(
p
);
}
accumulate_dataset
(
s
);
if
(
args
.
at
(
"--accumulate"
).
asBool
())
accumulate_dataset
(
s
);
return
s
;
}));
...
...
@@ -143,10 +159,8 @@ int main(int argc, char * argv[]) {
// if we're spot on, update current
if
(
it
.
next
->
states
==
state
)
it
.
current
=
it
.
next
;
const
auto
v2
=
it
.
next
->
learning_queries
+
it
.
next
->
learning_inputs
+
it
.
next
->
testing_queries
+
it
.
next
->
testing_inputs
;
const
auto
v1
=
it
.
current
->
learning_queries
+
it
.
current
->
learning_inputs
+
it
.
current
->
testing_queries
+
it
.
current
->
testing_inputs
;
const
auto
v2
=
field
(
*
it
.
next
);
const
auto
v1
=
field
(
*
it
.
current
);
const
auto
ratio
=
it
.
next
->
states
==
state
?
1.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