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
7ecdbcec
Commit
7ecdbcec
authored
Aug 12, 2018
by
Martin Reinecke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more printing
parent
cbd6cbcc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
nifty5/operators/scaling_operator.py
nifty5/operators/scaling_operator.py
+5
-0
nifty5/operators/sum_operator.py
nifty5/operators/sum_operator.py
+5
-1
No files found.
nifty5/operators/scaling_operator.py
View file @
7ecdbcec
...
...
@@ -24,6 +24,7 @@ from ..compat import *
from
..domain_tuple
import
DomainTuple
from
..sugar
import
full
from
.endomorphic_operator
import
EndomorphicOperator
from
..
import
utilities
class
ScalingOperator
(
EndomorphicOperator
):
...
...
@@ -94,3 +95,7 @@ class ScalingOperator(EndomorphicOperator):
from
..sugar
import
from_random
return
from_random
(
random_type
=
"normal"
,
domain
=
self
.
_domain
,
std
=
self
.
_get_fct
(
from_inverse
),
dtype
=
dtype
)
def
__repr__
(
self
):
subs
=
utilities
.
indent
(
self
.
_domain
.
__repr__
())
return
"ScalingOperator:
\n
Factor={}
\n
"
.
format
(
self
.
_factor
)
+
subs
nifty5/operators/sum_operator.py
View file @
7ecdbcec
...
...
@@ -21,7 +21,7 @@ from __future__ import absolute_import, division, print_function
import
numpy
as
np
from
..compat
import
*
from
..utilities
import
my_sum
from
..utilities
import
my_sum
,
indent
from
.linear_operator
import
LinearOperator
from
.scaling_operator
import
ScalingOperator
from
.diagonal_operator
import
DiagonalOperator
...
...
@@ -196,3 +196,7 @@ class SumOperator(LinearOperator):
tmp
=
op
.
draw_sample
(
from_inverse
,
dtype
)
res
=
tmp
if
res
is
None
else
res
.
unite
(
tmp
)
return
res
def
__repr__
(
self
):
subs
=
"
\n
"
.
join
(
sub
.
__repr__
()
for
sub
in
self
.
_ops
)
return
"SumOperator:
\n
"
+
indent
(
subs
)
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