Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
whatisalikelihood
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
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
Philipp Arras
whatisalikelihood
Commits
fdc98c53
Commit
fdc98c53
authored
6 years ago
by
Martin Reinecke
Browse files
Options
Downloads
Patches
Plain Diff
small tweaks
parent
69a7c1cd
No related branches found
No related tags found
1 merge request
!1
small tweaks
Pipeline
#35462
passed
6 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
main.tex
+11
-10
11 additions, 10 deletions
main.tex
with
11 additions
and
10 deletions
main.tex
+
11
−
10
View file @
fdc98c53
...
...
@@ -15,7 +15,7 @@
\definecolor
{
mygray
}{
rgb
}{
0.5,0.5,0.5
}
\definecolor
{
mymauve
}{
rgb
}{
0.58,0,0.82
}
\lstset
{
\lstset
{
backgroundcolor=
\color
{
white
}
,
% choose the background color; you must add \usepackage{color} or \usepackage{xcolor}; should come as last argument
basicstyle=
\footnotesize
,
% the size of the fonts that are used for the code
breakatwhitespace=false,
% sets if automatic breaks should only happen at whitespace
...
...
@@ -126,7 +126,7 @@ another object is needed:
\begin{itemize}
\item
$
\langle
\mathcal
H'
\mathcal
H'
^
\dagger
\rangle
_{
\mathcal
P
(
d|s
)
}$
.
\end{itemize}
Note
,
that for Gaussian, Poissonian and Bernoulli likelihoods this term doesn't
Note that for Gaussian, Poissonian and Bernoulli likelihoods this term doesn't
need to be calculated and implemented because NIFTy computes it automatically.
That's it. The rest of this paper explains what these formulae mean and how to
...
...
@@ -137,7 +137,7 @@ If the likelihood is Gaussian
\begin{align*}
\mathcal
H(d|s)
\propto
(d-R(s))
^
\dagger
N
^{
-1
}
(d-R(s))
\end{align*}
or Poissonian
or Poissonian
\begin{align*}
\mathcal
H(d|s)
\propto
-
\log
(R(s))
^
\dagger
d+
\sum
_
i R(s)
_
i,
\end{align*}
...
...
@@ -150,7 +150,7 @@ NIFTy needs:
\section*
{
Even more specific
}
Since NIFTy is implemented in
p
ython and is based on numpy let us be as specific
Since NIFTy is implemented in
P
ython and is based on numpy let us be as specific
as possible and talk about numpy arrays. In the end,
$
s
$
and
$
d
$
will be numpy
arrays.
...
...
@@ -183,7 +183,7 @@ import numpy as np
# Store the shape of s in 'shp'.
# Store the function which implements the response in 'R'.
response
_
out = R(np.ones(shp))
response
_
out = R(np.ones(shp))
if response
_
out.shape == d.shape:
print('Yay!')
else:
...
...
@@ -270,19 +270,20 @@ linear operator like the \texttt{FieldZeroPadder}, copy it and adopt it to your
needs. The method
\texttt
{
apply()
}
takes an instance of
\texttt
{
Field
}
(which is
esentially a numpy array accompanied by a domain) and returns one as well.
Some tip
p
s exclusively for you:
Some tips exclusively for you:
\begin{itemize}
\item
Please have a look at the method
\texttt
{
weight()
}
of
\texttt
{
Field
}
. With
it, you can easily multiply the field values with or divide by the volume of
each pixel.
\item
The methods
\texttt
{
from
\_
global
\_
data()
}
and
\texttt
{
to
\_
global
\_
data()
}
convert a Field to a numpy array and vice versa.
\item
Be aware of the fact that NIFTy fields are immu
a
table. As soon as you
pass a numpy array into a NIFTy field with
\texttt
{
from
\_
global
\_
data()
}
the
\enquote
{
lock
}
flag will be set and the numpy array is immu
a
table
\item
Be aware of the fact that NIFTy fields are immutable. As soon as you
pass a numpy array into a NIFTy field with
\texttt
{
from
\_
global
\_
data()
}
,
the
\enquote
{
lock
}
flag will be set and the numpy array is immutable
afterwards.
\texttt
{
to
\_
global
\_
data()
}
returns an object reference to this
numpy array which is locked and cannot be modified. If you want to modify
it, you may want to copy it with
\texttt
{
to
\_
global
\_
data().copy()
}
.
it, you may want to obtain an unlocked copy via
\texttt
{
to
\_
global
\_
data
\_
rw()
}
.
\end{itemize}
The point is: You need to fiddle around until the following test passes:
...
...
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