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
ift
NIFTy
Commits
52213268
Commit
52213268
authored
May 27, 2020
by
Reimar Leike
Browse files
Shorter code
parent
a6a139e9
Pipeline
#75635
passed with stages
in 13 minutes and 42 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
nifty6/minimization/metric_gaussian_kl.py
View file @
52213268
...
...
@@ -243,12 +243,7 @@ class MetricGaussianKL(Energy):
rank_lo_hi
=
[
_shareRange
(
self
.
_n_samples
,
ntask
,
i
)
for
i
in
range
(
ntask
)]
lo
=
rank_lo_hi
[
rank
][
0
]
hi
=
rank_lo_hi
[
rank
][
1
]
vals
=
[]
for
i
in
range
(
self
.
_n_samples
):
if
(
i
>=
lo
)
and
(
i
<
hi
):
vals
+=
[
obj
[
i
-
lo
]]
else
:
vals
+=
[
None
]
vals
=
[
None
]
*
lo
+
obj
+
[
None
]
*
(
self
.
_n_samples
-
hi
)
who
=
np
.
zeros
(
len
(
vals
),
dtype
=
np
.
int32
)
for
t
,
(
l
,
h
)
in
enumerate
(
rank_lo_hi
):
who
[
l
:
h
]
=
t
...
...
Write
Preview
Markdown
is supported
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