Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NIFTy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ift
NIFTy
Commits
03bd7f7a
Commit
03bd7f7a
authored
5 years ago
by
Philipp Arras
Browse files
Options
Downloads
Patches
Plain Diff
nifty6 -> nifty7
parent
744ce661
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!535
Nifty 7
,
!533
Nifty6to7
Pipeline
#76391
passed
5 years ago
Stage: build_docker
Stage: test
Stage: demo_runs
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/operators/normal_operators.py
+2
-2
2 additions, 2 deletions
src/operators/normal_operators.py
src/utilities.py
+1
-1
1 addition, 1 deletion
src/utilities.py
test/test_operators/test_normal_operators.py
+1
-1
1 addition, 1 deletion
test/test_operators/test_normal_operators.py
with
4 additions
and
4 deletions
src/operators/normal_operators.py
+
2
−
2
View file @
03bd7f7a
...
...
@@ -41,7 +41,7 @@ def NormalTransform(mean, sigma, key, N_copies=0):
N_copies : integer
If == 0, target will be a scalar field.
If >= 1, target will be an
:class:`~nifty
6
.unstructured_domain.UnstructuredDomain`.
:class:`~nifty
7
.unstructured_domain.UnstructuredDomain`.
"""
if
N_copies
==
0
:
domain
=
DomainTuple
.
scalar_domain
()
...
...
@@ -71,7 +71,7 @@ def LognormalTransform(mean, sigma, key, N_copies):
N_copies : integer
If == 0, target will be a scalar field.
If >= 1, target will be an
:class:`~nifty
6
.unstructured_domain.UnstructuredDomain`.
:class:`~nifty
7
.unstructured_domain.UnstructuredDomain`.
"""
logmean
,
logsigma
=
lognormal_moments
(
mean
,
sigma
,
N_copies
)
return
NormalTransform
(
logmean
,
logsigma
,
key
,
N_copies
).
ptw
(
"
exp
"
)
This diff is collapsed.
Click to expand it.
src/utilities.py
+
1
−
1
View file @
03bd7f7a
...
...
@@ -395,7 +395,7 @@ def lognormal_moments(mean, sigma, N=0):
"""
Calculates the parameters for a normal distribution `n(x)`
such that `exp(n)(x)` has the mean and standard deviation given.
Used in :func:`~nifty
6
.normal_operators.LognormalTransform`.
"""
Used in :func:`~nifty
7
.normal_operators.LognormalTransform`.
"""
mean
,
sigma
=
(
value_reshaper
(
param
,
N
)
for
param
in
(
mean
,
sigma
))
if
not
np
.
all
(
mean
>
0
):
raise
ValueError
(
"
mean must be greater 0; got {!r}
"
.
format
(
mean
))
...
...
This diff is collapsed.
Click to expand it.
test/test_operators/test_normal_operators.py
+
1
−
1
View file @
03bd7f7a
...
...
@@ -18,7 +18,7 @@
import
pytest
from
numpy.testing
import
assert_allclose
import
nifty
6
as
ift
import
nifty
7
as
ift
from
..common
import
setup_function
,
teardown_function
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment