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
56fc35c0
Commit
56fc35c0
authored
Mar 01, 2021
by
Jakob Knollmüller
Browse files
adjust shapes
parent
bfe22e9f
Pipeline
#94615
failed with stages
in 5 minutes and 23 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/library/variational_models.py
View file @
56fc35c0
...
...
@@ -94,15 +94,15 @@ class LowerTriangularProjector(LinearOperator):
def
__init__
(
self
,
domain
,
target
):
self
.
_domain
=
domain
self
.
_target
=
target
self
.
_indices
=
np
.
tril_indices
(
target
.
shape
[
1
])
self
.
_indices
=
np
.
tril_indices
(
target
.
shape
[
0
])
self
.
_capability
=
self
.
TIMES
|
self
.
ADJOINT_TIMES
def
apply
(
self
,
x
,
mode
):
self
.
_check_mode
(
mode
)
if
mode
==
self
.
TIMES
:
mat
=
np
.
zeros
(
self
.
_target
.
shape
[
1
:]
)
mat
=
np
.
zeros
(
self
.
_target
.
shape
)
mat
[
self
.
_indices
]
=
x
.
val
return
makeField
(
self
.
_target
,
mat
.
reshape
((
1
,)
+
mat
.
shape
)
)
return
makeField
(
self
.
_target
,
mat
)
return
makeField
(
self
.
_domain
,
x
.
val
[
0
][
self
.
_indices
].
reshape
(
self
.
_domain
.
shape
))
class
DiagonalSelector
(
LinearOperator
):
...
...
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