Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Malte R
graph-tool
Commits
c143f91d
Commit
c143f91d
authored
Apr 09, 2016
by
Tiago Peixoto
Browse files
MulticanonicalState: improve flatness criterium
parent
6e6c375c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/graph_tool/inference/mcmc.py
View file @
c143f91d
...
...
@@ -468,7 +468,13 @@ class MulticanonicalState(object):
h
=
self
.
_hist
.
a
if
h
.
sum
()
==
0
:
return
0
h
=
array
(
h
[
h
>
0
],
dtype
=
"float"
)
idx
=
h
>
0
Ss
=
self
.
get_range
()
h
=
array
(
h
[
numpy
.
logical_and
(
Ss
>=
Ss
[
idx
].
min
(),
Ss
<=
Ss
[
idx
].
max
())],
dtype
=
"float"
)
if
len
(
h
)
==
1
:
h
=
array
([
0
]
+
list
(
h
))
if
not
use_ent
:
h_mean
=
h
.
mean
()
return
h
.
min
()
/
h_mean
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment