Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
NIFTy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
13
Issues
13
List
Boards
Labels
Service Desk
Milestones
Merge Requests
13
Merge Requests
13
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ift
NIFTy
Commits
e6b49f93
Commit
e6b49f93
authored
Mar 27, 2018
by
Martin Reinecke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nor more need for process_sample()
parent
9f9b0ed3
Pipeline
#26507
passed with stage
in 5 minutes and 30 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
19 deletions
+0
-19
nifty4/operators/chain_operator.py
nifty4/operators/chain_operator.py
+0
-6
nifty4/operators/diagonal_operator.py
nifty4/operators/diagonal_operator.py
+0
-8
nifty4/operators/scaling_operator.py
nifty4/operators/scaling_operator.py
+0
-5
No files found.
nifty4/operators/chain_operator.py
View file @
e6b49f93
...
...
@@ -114,9 +114,3 @@ class ChainOperator(LinearOperator):
for
op
in
t_ops
:
x
=
op
.
apply
(
x
,
mode
)
return
x
def
draw_sample
(
self
,
dtype
=
np
.
float64
):
sample
=
self
.
_ops
[
-
1
].
draw_sample
(
dtype
)
for
op
in
reversed
(
self
.
_ops
[:
-
1
]):
sample
=
op
.
process_sample
(
sample
)
return
sample
nifty4/operators/diagonal_operator.py
View file @
e6b49f93
...
...
@@ -172,14 +172,6 @@ class DiagonalOperator(EndomorphicOperator):
res
.
_ldiag
=
self
.
_ldiag
.
conjugate
()
return
res
def
process_sample
(
self
,
sample
):
if
np
.
issubdtype
(
self
.
_ldiag
.
dtype
,
np
.
complexfloating
):
raise
ValueError
(
"cannot draw sample from complex-valued operator"
)
res
=
Field
.
empty_like
(
sample
)
res
.
local_data
[()]
=
sample
.
local_data
*
np
.
sqrt
(
self
.
_ldiag
)
return
res
def
draw_sample
(
self
,
dtype
=
np
.
float64
):
if
(
np
.
issubdtype
(
self
.
_ldiag
.
dtype
,
np
.
complexfloating
)
or
(
self
.
_ldiag
<=
0.
).
any
()):
...
...
nifty4/operators/scaling_operator.py
View file @
e6b49f93
...
...
@@ -95,11 +95,6 @@ class ScalingOperator(EndomorphicOperator):
return
self
.
TIMES
|
self
.
ADJOINT_TIMES
return
self
.
_all_ops
def
process_sample
(
self
,
sample
):
if
self
.
_factor
.
imag
!=
0.
or
self
.
_factor
.
real
<=
0.
:
raise
ValueError
(
"Operator not positive definite"
)
return
sample
*
np
.
sqrt
(
self
.
_factor
)
def
_sample_helper
(
self
,
fct
,
dtype
):
if
fct
.
imag
!=
0.
or
fct
.
real
<=
0.
:
raise
ValueError
(
"operator not positive definite"
)
...
...
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