Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
NIFTy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
13
Issues
13
List
Boards
Labels
Service Desk
Milestones
Merge Requests
10
Merge Requests
10
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ift
NIFTy
Commits
5cc52382
Commit
5cc52382
authored
Feb 05, 2019
by
Martin Reinecke
Browse files
Options
Browse Files
Download
Plain Diff
merge master; currently broken
parents
c7c8e176
aa91ea8c
Pipeline
#43304
failed with stages
in 31 seconds
Changes
177
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
177 changed files
with
12346 additions
and
7584 deletions
+12346
-7584
.gitignore
.gitignore
+2
-0
.gitlab-ci.yml
.gitlab-ci.yml
+29
-117
Dockerfile
Dockerfile
+10
-19
README.md
README.md
+52
-41
demos/Wiener_Filter.ipynb
demos/Wiener_Filter.ipynb
+12
-12
demos/bernoulli_demo.py
demos/bernoulli_demo.py
+88
-0
demos/critical_filtering.py
demos/critical_filtering.py
+0
-123
demos/getting_started_1.py
demos/getting_started_1.py
+159
-0
demos/getting_started_2.py
demos/getting_started_2.py
+122
-0
demos/getting_started_3.py
demos/getting_started_3.py
+160
-0
demos/nonlinear_critical_filter.py
demos/nonlinear_critical_filter.py
+0
-116
demos/nonlinear_wiener_filter.py
demos/nonlinear_wiener_filter.py
+0
-74
demos/paper_demos/cartesian_wiener_filter.py
demos/paper_demos/cartesian_wiener_filter.py
+0
-97
demos/paper_demos/wiener_filter.py
demos/paper_demos/wiener_filter.py
+0
-67
demos/plot_test.py
demos/plot_test.py
+61
-0
demos/poisson_demo.py
demos/poisson_demo.py
+0
-143
demos/polynomial_fit.py
demos/polynomial_fit.py
+144
-0
demos/probing.py
demos/probing.py
+0
-12
demos/sampling.py
demos/sampling.py
+0
-98
demos/tomography.py
demos/tomography.py
+0
-46
demos/wiener_filter_data_space_noiseless.py
demos/wiener_filter_data_space_noiseless.py
+0
-115
demos/wiener_filter_easy.py
demos/wiener_filter_easy.py
+0
-66
demos/wiener_filter_via_curvature.py
demos/wiener_filter_via_curvature.py
+0
-97
demos/wiener_filter_via_hamiltonian.py
demos/wiener_filter_via_hamiltonian.py
+0
-79
docs/generate.sh
docs/generate.sh
+1
-1
docs/source/code.rst
docs/source/code.rst
+226
-121
docs/source/conf.py
docs/source/conf.py
+18
-306
docs/source/ift.rst
docs/source/ift.rst
+188
-37
docs/source/images/42vs6.png
docs/source/images/42vs6.png
+0
-0
docs/source/images/42vs9.png
docs/source/images/42vs9.png
+0
-0
docs/source/images/converging_discretization.png
docs/source/images/converging_discretization.png
+0
-0
docs/source/images/getting_started_3_results.png
docs/source/images/getting_started_3_results.png
+0
-0
docs/source/images/getting_started_3_setup.png
docs/source/images/getting_started_3_setup.png
+0
-0
docs/source/images/inference.png
docs/source/images/inference.png
+0
-0
docs/source/index.rst
docs/source/index.rst
+12
-12
docs/source/installation.rst
docs/source/installation.rst
+20
-18
docs/source/volume.rst
docs/source/volume.rst
+207
-0
nifty5/__init__.py
nifty5/__init__.py
+82
-9
nifty5/data_objects/distributed_do.py
nifty5/data_objects/distributed_do.py
+111
-22
nifty5/data_objects/numpy_do.py
nifty5/data_objects/numpy_do.py
+51
-7
nifty5/data_objects/random.py
nifty5/data_objects/random.py
+2
-4
nifty5/dobj.py
nifty5/dobj.py
+2
-11
nifty5/domain_tuple.py
nifty5/domain_tuple.py
+41
-30
nifty5/domains/__init__.py
nifty5/domains/__init__.py
+0
-12
nifty5/domains/dof_space.py
nifty5/domains/dof_space.py
+14
-5
nifty5/domains/domain.py
nifty5/domains/domain.py
+27
-18
nifty5/domains/gl_space.py
nifty5/domains/gl_space.py
+8
-11
nifty5/domains/hp_space.py
nifty5/domains/hp_space.py
+7
-9
nifty5/domains/lm_space.py
nifty5/domains/lm_space.py
+17
-24
nifty5/domains/log_rg_space.py
nifty5/domains/log_rg_space.py
+144
-0
nifty5/domains/power_space.py
nifty5/domains/power_space.py
+13
-15
nifty5/domains/rg_space.py
nifty5/domains/rg_space.py
+24
-33
nifty5/domains/structured_domain.py
nifty5/domains/structured_domain.py
+16
-17
nifty5/domains/unstructured_domain.py
nifty5/domains/unstructured_domain.py
+4
-6
nifty5/extra.py
nifty5/extra.py
+173
-0
nifty5/extra/__init__.py
nifty5/extra/__init__.py
+0
-2
nifty5/extra/energy_tests.py
nifty5/extra/energy_tests.py
+0
-88
nifty5/extra/operator_tests.py
nifty5/extra/operator_tests.py
+0
-69
nifty5/fft.py
nifty5/fft.py
+166
-0
nifty5/field.py
nifty5/field.py
+223
-301
nifty5/library/__init__.py
nifty5/library/__init__.py
+0
-10
nifty5/library/adjust_variances.py
nifty5/library/adjust_variances.py
+139
-0
nifty5/library/correlated_fields.py
nifty5/library/correlated_fields.py
+134
-0
nifty5/library/dynamic_operator.py
nifty5/library/dynamic_operator.py
+282
-0
nifty5/library/inverse_gamma_operator.py
nifty5/library/inverse_gamma_operator.py
+106
-0
nifty5/library/light_cone_operator.py
nifty5/library/light_cone_operator.py
+142
-0
nifty5/library/los_response.py
nifty5/library/los_response.py
+130
-95
nifty5/library/noise_energy.py
nifty5/library/noise_energy.py
+0
-68
nifty5/library/nonlinear_power_energy.py
nifty5/library/nonlinear_power_energy.py
+0
-142
nifty5/library/nonlinear_wiener_filter_energy.py
nifty5/library/nonlinear_wiener_filter_energy.py
+0
-68
nifty5/library/nonlinearities.py
nifty5/library/nonlinearities.py
+0
-63
nifty5/library/poisson_log_likelihood.py
nifty5/library/poisson_log_likelihood.py
+0
-62
nifty5/library/smooth_linear_amplitude.py
nifty5/library/smooth_linear_amplitude.py
+199
-0
nifty5/library/unit_log_gauss.py
nifty5/library/unit_log_gauss.py
+0
-60
nifty5/library/wiener_filter_curvature.py
nifty5/library/wiener_filter_curvature.py
+4
-5
nifty5/library/wiener_filter_energy.py
nifty5/library/wiener_filter_energy.py
+0
-54
nifty5/linearization.py
nifty5/linearization.py
+467
-0
nifty5/logger.py
nifty5/logger.py
+3
-3
nifty5/minimization/__init__.py
nifty5/minimization/__init__.py
+0
-24
nifty5/minimization/conjugate_gradient.py
nifty5/minimization/conjugate_gradient.py
+24
-18
nifty5/minimization/descent_minimizer.py
nifty5/minimization/descent_minimizer.py
+0
-126
nifty5/minimization/descent_minimizers.py
nifty5/minimization/descent_minimizers.py
+461
-0
nifty5/minimization/energy.py
nifty5/minimization/energy.py
+35
-56
nifty5/minimization/energy_adapter.py
nifty5/minimization/energy_adapter.py
+71
-0
nifty5/minimization/energy_sum.py
nifty5/minimization/energy_sum.py
+0
-64
nifty5/minimization/iteration_controller.py
nifty5/minimization/iteration_controller.py
+0
-72
nifty5/minimization/iteration_controllers.py
nifty5/minimization/iteration_controllers.py
+268
-0
nifty5/minimization/l_bfgs.py
nifty5/minimization/l_bfgs.py
+0
-77
nifty5/minimization/line_energy.py
nifty5/minimization/line_energy.py
+0
-101
nifty5/minimization/line_search.py
nifty5/minimization/line_search.py
+365
-15
nifty5/minimization/line_search_strong_wolfe.py
nifty5/minimization/line_search_strong_wolfe.py
+0
-332
nifty5/minimization/metric_gaussian_kl.py
nifty5/minimization/metric_gaussian_kl.py
+150
-0
nifty5/minimization/minimizer.py
nifty5/minimization/minimizer.py
+6
-10
nifty5/minimization/nonlinear_cg.py
nifty5/minimization/nonlinear_cg.py
+5
-7
nifty5/minimization/quadratic_energy.py
nifty5/minimization/quadratic_energy.py
+13
-13
nifty5/minimization/relaxed_newton.py
nifty5/minimization/relaxed_newton.py
+0
-37
nifty5/minimization/scipy_minimizer.py
nifty5/minimization/scipy_minimizer.py
+72
-46
nifty5/models/__init__.py
nifty5/models/__init__.py
+0
-11
nifty5/models/binary_helpers.py
nifty5/models/binary_helpers.py
+0
-85
nifty5/models/linear.py
nifty5/models/linear.py
+0
-43
nifty5/models/model.py
nifty5/models/model.py
+0
-85
nifty5/multi/__init__.py
nifty5/multi/__init__.py
+0
-5
nifty5/multi/block_diagonal_operator.py
nifty5/multi/block_diagonal_operator.py
+0
-55
nifty5/multi/multi_domain.py
nifty5/multi/multi_domain.py
+0
-133
nifty5/multi/multi_field.py
nifty5/multi/multi_field.py
+0
-236
nifty5/multi_domain.py
nifty5/multi_domain.py
+137
-0
nifty5/multi_field.py
nifty5/multi_field.py
+339
-0
nifty5/operators/__init__.py
nifty5/operators/__init__.py
+0
-24
nifty5/operators/adder.py
nifty5/operators/adder.py
+20
-15
nifty5/operators/block_diagonal_operator.py
nifty5/operators/block_diagonal_operator.py
+68
-0
nifty5/operators/chain_operator.py
nifty5/operators/chain_operator.py
+58
-43
nifty5/operators/contraction_operator.py
nifty5/operators/contraction_operator.py
+70
-0
nifty5/operators/diagonal_operator.py
nifty5/operators/diagonal_operator.py
+45
-62
nifty5/operators/distributors.py
nifty5/operators/distributors.py
+78
-34
nifty5/operators/domain_tuple_field_inserter.py
nifty5/operators/domain_tuple_field_inserter.py
+68
-0
nifty5/operators/endomorphic_operator.py
nifty5/operators/endomorphic_operator.py
+18
-11
nifty5/operators/energy_operators.py
nifty5/operators/energy_operators.py
+371
-0
nifty5/operators/exp_transform.py
nifty5/operators/exp_transform.py
+128
-0
nifty5/operators/fft_operator.py
nifty5/operators/fft_operator.py
+0
-136
nifty5/operators/fft_smoothing_operator.py
nifty5/operators/fft_smoothing_operator.py
+0
-67
nifty5/operators/field_zero_padder.py
nifty5/operators/field_zero_padder.py
+116
-0
nifty5/operators/harmonic_operators.py
nifty5/operators/harmonic_operators.py
+427
-0
nifty5/operators/inversion_enabler.py
nifty5/operators/inversion_enabler.py
+7
-14
nifty5/operators/laplace_operator.py
nifty5/operators/laplace_operator.py
+0
-131
nifty5/operators/linear_interpolation.py
nifty5/operators/linear_interpolation.py
+103
-0
nifty5/operators/linear_operator.py
nifty5/operators/linear_operator.py
+58
-84
nifty5/operators/mask_operator.py
nifty5/operators/mask_operator.py
+57
-0
nifty5/operators/operator.py
nifty5/operators/operator.py
+298
-0
nifty5/operators/operator_adapter.py
nifty5/operators/operator_adapter.py
+31
-18
nifty5/operators/outer_product_operator.py
nifty5/operators/outer_product_operator.py
+50
-0
nifty5/operators/qht_operator.py
nifty5/operators/qht_operator.py
+72
-0
nifty5/operators/regridding_operator.py
nifty5/operators/regridding_operator.py
+98
-0
nifty5/operators/sampling_enabler.py
nifty5/operators/sampling_enabler.py
+26
-26
nifty5/operators/sandwich_operator.py
nifty5/operators/sandwich_operator.py
+25
-19
nifty5/operators/scaling_operator.py
nifty5/operators/scaling_operator.py
+40
-56
nifty5/operators/sht_operator.py
nifty5/operators/sht_operator.py
+0
-146
nifty5/operators/simple_linear_operators.py
nifty5/operators/simple_linear_operators.py
+241
-0
nifty5/operators/slope_operator.py
nifty5/operators/slope_operator.py
+67
-0
nifty5/operators/smoothness_operator.py
nifty5/operators/smoothness_operator.py
+0
-54
nifty5/operators/sum_operator.py
nifty5/operators/sum_operator.py
+124
-104
nifty5/operators/symmetrizing_operator.py
nifty5/operators/symmetrizing_operator.py
+53
-0
nifty5/operators/value_inserter.py
nifty5/operators/value_inserter.py
+62
-0
nifty5/plot.py
nifty5/plot.py
+525
-0
nifty5/probing.py
nifty5/probing.py
+137
-0
nifty5/sugar.py
nifty5/sugar.py
+218
-55
nifty5/utilities.py
nifty5/utilities.py
+105
-128
setup.py
setup.py
+6
-7
test/__init__.py
test/__init__.py
+0
-1
test/common.py
test/common.py
+8
-17
test/test_energies/test_map.py
test/test_energies/test_map.py
+0
-101
test/test_energies/test_noise.py
test/test_energies/test_noise.py
+0
-85
test/test_energies/test_power.py
test/test_energies/test_power.py
+0
-84
test/test_energy_gradients.py
test/test_energy_gradients.py
+86
-0
test/test_field.py
test/test_field.py
+327
-248
test/test_gaussian_energy.py
test/test_gaussian_energy.py
+73
-0
test/test_minimization/test_minimizers.py
test/test_minimization/test_minimizers.py
+0
-206
test/test_minimizers.py
test/test_minimizers.py
+257
-0
test/test_multi_field.py
test/test_multi_field.py
+47
-42
test/test_operators/__init__.py
test/test_operators/__init__.py
+0
-0
test/test_operators/test_adjoint.py
test/test_operators/test_adjoint.py
+266
-61
test/test_operators/test_composed_operator.py
test/test_operators/test_composed_operator.py
+76
-74
test/test_operators/test_diagonal_operator.py
test/test_operators/test_diagonal_operator.py
+78
-78
test/test_operators/test_fft_operator.py
test/test_operators/test_fft_operator.py
+115
-84
test/test_operators/test_harmonic_transform_operator.py
test/test_operators/test_harmonic_transform_operator.py
+46
-46
test/test_operators/test_jacobian.py
test/test_operators/test_jacobian.py
+173
-0
test/test_operators/test_regridding.py
test/test_operators/test_regridding.py
+15
-13
test/test_operators/test_representation.py
test/test_operators/test_representation.py
+255
-0
test/test_operators/test_smoothing_operator.py
test/test_operators/test_smoothing_operator.py
+60
-54
test/test_operators/test_value_inserter.py
test/test_operators/test_value_inserter.py
+41
-0
test/test_spaces/__init__.py
test/test_spaces/__init__.py
+0
-0
test/test_spaces/test_gl_space.py
test/test_spaces/test_gl_space.py
+45
-44
test/test_spaces/test_hp_space.py
test/test_spaces/test_hp_space.py
+42
-48
test/test_spaces/test_interface.py
test/test_spaces/test_interface.py
+33
-29
test/test_spaces/test_lm_space.py
test/test_spaces/test_lm_space.py
+48
-52
test/test_spaces/test_power_space.py
test/test_spaces/test_power_space.py
+118
-102
test/test_spaces/test_rg_space.py
test/test_spaces/test_rg_space.py
+59
-78
test/test_sugar.py
test/test_sugar.py
+20
-12
No files found.
.gitignore
View file @
5cc52382
...
...
@@ -10,6 +10,8 @@ setup.cfg
.document
.svn/
*.csv
.pytest_cache/
*.png
# from https://github.com/github/gitignore/blob/master/Python.gitignore
...
...
.gitlab-ci.yml
View file @
5cc52382
image
:
$CONTAINER_TEST_IMAGE
variables
:
CONTAINER_TEST_IMAGE
:
gitlab-registry.mpcdf.mpg.de/
ift/nifty
:$CI_BUILD_REF_NAME
CONTAINER_TEST_IMAGE
:
gitlab-registry.mpcdf.mpg.de/
$CI_PROJECT_PATH
:$CI_BUILD_REF_NAME
OMP_NUM_THREADS
:
1
stages
:
...
...
@@ -15,6 +15,8 @@ build_docker_from_scratch:
-
schedules
image
:
docker:stable
stage
:
build_docker
before_script
:
-
ls
script
:
-
docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN gitlab-registry.mpcdf.mpg.de
-
docker build -t $CONTAINER_TEST_IMAGE --no-cache .
...
...
@@ -25,33 +27,32 @@ build_docker_from_cache:
-
schedules
image
:
docker:stable
stage
:
build_docker
before_script
:
-
ls
script
:
-
docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN gitlab-registry.mpcdf.mpg.de
-
docker build -t $CONTAINER_TEST_IMAGE .
-
docker push $CONTAINER_TEST_IMAGE
test_
python2_with_coverage
:
test_
serial
:
stage
:
test
script
:
-
python setup.py install --user -f
-
mpiexec -n 2 --bind-to none nosetests -q 2> /dev/null
-
nosetests -q --with-coverage --cover-package=nifty5 --cover-erase
-
pytest-3 -q --cov=nifty5 test
-
>
coverage report --omit "*plotting*,*distributed_do*"
python3 -m coverage report --omit "*plot*,*distributed_do*" | tee coverage.txt
-
>
coverage report --omit "*plotting*,*distributed_do*" | grep TOTAL
| awk '{ print "TOTAL: "$4; }'
grep TOTAL coverage.txt
| awk '{ print "TOTAL: "$4; }'
test_
python3
:
test_
mpi
:
stage
:
test
variables
:
OMPI_MCA_btl_vader_single_copy_mechanism
:
none
script
:
-
python3 setup.py install --user -f
-
mpiexec -n 2 --bind-to none nosetests3 -q 2> /dev/null
-
nosetests3 -q
-
mpiexec -n 2 --bind-to none pytest-3 -q test
pages
:
stage
:
release
script
:
-
python setup.py install --user -f
-
sh docs/generate.sh
-
mv docs/build/ public/
artifacts
:
...
...
@@ -60,142 +61,53 @@ pages:
only
:
-
NIFTy_5
before_script
:
-
export MPLBACKEND="agg"
run_critical_filtering
:
stage
:
demo_runs
script
:
-
ls
-
python setup.py install --user -f
-
python3 setup.py install --user -f
-
python demos/critical_filtering.py
-
python3 demos/critical_filtering.py
artifacts
:
paths
:
-
'
*.png'
run_nonlinear_critical_filter
:
stage
:
demo_runs
script
:
-
python setup.py install --user -f
-
python3 setup.py install --user -f
-
python demos/nonlinear_critical_filter.py
-
python3 demos/nonlinear_critical_filter.py
artifacts
:
paths
:
-
'
*.png'
run_nonlinear_wiener_filter
:
stage
:
demo_runs
script
:
-
python setup.py install --user -f
-
python3 setup.py install --user -f
-
python demos/nonlinear_wiener_filter.py
-
python3 demos/nonlinear_wiener_filter.py
only
:
-
run_demos
artifacts
:
paths
:
-
'
*.png'
# FIXME: disable for now. Fixing it is part of issue #244.
#run_poisson_demo:
# stage: demo_runs
# script:
# - python setup.py install --user -f
# - python3 setup.py install --user -f
# - python demos/poisson_demo.py
# - python3 demos/poisson_demo.py
# artifacts:
# paths:
# - '*.png'
run_probing
:
stage
:
demo_runs
script
:
-
python setup.py install --user -f
-
python3 setup.py install --user -f
-
python demos/probing.py
-
python3 demos/probing.py
artifacts
:
paths
:
-
'
*.png'
run_sampling
:
stage
:
demo_runs
script
:
-
python setup.py install --user -f
-
python3 setup.py install --user -f
-
python demos/sampling.py
-
python3 demos/sampling.py
artifacts
:
paths
:
-
'
*.png'
before_script
:
-
python3 setup.py install --user -f
run_
tomography
:
run_
ipynb
:
stage
:
demo_runs
script
:
-
python setup.py install --user -f
-
python3 setup.py install --user -f
-
python demos/tomography.py
-
python3 demos/tomography.py
artifacts
:
paths
:
-
'
*.png'
-
jupyter nbconvert --execute --ExecutePreprocessor.timeout=None demos/Wiener_Filter.ipynb
run_
wiener_filter_data_space_noiseless
:
run_
getting_started_1
:
stage
:
demo_runs
script
:
-
python setup.py install --user -f
-
python3 setup.py install --user -f
-
python demos/wiener_filter_data_space_noiseless.py
-
python3 demos/wiener_filter_data_space_noiseless.py
-
python3 demos/getting_started_1.py
-
mpiexec -n 2 --bind-to none python3 demos/getting_started_1.py 2> /dev/null
artifacts
:
paths
:
-
'
*.png'
run_
wiener_filter_easy.py
:
run_
getting_started_2
:
stage
:
demo_runs
script
:
-
python setup.py install --user -f
-
python3 setup.py install --user -f
-
python demos/wiener_filter_easy.py
-
python3 demos/wiener_filter_easy.py
-
python3 demos/getting_started_2.py
-
mpiexec -n 2 --bind-to none python3 demos/getting_started_2.py 2> /dev/null
artifacts
:
paths
:
-
'
*.png'
run_
wiener_filter_via_curvature.py
:
run_
getting_started_3
:
stage
:
demo_runs
script
:
-
pip install --user numericalunits
-
pip3 install --user numericalunits
-
python setup.py install --user -f
-
python3 setup.py install --user -f
-
python demos/wiener_filter_via_curvature.py
-
python3 demos/wiener_filter_via_curvature.py
-
python3 demos/getting_started_3.py
artifacts
:
paths
:
-
'
*.png'
run_
wiener_filter_via_hamiltonian.py
:
run_
bernoulli
:
stage
:
demo_runs
script
:
-
python setup.py install --user -f
-
python3 setup.py install --user -f
-
python demos/wiener_filter_via_hamiltonian.py
-
python3 demos/wiener_filter_via_hamiltonian.py
-
python3 demos/bernoulli_demo.py
artifacts
:
paths
:
-
'
*.png'
run_
ipynb
:
run_
curve_fitting
:
stage
:
demo_runs
script
:
-
python setup.py install --user -f
-
python3 setup.py install --user -f
-
jupyter nbconvert --execute --ExecutePreprocessor.timeout=None demos/Wiener_Filter.ipynb
-
python3 demos/polynomial_fit.py
artifacts
:
paths
:
-
'
*.png'
Dockerfile
View file @
5cc52382
FROM
debian:testing-slim
RUN
apt-get update
&&
apt-get
install
-y
\
# Needed for
gitlab tests
git \
# Needed for
setup
git
python3-pip
\
# Packages needed for NIFTy
libfftw3-dev \
python python-pip python-dev python-future python-scipy \
python3 python3-pip python3-dev python3-future python3-scipy \
python3-scipy \
# Documentation build dependencies
python
-sphinx python-sphinx-rtd-theme python-numpydoc
\
python
3-sphinx-rtd-theme dvipng texlive-latex-base texlive-latex-extra
\
# Testing dependencies
python-nose python-parameterized \
python3-nose python3-parameterized \
python3-pytest-cov jupyter \
# Optional NIFTy dependencies
openmpi-bin libopenmpi-dev python-mpi4py python3-mpi4py \
# Packages needed for NIFTy
&& pip install pyfftw \
libfftw3-dev python3-mpi4py python3-matplotlib \
# more optional NIFTy dependencies
&& pip3 install pyfftw \
# Optional NIFTy dependencies
&& pip install git+https://gitlab.mpcdf.mpg.de/ift/pyHealpix.git \
&& pip3 install git+https://gitlab.mpcdf.mpg.de/ift/pyHealpix.git \
# Testing dependencies
&& pip install coverage \
&& pip3 install jupyter \
&& rm -rf /var/lib/apt/lists/*
# Needed for demos to be running
RUN
apt-get update
&&
apt-get
install
-y
python-matplotlib python3-matplotlib
\
&&
python3
-m
pip
install
--upgrade
pip
&&
python3
-m
pip
install
jupyter
&&
python
-m
pip
install
--upgrade
pip
&&
python
-m
pip
install
jupyter
\
&&
rm
-rf
/var/lib/apt/lists/
*
# Set matplotlib backend
ENV
MPLBACKEND agg
# Create user (openmpi does not like to be run as root)
RUN
useradd
-ms
/bin/bash testinguser
...
...
README.md
View file @
5cc52382
...
...
@@ -4,7 +4,7 @@ NIFTy - Numerical Information Field Theory
[

](https://gitlab.mpcdf.mpg.de/ift/NIFTy/commits/NIFTy_5)
**NIFTy**
project homepage:
[
http://ift.pages.mpcdf.de/
NIFTy
](
http://ift.pages.mpcdf.de/NIFT
y
)
[
http://ift.pages.mpcdf.de/
nifty
](
http://ift.pages.mpcdf.de/nift
y
)
Summary
-------
...
...
@@ -13,23 +13,31 @@ Summary
**NIFTy**
, "
**N**
umerical
**I**
nformation
**F**
ield
**T**
heor
<strong>
y
</strong>
", is
a versatile library designed to enable the development of signal
inference algorithms that operate regardless of the underlying
spatial
grid and its resolution. Its object-oriented framework is written in
Python, although it accesses libraries written in C++ and C for
efficiency.
inference algorithms that operate regardless of the underlying
grids
(spatial, spectral, temporal, …) and their resolutions.
Its object-oriented framework is written in Python, although it accesses
libraries written in C++ and C for
efficiency.
NIFTy offers a toolkit that abstracts discretized representations of
continuous spaces, fields in these spaces, and operators acting on
fields into classes. The correct normalization of operations on
fields is taken care of automatically without concerning the user. This
allows for an abstract formulation and programming of inference
these fields into classes.
This allows for an abstract formulation and programming of inference
algorithms, including those derived within information field theory.
Thus, NIFTy permits its user to rapidly prototype algorithms in 1D, and
then apply the developed code in higher-dimensional settings of real
world problems. The set of spaces on which NIFTy operates comprises
point sets,
*n*
-dimensional regular grids, spherical spaces, their
harmonic counterparts, and product spaces constructed as combinations of
those.
NIFTy's interface is designed to resemble IFT formulae in the sense
that the user implements algorithms in NIFTy independent of the topology
of the underlying spaces and the discretization scheme.
Thus, the user can develop algorithms on subsets of problems and on
spaces where the detailed performance of the algorithm can be properly
evaluated and then easily generalize them to other, more complex spaces
and the full problem, respectively.
The set of spaces on which NIFTy operates comprises point sets,
*n*
-dimensional regular grids, spherical spaces, their harmonic
counterparts, and product spaces constructed as combinations of those.
NIFTy takes care of numerical subtleties like the normalization of
operations on fields and the numerical representation of model
components, allowing the user to focus on formulating the abstract
inference procedures and process-specific model properties.
Installation
...
...
@@ -37,11 +45,11 @@ Installation
### Requirements
-
[
Python
](
https://www.python.org/
)
(
v2.7.x
or 3.5.x
)
-
[
Python
3
](
https://www.python.org/
)
(
3.5.x
or later
)
-
[
SciPy
](
https://www.scipy.org/
)
-
[
pyFFTW
](
https://pypi.python.org/pypi/pyFFTW
)
Optional dependencies:
-
[
pyFFTW
](
https://pypi.python.org/pypi/pyFFTW
)
for faster Fourier transforms
-
[
pyHealpix
](
https://gitlab.mpcdf.mpg.de/ift/pyHealpix
)
(
for
harmonic
transforms involving domains on the sphere)
-
[
mpi4py
](
https://mpi4py.scipy.org
)
(
for
MPI-parallel execution)
...
...
@@ -61,57 +69,60 @@ distributions, the "apt" lines will need slight changes.
NIFTy5 and its mandatory dependencies can be installed via:
sudo apt-get install git libfftw3-dev python python-pip python-dev
pip install --user git+https://gitlab.mpcdf.mpg.de/ift/NIFTy.git@NIFTy_5
sudo apt-get install git python3 python3-pip python3-dev
pip3 install --user git+https://gitlab.mpcdf.mpg.de/ift/NIFTy.git@NIFTy_5
Plotting support is added via:
sudo apt-get install python3-matplotlib
NIFTy uses Numpy's FFT implementation by default. For large problems FFTW may be
used because of its higher performance. It can be installed via:
sudo apt-get install libfftw3-dev
pip3 install --user pyfftw
To enable FFTW usage in NIFTy, call
nifty5.fft.enable_fftw()
at the beginning of your code.
(Note: If you encounter problems related to
`pyFFTW`
, make sure that you are
using a pip-installed
`pyFFTW`
package. Unfortunately, some distributions are
shipping an incorrectly configured
`pyFFTW`
package, which does not cooperate
with the installed
`FFTW3`
libraries.)
Plotting support is added via:
pip install --user matplotlib
Support for spherical harmonic transforms is added via:
pip install --user git+https://gitlab.mpcdf.mpg.de/ift/pyHealpix.git
pip
3
install --user git+https://gitlab.mpcdf.mpg.de/ift/pyHealpix.git
MPI support is added via:
sudo apt-get install openmpi-bin libopenmpi-dev
pip install --user mpi4py
### Installation for Python 3
If you want to run NIFTy with Python 3, you need to make the following changes
to the instructions above:
-
in all
`apt-get`
commands, replace
`python-*`
by
`python3-*`
-
in all
`pip`
commands, replace
`pip`
by
`pip3`
sudo apt-get install python3-mpi4py
### Running the tests
In oder to run the tests one needs two additional packages
:
To run the tests, additional packages are required
:
pip install --user nose parameterized coverage
sudo apt-get install python3-pytest-cov
Afterwards the tests (including a coverage report) can be run using the
following command in the repository root:
nosetests -x --with-coverage --cover-html --cover-package=nifty5
pytest-3 --cov=nifty5 test
### First Steps
For a quick start, you can browse through the
[
informal
introduction
](
http://ift.pages.mpcdf.de/
NIFT
y/code.html
)
or
introduction
](
http://ift.pages.mpcdf.de/
nift
y/code.html
)
or
dive into NIFTy by running one of the demonstrations, e.g.:
python
demos/wiener_filter_via_curvature
.py
python
3 demos/getting_started_1
.py
### Acknowledgement
### Acknowledgement
s
Please acknowledge the use of NIFTy in your publication(s) by using a
phrase such as the following:
...
...
@@ -119,10 +130,10 @@ phrase such as the following:
> "Some of the results in this publication have been derived using the
> NIFTy package [(https://gitlab.mpcdf.mpg.de/ift/NIFTy)](https://gitlab.mpcdf.mpg.de/ift/NIFTy)"
and a citation to one of the
[
publications
](
http://ift.pages.mpcdf.de/
NIFT
y/citations.html
)
.
and a citation to one of the
[
publications
](
http://ift.pages.mpcdf.de/
nift
y/citations.html
)
.
###
Release Note
s
###
Licensing term
s
The NIFTy package is licensed under the terms of the
[
GPLv3
](
https://www.gnu.org/licenses/gpl.html
)
and is distributed
...
...
demos/Wiener_Filter.ipynb
View file @
5cc52382
...
...
@@ -58,7 +58,7 @@
"### Posterior\n",
"The Posterior is given by:\n",
"\n",
"$$\\mathcal P (s|d) \\propto P(s,d) = \\mathcal G(d-Rs,N) \\,\\mathcal G(s,S) \\propto \\mathcal G (m,D) $$\n",
"$$\\mathcal P (s|d) \\propto P(s,d) = \\mathcal G(d-Rs,N) \\,\\mathcal G(s,S) \\propto \\mathcal G (
s-
m,D) $$\n",
"\n",
"where\n",
"$$\\begin{align}\n",
...
...
@@ -172,7 +172,7 @@
" tol_abs_gradnorm=0.1)\n",
" # WienerFilterCurvature is (R.adjoint*N.inverse*R + Sh.inverse) plus some handy\n",
" # helper methods.\n",
" return ift.
library.
WienerFilterCurvature(R,N,Sh,iteration_controller=IC,iteration_controller_sampling=IC)"
" return ift.WienerFilterCurvature(R,N,Sh,iteration_controller=IC,iteration_controller_sampling=IC)"
]
},
{
...
...
@@ -429,8 +429,8 @@
"mask[l:h] = 0\n",
"mask = ift.Field.from_global_data(s_space, mask)\n",
"\n",
"R = ift.DiagonalOperator(mask)
*HT
\n",
"n = n.to_global_data()\n",
"R = ift.DiagonalOperator(mask)
(HT)
\n",
"n = n.to_global_data
_rw
()\n",
"n[l:h] = 0\n",
"n = ift.Field.from_global_data(s_space, n)\n",
"\n",
...
...
@@ -501,7 +501,7 @@
"m_data = HT(m).to_global_data()\n",
"m_var_data = m_var.to_global_data()\n",
"uncertainty = np.sqrt(m_var_data)\n",
"d_data = d.to_global_data()\n",
"d_data = d.to_global_data
_rw
()\n",
"\n",
"# Set lost data to NaN for proper plotting\n",
"d_data[d_data == 0] = np.nan"
...
...
@@ -585,8 +585,8 @@
"mask[l:h,l:h] = 0.\n",
"mask = ift.Field.from_global_data(s_space, mask)\n",
"\n",
"R = ift.DiagonalOperator(mask)
*HT
\n",
"n = n.to_global_data()\n",
"R = ift.DiagonalOperator(mask)
(HT)
\n",
"n = n.to_global_data
_rw
()\n",
"n[l:h, l:h] = 0\n",
"n = ift.Field.from_global_data(s_space, n)\n",
"curv = Curvature(R=R, N=N, Sh=Sh)\n",
...
...
@@ -717,21 +717,21 @@
"metadata": {
"celltoolbar": "Slideshow",
"kernelspec": {
"display_name": "Python
2
",
"display_name": "Python
3
",
"language": "python",
"name": "python
2
"
"name": "python
3
"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version":
2
"version":
3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython
2
",
"version": "
2.7.15
"
"pygments_lexer": "ipython
3
",
"version": "
3.6.6
"
}
},
"nbformat": 4,
...
...
demos/bernoulli_demo.py
0 → 100644
View file @
5cc52382
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright(C) 2013-2019 Max-Planck-Society
#
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik.
#####################################################################
# Bernoulli reconstruction
# Reconstruct an event probability field with values between 0 and 1
# from the observed events
# 1D (set mode=0), 2D (mode=1), or on the sphere (mode=2)
#####################################################################
import
numpy
as
np
import
nifty5
as
ift
if
__name__
==
'__main__'
:
np
.
random
.
seed
(
41
)
# Set up the position space of the signal
mode
=
2
if
mode
==
0
:
# One-dimensional regular grid
position_space
=
ift
.
RGSpace
(
1024
)
elif
mode
==
1
:
# Two-dimensional regular grid
position_space
=
ift
.
RGSpace
([
512
,
512
])
else
:
# Sphere
position_space
=
ift
.
HPSpace
(
128
)
# Define harmonic space and transform
harmonic_space
=
position_space
.
get_default_codomain
()
HT
=
ift
.
HarmonicTransformOperator
(
harmonic_space
,
position_space
)
position
=
ift
.
from_random
(
'normal'
,
harmonic_space
)
# Define power spectrum and amplitudes
def
sqrtpspec
(
k
):
return
1.
/
(
20.
+
k
**
2
)
A
=
ift
.
create_power_operator
(
harmonic_space
,
sqrtpspec
)
# Set up a sky operator and instrumental response
sky
=
ift
.
sigmoid
(
HT
(
A
))
GR
=
ift
.
GeometryRemover
(
position_space
)
R
=
GR
# Generate mock data
p
=
R
(
sky
)
mock_position
=
ift
.
from_random
(
'normal'
,
harmonic_space
)
tmp
=
p
(
mock_position
).
to_global_data
().
astype
(
np
.
float64
)
data
=
np
.
random
.
binomial
(
1
,
tmp
)
data
=
ift
.
Field
.
from_global_data
(
R
.
target
,
data
)
# Compute likelihood and Hamiltonian
position
=
ift
.
from_random
(
'normal'
,
harmonic_space
)
likelihood
=
ift
.
BernoulliEnergy
(
data
)(
p
)
ic_newton
=
ift
.
DeltaEnergyController
(
name
=
'Newton'
,
iteration_limit
=
100
,
tol_rel_deltaE
=
1e-8
)
minimizer
=
ift
.
NewtonCG
(
ic_newton
)
ic_sampling
=
ift
.
GradientNormController
(
iteration_limit
=
100
)
# Minimize the Hamiltonian
H
=
ift
.
StandardHamiltonian
(
likelihood
,
ic_sampling
)
H
=
ift
.
EnergyAdapter
(
position
,
H
,
want_metric
=
True
)
# minimizer = ift.L_BFGS(ic_newton)
H
,
convergence
=
minimizer
(
H
)
reconstruction
=
sky
(
H
.
position
)
plot
=
ift
.
Plot
()
plot
.
add
(
reconstruction
,
title
=
'reconstruction'
)
plot
.
add
(
GR
.
adjoint_times
(
data
),
title
=
'data'
)
plot
.
add
(
sky
(
mock_position
),
title
=
'truth'
)
plot
.
output
(
nx
=
3
,
xsize
=
16
,
ysize
=
9
,
title
=
"results"
,
name
=
"bernoulli.png"
)
demos/critical_filtering.py
deleted
100644 → 0