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
e26191bd
Commit
e26191bd
authored
Oct 17, 2016
by
Sebastian Heimann
Browse files
fix incorrect determination of total number of supergroups
parent
e8000b38
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/cmt.py
View file @
e26191bd
...
...
@@ -231,7 +231,6 @@ class CMTProblem(core.Problem):
def
inter_group_weights2
(
self
,
ns
):
group
,
ngroups
=
self
.
get_group_mask
()
ws
=
num
.
zeros
(
ns
.
shape
)
for
igroup
in
xrange
(
ngroups
):
mask
=
group
==
igroup
...
...
@@ -268,7 +267,6 @@ class CMTProblem(core.Problem):
def
global_misfits
(
self
,
misfits
):
ws
=
self
.
get_target_weights
()[
num
.
newaxis
,
:]
*
\
self
.
inter_group_weights2
(
misfits
[:,
:,
1
])
gms
=
num
.
sqrt
(
num
.
nansum
((
ws
*
misfits
[:,
:,
0
])
**
2
,
axis
=
1
)
/
num
.
nansum
((
ws
*
misfits
[:,
:,
1
])
**
2
,
axis
=
1
))
return
gms
...
...
src/core.py
View file @
e26191bd
...
...
@@ -225,7 +225,6 @@ class Problem(Object):
groups
[
itarget
]
=
ngroups
-
1
ngroups
+=
1
return
groups
,
ngroups
def
get_group_mask
(
self
):
...
...
@@ -1132,7 +1131,6 @@ def analyse(problem, niter=1000, show_progress=False):
weights
=
1.0
/
mean_ms
for
igroup
in
xrange
(
ngroups
):
print
weights
[
groups
==
igroup
]
weights
[
groups
==
igroup
]
/=
(
num
.
nansum
(
weights
[
groups
==
igroup
])
/
num
.
nansum
(
num
.
isfinite
(
weights
[
groups
==
igroup
])))
...
...
@@ -1565,7 +1563,6 @@ def check(config, event_names=None):
results_list
=
[]
for
i
in
xrange
(
10
):
x
=
problem
.
random_uniform
(
xbounds
)
print
x
ms
,
ns
,
results
=
problem
.
evaluate
(
x
,
result_mode
=
'full'
)
results_list
.
append
(
results
)
...
...
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