dubfi.tests.test_inversion¶
Tests for Bayesian inversion.
Changed in version 0.1.1: (changed module path)
Added in version 0.1.0: (initial release)
Functions¶
|
Generate some tests arrays. |
|
Compare cost function and its derivatives in different linear algebra implementations. |
|
Compare cost function and its derivatives in dense and diagonal case. |
|
Run inversion using dense matrix linear algebra implementation. |
|
Run inversion using dense matrix linear algebra implementation. |
|
Run inversion using sparse (CSC) matrix linear algebra implementation. |
|
Run inversion using MPI linear algebra implementation. |
|
Run inversion using MPI linear algebra implementation. |
|
Test derivatives of parameterized vector H and parametrized operator R. |
|
Compare two inversion results. |
Show statistics from previously saved profiling data. |
|
|
Test inversion by comparing inversion results for different linear algebra implementations. |
|
Test inversion by comparing inversion results for diagonal and CSC matrices. |
Unit test: fails if errors are encountered. |
|
Unit test: fails if errors are encountered. |
|
Unit test: fails if errors are encountered. |
|
Unit test: fails if errors are encountered. |
Module Contents¶
- dubfi.tests.test_inversion.gen_test_arrays(n, k, m, localization_scale=10.0, b_prefactor=0.1)¶
Generate some tests arrays.
- Parameters:
n (int)
k (int)
m (int)
localization_scale (float)
b_prefactor (float)
- Return type:
dict
- dubfi.tests.test_inversion.compare_strict(n=117, k=23, m=17, tests=10, norm_prefactor=1.0, regularization=1.0, localization_scale=20.0, b_prefactor=0.1)¶
Compare cost function and its derivatives in different linear algebra implementations.
- Parameters:
n (int)
k (int)
m (int)
tests (int)
- Return type:
int
- dubfi.tests.test_inversion.compare_strict_diag(n=117, k=23, m=17, tests=10, norm_prefactor=1.0, regularization=1.0, localization_scale=0.01, b_prefactor=0.1)¶
Compare cost function and its derivatives in dense and diagonal case.
- Parameters:
n (int)
k (int)
m (int)
tests (int)
- Return type:
int
- dubfi.tests.test_inversion.run_test_dense(test_arrays, regularization, norm_prefactor, tests=10, profiling=False)¶
Run inversion using dense matrix linear algebra implementation.
- Return type:
tuple[dubfi.inversion.inversion.InversionResult, int]
- dubfi.tests.test_inversion.run_test_diagonal(test_arrays, regularization, norm_prefactor, tests=10, profiling=False)¶
Run inversion using dense matrix linear algebra implementation.
- Return type:
tuple[dubfi.inversion.inversion.InversionResult, int]
- dubfi.tests.test_inversion.run_test_sparse(test_arrays, regularization, norm_prefactor, tests=10, profiling=False)¶
Run inversion using sparse (CSC) matrix linear algebra implementation.
- Return type:
tuple[dubfi.inversion.inversion.InversionResult, int]
- dubfi.tests.test_inversion.run_test_mpi_defaults(n=349, k=23, m=17, **kwargs)¶
Run inversion using MPI linear algebra implementation.
- Return type:
tuple[dubfi.inversion.inversion.InversionResult, int]
- dubfi.tests.test_inversion.run_test_mpi(test_arrays, regularization, norm_prefactor, localization_scale, tests=10, profiling=False)¶
Run inversion using MPI linear algebra implementation.
- Return type:
tuple[dubfi.inversion.inversion.InversionResult, int]
- dubfi.tests.test_inversion.compare_derivatives_hr(h, r, states, **kwargs)¶
Test derivatives of parameterized vector H and parametrized operator R.
- Return type:
int
- dubfi.tests.test_inversion.compare_results(res1, res2, label1, label2)¶
Compare two inversion results.
- Parameters:
label1 (str)
label2 (str)
- Return type:
int
- dubfi.tests.test_inversion.profile_stats()¶
Show statistics from previously saved profiling data.
- dubfi.tests.test_inversion.compare_InvertorOptimizer(n=401, k=23, m=17, tests=2, profiling=False, norm_prefactor=0.5, regularization=1.0, localization_scale=20.0, b_prefactor=0.1)¶
Test inversion by comparing inversion results for different linear algebra implementations.
- Parameters:
n (int)
k (int)
m (int)
tests (int)
- Return type:
int
- dubfi.tests.test_inversion.compare_InvertorOptimizer_diag(n=401, k=23, m=17, tests=2, profiling=False, norm_prefactor=0.5, regularization=1.0, localization_scale=0.01, b_prefactor=0.1)¶
Test inversion by comparing inversion results for diagonal and CSC matrices.
- Parameters:
n (int)
k (int)
m (int)
tests (int)
- Return type:
int
- dubfi.tests.test_inversion.test_compare_strict()¶
Unit test: fails if errors are encountered.
- dubfi.tests.test_inversion.test_compare_strict_diag()¶
Unit test: fails if errors are encountered.
- dubfi.tests.test_inversion.test_invertor()¶
Unit test: fails if errors are encountered.
- dubfi.tests.test_inversion.test_invertor_diag()¶
Unit test: fails if errors are encountered.