Skip to content
GitLab
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
5ed64170
Commit
5ed64170
authored
Jun 27, 2018
by
Philipp Arras
Browse files
Fixups
parent
6c1ced81
Changes
3
Hide whitespace changes
Inline
Side-by-side
test/test_energies/test_map.py
View file @
5ed64170
...
@@ -21,7 +21,6 @@ import nifty5 as ift
...
@@ -21,7 +21,6 @@ import nifty5 as ift
import
numpy
as
np
import
numpy
as
np
from
itertools
import
product
from
itertools
import
product
from
test.common
import
expand
from
test.common
import
expand
from
numpy.testing
import
assert_allclose
def
_flat_PS
(
k
):
def
_flat_PS
(
k
):
...
@@ -66,8 +65,7 @@ class Energy_Tests(unittest.TestCase):
...
@@ -66,8 +65,7 @@ class Energy_Tests(unittest.TestCase):
@
expand
(
product
([
ift
.
GLSpace
(
15
),
@
expand
(
product
([
ift
.
GLSpace
(
15
),
ift
.
RGSpace
(
64
,
distances
=
.
789
),
ift
.
RGSpace
(
64
,
distances
=
.
789
),
ift
.
RGSpace
([
32
,
32
],
distances
=
.
789
)],
ift
.
RGSpace
([
32
,
32
],
distances
=
.
789
)],
[
ift
.
library
.
Tanh
,
ift
.
library
.
Exponential
,
[
ift
.
Tanh
,
ift
.
Exponential
,
ift
.
Linear
],
ift
.
library
.
Linear
],
[
4
,
78
,
23
]))
[
4
,
78
,
23
]))
def
testNonlinearMap
(
self
,
space
,
nonlinearity
,
seed
):
def
testNonlinearMap
(
self
,
space
,
nonlinearity
,
seed
):
np
.
random
.
seed
(
seed
)
np
.
random
.
seed
(
seed
)
...
@@ -93,7 +91,7 @@ class Energy_Tests(unittest.TestCase):
...
@@ -93,7 +91,7 @@ class Energy_Tests(unittest.TestCase):
energy
=
ift
.
library
.
NonlinearWienerFilterEnergy
(
energy
=
ift
.
library
.
NonlinearWienerFilterEnergy
(
position
=
xi0
,
d
=
d
,
Instrument
=
R
,
nonlinearity
=
f
,
ht
=
ht
,
power
=
A
,
position
=
xi0
,
d
=
d
,
Instrument
=
R
,
nonlinearity
=
f
,
ht
=
ht
,
power
=
A
,
N
=
N
,
S
=
S
)
N
=
N
,
S
=
S
)
if
isinstance
(
nonlinearity
,
ift
.
library
.
Linear
):
if
isinstance
(
nonlinearity
,
ift
.
Linear
):
ift
.
extra
.
check_value_gradient_curvature_consistency
(
ift
.
extra
.
check_value_gradient_curvature_consistency
(
energy
,
ntries
=
10
)
energy
,
ntries
=
10
)
else
:
else
:
...
...
test/test_energies/test_noise.py
View file @
5ed64170
...
@@ -31,7 +31,7 @@ def _flat_PS(k):
...
@@ -31,7 +31,7 @@ def _flat_PS(k):
class
Noise_Energy_Tests
(
unittest
.
TestCase
):
class
Noise_Energy_Tests
(
unittest
.
TestCase
):
@
expand
(
product
([
ift
.
RGSpace
(
64
,
distances
=
.
789
),
@
expand
(
product
([
ift
.
RGSpace
(
64
,
distances
=
.
789
),
ift
.
RGSpace
([
32
,
32
],
distances
=
.
789
)],
ift
.
RGSpace
([
32
,
32
],
distances
=
.
789
)],
[
ift
.
library
.
Exponential
,
ift
.
library
.
Linear
],
[
ift
.
Exponential
,
ift
.
Linear
],
[
23
,
131
,
32
]))
[
23
,
131
,
32
]))
def
testNoise
(
self
,
space
,
nonlinearity
,
seed
):
def
testNoise
(
self
,
space
,
nonlinearity
,
seed
):
np
.
random
.
seed
(
seed
)
np
.
random
.
seed
(
seed
)
...
...
test/test_energies/test_power.py
View file @
5ed64170
...
@@ -21,7 +21,6 @@ import nifty5 as ift
...
@@ -21,7 +21,6 @@ import nifty5 as ift
import
numpy
as
np
import
numpy
as
np
from
itertools
import
product
from
itertools
import
product
from
test.common
import
expand
from
test.common
import
expand
from
numpy.testing
import
assert_allclose
def
_flat_PS
(
k
):
def
_flat_PS
(
k
):
...
@@ -31,7 +30,7 @@ def _flat_PS(k):
...
@@ -31,7 +30,7 @@ def _flat_PS(k):
class
Energy_Tests
(
unittest
.
TestCase
):
class
Energy_Tests
(
unittest
.
TestCase
):
@
expand
(
product
([
ift
.
RGSpace
(
64
,
distances
=
.
789
),
@
expand
(
product
([
ift
.
RGSpace
(
64
,
distances
=
.
789
),
ift
.
RGSpace
([
32
,
32
],
distances
=
.
789
)],
ift
.
RGSpace
([
32
,
32
],
distances
=
.
789
)],
[
ift
.
library
.
Exponential
,
ift
.
library
.
Linear
],
[
ift
.
Exponential
,
ift
.
Linear
],
[
132
,
42
,
3
]))
[
132
,
42
,
3
]))
def
testNonlinearPower
(
self
,
space
,
nonlinearity
,
seed
):
def
testNonlinearPower
(
self
,
space
,
nonlinearity
,
seed
):
np
.
random
.
seed
(
seed
)
np
.
random
.
seed
(
seed
)
...
...
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