Commit b6fca365 authored by Philipp Arras's avatar Philipp Arras
Browse files

Docstring fixups

parent 2f5ab8f3
...@@ -158,7 +158,7 @@ be extracted first, then changed, and a new field has to be created from the ...@@ -158,7 +158,7 @@ be extracted first, then changed, and a new field has to be created from the
result. result.
Fields defined on a MultiDomain Fields defined on a MultiDomain
------------------------------ -------------------------------
The :class:`MultiField` class can be seen as a dictionary of individual The :class:`MultiField` class can be seen as a dictionary of individual
:class:`Field` s, each identified by a name, which is defined on a :class:`Field` s, each identified by a name, which is defined on a
...@@ -300,7 +300,7 @@ As an example one may consider the following combination of ``x``, which is an o ...@@ -300,7 +300,7 @@ As an example one may consider the following combination of ``x``, which is an o
Basic operators Basic operators
------------ ---------------
# FIXME All this is outdated! # FIXME All this is outdated!
Basic operator classes provided by NIFTy are Basic operator classes provided by NIFTy are
......
...@@ -104,6 +104,7 @@ with :math:`{R}` the measurement response, which maps the continous signal field ...@@ -104,6 +104,7 @@ with :math:`{R}` the measurement response, which maps the continous signal field
This is called a free theory, as the information Hamiltonian This is called a free theory, as the information Hamiltonian
associate professor associate professor
.. math:: .. math::
\mathcal{H}(d,s)= -\log \mathcal{P}(d,s)= \frac{1}{2} s^\dagger S^{-1} s + \frac{1}{2} (d-R\,s)^\dagger N^{-1} (d-R\,s) + \mathrm{const} \mathcal{H}(d,s)= -\log \mathcal{P}(d,s)= \frac{1}{2} s^\dagger S^{-1} s + \frac{1}{2} (d-R\,s)^\dagger N^{-1} (d-R\,s) + \mathrm{const}
...@@ -179,23 +180,22 @@ NIFTy takes advantage of this formulation in several ways: ...@@ -179,23 +180,22 @@ NIFTy takes advantage of this formulation in several ways:
The reconstruction of a non-Gaussian signal with unknown covarinance from a non-trivial (tomographic) response is demonstrated in demos/getting_started_3.py. Here, the uncertainty of the field and the power spectrum of its generating process are probed via posterior samples provided by the MGVI algorithm. The reconstruction of a non-Gaussian signal with unknown covarinance from a non-trivial (tomographic) response is demonstrated in demos/getting_started_3.py. Here, the uncertainty of the field and the power spectrum of its generating process are probed via posterior samples provided by the MGVI algorithm.
+-------------------------------------------------+ +----------------------------------------------------+
| .. image:: images/getting_started_3_setup.png | | **Output of tomography demo getting_started_3.py** |
| :width: 30 % | +----------------------------------------------------+
+-------------------------------------------------+ | .. image:: images/getting_started_3_setup.png |
| .. image:: images/getting_started_3_results.png | | |
| :width: 30 % | +----------------------------------------------------+
+-------------------------------------------------+ | Non-Gaussian signal field, |
| Output of tomography demo getting_started_3.py. | | data backprojected into the image domain, power |
| **Top row:** Non-Gaussian signal field, | | spectrum of underlying Gausssian process. |
| data backprojected into the image domain, power | +----------------------------------------------------+
| spectrum of underlying Gausssian process. | | .. image:: images/getting_started_3_results.png |
| **Bottom row:** Posterior mean field signal | | |
| reconstruction, its uncertainty, and the power | +----------------------------------------------------+
| spectrum of the process for different posterior | | Posterior mean field signal |
| samples in comparison to the correct one (thick | | reconstruction, its uncertainty, and the power |
| orange line). | | spectrum of the process for different posterior |
+-------------------------------------------------+ | samples in comparison to the correct one (thick |
| orange line). |
+----------------------------------------------------+
...@@ -111,23 +111,27 @@ def _SlopePowerSpectrum(logk_space, sm, sv, im, iv): ...@@ -111,23 +111,27 @@ def _SlopePowerSpectrum(logk_space, sm, sv, im, iv):
def AmplitudeOperator(s_space, Npixdof, ceps_a, ceps_k, sm, sv, im, iv, def AmplitudeOperator(s_space, Npixdof, ceps_a, ceps_k, sm, sv, im, iv,
keys=['tau', 'phi'], zero_mode=True): keys=['tau', 'phi'], zero_mode=True):
''' ''' Operator for parametrizing smooth power spectra.
Computes a smooth power spectrum. Computes a smooth power spectrum.
Output is defined on a PowerSpace. Output is defined on a PowerSpace.
Parameters Parameters
---------- ----------
Npixdof : int
Npixdof : #pix in dof_space #pix in dof_space
ceps_a : float
ceps_a, ceps_k0 : Smoothness parameters in ceps_kernel Smoothness parameters in ceps_kernel eg. ceps_kernel(k) = (a/(1+(k/k0)**2))**2 a = ceps_a, k0 = ceps_k0
eg. ceps_kernel(k) = (a/(1+(k/k0)**2))**2 ceps_k0 : float
a = ceps_a, k0 = ceps_k0 Smoothness parameters in ceps_kernel eg. ceps_kernel(k) = (a/(1+(k/k0)**2))**2 a = ceps_a, k0 = ceps_k0
sm : float
sm, sv : slope_mean = expected exponent of power law (e.g. -4), slope_mean = expected exponent of power law (e.g. -4)
slope_variance (default=1) sv : float
slope_variance (default=1)
im, iv : y-intercept_mean, y-intercept_variance of power_slope im : float
y-intercept_mean
iv : float
y-intercept_variance of power_slope
''' '''
from ..operators.exp_transform import ExpTransform from ..operators.exp_transform import ExpTransform
......
...@@ -23,18 +23,18 @@ from .linear_operator import LinearOperator ...@@ -23,18 +23,18 @@ from .linear_operator import LinearOperator
class DomainTupleFieldInserter(LinearOperator): class DomainTupleFieldInserter(LinearOperator):
def __init__(self, domain, new_space, index, position): '''Writes the content of a field into one slice of a DomainTuple.
'''Writes the content of a field into one slice of a DomainTuple.
Parameters Parameters
---------- ----------
domain : Domain, tuple of Domain or DomainTuple domain : Domain, tuple of Domain or DomainTuple
new_space : Domain, tuple of Domain or DomainTuple new_space : Domain, tuple of Domain or DomainTuple
index : Integer index : Integer
Index at which new_space shall be added to domain. Index at which new_space shall be added to domain.
position : tuple position : tuple
Slice in new_space in which the input field shall be written into. Slice in new_space in which the input field shall be written into.
''' '''
def __init__(self, domain, new_space, index, position):
self._domain = DomainTuple.make(domain) self._domain = DomainTuple.make(domain)
tgt = list(self.domain) tgt = list(self.domain)
tgt.insert(index, new_space) tgt.insert(index, new_space)
......
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