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
Sebastian Heimann
grond
Commits
0f2d334c
Commit
0f2d334c
authored
Oct 13, 2016
by
Sebastian Heimann
Browse files
harvest: added mode weed=3 to harvest from global chain only
parent
d38c124b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/core.py
View file @
0f2d334c
...
...
@@ -1510,29 +1510,30 @@ def harvest(rundir, problem=None, nbest=10, force=False, weed=0):
ibests_list
=
[]
ibests
=
[]
for
ibootstrap
in
xrange
(
problem
.
nbootstrap
):
bms
=
problem
.
bootstrap_misfits
(
misfits
,
ibootstrap
)
isort
=
num
.
argsort
(
bms
)
ibests_list
.
append
(
isort
[:
nbest
])
ibests
.
append
(
isort
[
0
])
gms
=
problem
.
global_misfits
(
misfits
)
isort
=
num
.
argsort
(
gms
)
ibests_list
.
append
(
isort
[:
nbest
])
if
weed
:
mean_gm_best
=
num
.
median
(
gms
[
ibests
])
std_gm_best
=
num
.
std
(
gms
[
ibests
])
ibad
=
set
()
for
ibootstrap
,
ibest
in
enumerate
(
ibests
):
if
gms
[
ibest
]
>
mean_gm_best
+
std_gm_best
:
ibad
.
add
(
ibootstrap
)
ibests_list
=
[
ibests_
for
(
ibootstrap
,
ibests_
)
in
enumerate
(
ibests_list
)
if
ibootstrap
not
in
ibad
]
if
weed
!=
3
:
for
ibootstrap
in
xrange
(
problem
.
nbootstrap
):
bms
=
problem
.
bootstrap_misfits
(
misfits
,
ibootstrap
)
isort
=
num
.
argsort
(
bms
)
ibests_list
.
append
(
isort
[:
nbest
])
ibests
.
append
(
isort
[
0
])
if
weed
:
mean_gm_best
=
num
.
median
(
gms
[
ibests
])
std_gm_best
=
num
.
std
(
gms
[
ibests
])
ibad
=
set
()
for
ibootstrap
,
ibest
in
enumerate
(
ibests
):
if
gms
[
ibest
]
>
mean_gm_best
+
std_gm_best
:
ibad
.
add
(
ibootstrap
)
ibests_list
=
[
ibests_
for
(
ibootstrap
,
ibests_
)
in
enumerate
(
ibests_list
)
if
ibootstrap
not
in
ibad
]
ibests
=
num
.
concatenate
(
ibests_list
)
...
...
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