Commit 7a6efed0 authored by Philipp Arras's avatar Philipp Arras
Browse files

More changes

parent 0023f8f8
Pipeline #35439 passed with stage
in 21 seconds
......@@ -125,40 +125,52 @@ another object is needed:
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
compute them. From now one, our discussion will become increasingly specific.
\section*{Becoming more specific}
If the likelihood is Gaussian ($\mathcal H(d|s) \propto (d-R(s))^\dagger N^{-1}
(d-R(s))$) or Poissonian ($\mathcal H(d|s) \propto - \log (R(s))^\dagger
d+\sum_i R(s)_i$ ), NIFTy needs:
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
\begin{align*}
\mathcal H(d|s) \propto - \log (R(s))^\dagger d+\sum_i R(s)_i,
\end{align*}
NIFTy needs:
\begin{itemize}
\item $R$.
\item $R'^\dagger := (\frac{\partial}{\partial s} R(s))^\dagger$.
\item $R' = \frac{\partial}{\partial s} R(s)$. (only for 2nd order minimization)
\item $R(s)$.
\item $R'^\dagger := \left(\left.\frac{d R}{d s}\right|_{s=\text{postition}}\right)^\dagger$.
\item Only for 2nd order minimization: $R' = \left.\frac{d R}{d s}\right|_{s=\text{postition}}$.
\end{itemize}
\section*{Even more specific}
Since NIFTy is implemented in python 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 a numpy
array defined in a python script.
as possible and talk about numpy arrays. In the end, $s$ and $d$ will be numpy
arrays.
The array \texttt{d} is created by a script which reads in the actual data which
drops out of an instrument. This array will remain constant throughout the IFT
algorithm since the data is given and never will be changed.
The array \texttt{s} is obviously not constant; only its shape won't change in the
course of the algorithm. NIFTy will store here the reconstruction of the
physical field which the user wants to infer. \texttt{s} would be a
The array \texttt{s} is obviously not constant; only its shape won't change in
the course of the algorithm. In \texttt{s}, NIFTy will store the reconstruction
of the physical field which the user wants to infer. \texttt{s} would be a
one-dimensional array for a time-series, two-dimensional for a multi-frequency
time-series or for a single-frequency image of the sky, three-dimensional for a
multi-frequency image of sky, etc. To cut a long story short: be aware of the
shape of \texttt{s} and \texttt{d}!
Now, the response appears. When we talk about \enquote{the response} we mean a
function \texttt{R(s)} which takes an array of shape \texttt{s.shape} and returns an
array of shape \texttt{d.shape}. This function shall be made such that it
simulates the measurement device. Assume one knows the signal \texttt{s}, what
would be the data \texttt{d} in a noiseless measurement? Make sure that the
following code runs:
\subsection*{The response}
When we talk about \enquote{the response} we mean a function \texttt{R(s)} which
takes an array of shape \texttt{s.shape} and returns an array of shape
\texttt{d.shape}. This function shall be made such that it simulates the
measurement device. Assume one knows the signal \texttt{s}, what would be the
data \texttt{d} in a noiseless measurement? Make sure that you understand what a
response is to 100\%. If you have questions about it, do not hesitate to ask!
This is one of the crucial parts of the whole process. The following code shall
be running.
\begin{lstlisting}
import numpy as np
......@@ -171,10 +183,11 @@ response_out = R(np.ones(shp))
if response_out.shape == d.shape:
print('Yay!')
else:
raise ValueError('Output of response has not the correct shape.')
raise ValueError('Output of response doesn't have the correct shape.')
\end{lstlisting}
Next, $R'$ and $R'^\dagger$ needs to be implemented. Since $R$ is a
\subsection*{Derivative of response}
Next, $R'$ and $R'^\dagger$ need to be implemented. Since $R$ is a
function:
\begin{align*}
R: \mathbb R^{s.shape} \to \mathbb R^{d.shape},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment