Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
resolve
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
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
resolve
Commits
75e06d9d
Commit
75e06d9d
authored
4 years ago
by
Philipp Arras
Browse files
Options
Downloads
Patches
Plain Diff
Notes
parent
8ce1eca2
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
demo/imaging_with_automatic_weighting.py
+8
-1
8 additions, 1 deletion
demo/imaging_with_automatic_weighting.py
with
8 additions
and
1 deletion
demo/imaging_with_automatic_weighting.py
+
8
−
1
View file @
75e06d9d
...
@@ -32,6 +32,9 @@ def main():
...
@@ -32,6 +32,9 @@ def main():
parser
.
add_argument
(
"
diffusefluxlevel
"
,
type
=
float
)
parser
.
add_argument
(
"
diffusefluxlevel
"
,
type
=
float
)
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
############################################################################
# Define likelihood(s)
############################################################################
if
splitext
(
args
.
ms
)[
1
]
==
"
.npz
"
:
if
splitext
(
args
.
ms
)[
1
]
==
"
.npz
"
:
obs
=
rve
.
Observation
.
load
(
args
.
ms
)
obs
=
rve
.
Observation
.
load
(
args
.
ms
)
else
:
else
:
...
@@ -79,6 +82,10 @@ def main():
...
@@ -79,6 +82,10 @@ def main():
plotter
.
add
(
"
bayesian weighting
"
,
logwgt
.
exp
())
plotter
.
add
(
"
bayesian weighting
"
,
logwgt
.
exp
())
plotter
.
add
(
"
power spectrum bayesian weighting
"
,
logwgt
.
power_spectrum
)
plotter
.
add
(
"
power spectrum bayesian weighting
"
,
logwgt
.
power_spectrum
)
############################################################################
# MINIMIZATION
############################################################################
if
rve
.
mpi
.
master
:
if
rve
.
mpi
.
master
:
if
args
.
point
is
not
None
:
if
args
.
point
is
not
None
:
# MAP points with original weights
# MAP points with original weights
...
@@ -118,7 +125,7 @@ def main():
...
@@ -118,7 +125,7 @@ def main():
plotter
.
plot
(
"
stage1
"
,
state
)
plotter
.
plot
(
"
stage1
"
,
state
)
state
.
save
(
"
stage1
"
)
state
.
save
(
"
stage1
"
)
#
MGVI
weights
#
Only
weights
lh
=
rve
.
ImagingLikelihoodVariableCovariance
(
obs
,
sky
,
weightop
)
lh
=
rve
.
ImagingLikelihoodVariableCovariance
(
obs
,
sky
,
weightop
)
plotter
.
add_histogram
(
plotter
.
add_histogram
(
"
normalized residuals (learned weights)
"
,
lh
.
normalized_residual
"
normalized residuals (learned weights)
"
,
lh
.
normalized_residual
...
...
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