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
f1696ca8
Commit
f1696ca8
authored
7 years ago
by
Martin Reinecke
Browse files
Options
Downloads
Patches
Plain Diff
cosmetics
parent
ba58ae24
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
demos/getting_started_2b.py
+2
-2
2 additions, 2 deletions
demos/getting_started_2b.py
nifty5/linearization.py
+7
-0
7 additions, 0 deletions
nifty5/linearization.py
with
9 additions
and
2 deletions
demos/getting_started_2b.py
+
2
−
2
View file @
f1696ca8
...
...
@@ -69,7 +69,7 @@ class EnergyAdapter(ift.Energy):
@property
def
gradient
(
self
):
return
self
.
_res
.
jac
.
adjoint_times
(
ift
.
full
(
self
.
_res
.
jac
.
target
,
1.
))
return
self
.
_res
.
gradient
@property
def
metric
(
self
):
...
...
@@ -126,7 +126,7 @@ if __name__ == '__main__':
A
=
pd
(
a
)
# Set up a sky model
sky
=
lambda
inp
:
(
HT
(
A
*
inp
)).
exp
()
sky
=
lambda
inp
:
(
HT
(
inp
*
A
)).
exp
()
M
=
ift
.
DiagonalOperator
(
exposure
)
GR
=
ift
.
GeometryRemover
(
position_space
)
...
...
This diff is collapsed.
Click to expand it.
nifty5/linearization.py
+
7
−
0
View file @
f1696ca8
...
...
@@ -30,8 +30,15 @@ class Linearization(object):
def
jac
(
self
):
return
self
.
_jac
@property
def
gradient
(
self
):
"""
Only available if target is a scalar
"""
from
.sugar
import
full
return
self
.
_jac
.
adjoint_times
(
full
(
self
.
_jac
.
target
,
1.
))
@property
def
metric
(
self
):
"""
Only available if target is a scalar
"""
return
self
.
_metric
def
__neg__
(
self
):
...
...
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