dit 2.2__tar.gz → 2.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dit-2.2 → dit-2.3}/PKG-INFO +2 -4
- {dit-2.2 → dit-2.3}/dit/__init__.py +7 -1
- {dit-2.2 → dit-2.3}/dit/algorithms/__init__.py +16 -0
- dit-2.3/dit/algorithms/marginal_lifts.py +182 -0
- dit-2.3/dit/algorithms/mixture_of_products.py +255 -0
- dit-2.3/dit/algorithms/mprojection.py +606 -0
- dit-2.3/dit/algorithms/support_spectrum.py +165 -0
- {dit-2.2 → dit-2.3}/dit/distribution.py +81 -6
- {dit-2.2 → dit-2.3}/dit/multivariate/__init__.py +1 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/common_informations/__init__.py +1 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/common_informations/exact_common_information.py +7 -3
- dit-2.3/dit/multivariate/common_informations/tension_common_information.py +234 -0
- dit-2.3/dit/multivariate/kirkwood.py +246 -0
- {dit-2.2 → dit-2.3}/dit/pid/measures/__init__.py +4 -1
- {dit-2.2 → dit-2.3}/dit/profiles/__init__.py +3 -0
- dit-2.3/dit/profiles/binding_mixture.py +138 -0
- {dit-2.2 → dit-2.3}/dit/profiles/information_partitions.py +176 -0
- dit-2.3/dit/profiles/marginal_lift.py +91 -0
- dit-2.3/dit/profiles/mflat.py +127 -0
- {dit-2.2 → dit-2.3}/dit/profiles/schneidman.py +10 -3
- dit-2.3/dit/rate_distortion/gray_wyner/__init__.py +63 -0
- {dit-2.2 → dit-2.3}/dit/rate_distortion/gray_wyner/network.py +208 -1
- {dit-2.2 → dit-2.3}/dit/rate_distortion/gray_wyner/optimizer.py +189 -7
- dit-2.3/dit/rate_distortion/gray_wyner/plotting.py +166 -0
- dit-2.3/dit/rate_distortion/gray_wyner/region.py +472 -0
- dit-2.3/dit/rate_distortion/gray_wyner/shape.py +310 -0
- {dit-2.2 → dit-2.3}/pyproject.toml +0 -2
- dit-2.3/tests/algorithms/test_mixture_of_products.py +136 -0
- dit-2.3/tests/algorithms/test_mprojection.py +200 -0
- dit-2.3/tests/algorithms/test_support_spectrum.py +100 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/common_informations/test_exact_common_information.py +16 -0
- dit-2.3/tests/multivariate/common_informations/test_tension_common_information.py +127 -0
- dit-2.3/tests/multivariate/test_kirkwood.py +266 -0
- dit-2.3/tests/profiles/test_binding_mixture.py +32 -0
- dit-2.3/tests/profiles/test_dual_dependency_decomposition.py +128 -0
- dit-2.3/tests/profiles/test_marginal_lift.py +75 -0
- dit-2.3/tests/profiles/test_mflat_connected.py +99 -0
- dit-2.3/tests/rate_distortion/test_tension.py +350 -0
- {dit-2.2 → dit-2.3}/tests/test_distribution.py +71 -0
- dit-2.2/dit/rate_distortion/gray_wyner/__init__.py +0 -31
- dit-2.2/dit/rate_distortion/gray_wyner/plotting.py +0 -49
- {dit-2.2 → dit-2.3}/.gitignore +0 -0
- {dit-2.2 → dit-2.3}/CREDITS.rst +0 -0
- {dit-2.2 → dit-2.3}/LICENSE.txt +0 -0
- {dit-2.2 → dit-2.3}/README.rst +0 -0
- {dit-2.2 → dit-2.3}/dit/abc.py +0 -0
- {dit-2.2 → dit-2.3}/dit/abstractdist.py +0 -0
- {dit-2.2 → dit-2.3}/dit/algorithms/admui.py +0 -0
- {dit-2.2 → dit-2.3}/dit/algorithms/broja_cone.py +0 -0
- {dit-2.2 → dit-2.3}/dit/algorithms/broja_method.py +0 -0
- {dit-2.2 → dit-2.3}/dit/algorithms/broja_util.py +0 -0
- {dit-2.2 → dit-2.3}/dit/algorithms/caekl_psp.py +0 -0
- {dit-2.2 → dit-2.3}/dit/algorithms/channelcapacity.py +0 -0
- {dit-2.2 → dit-2.3}/dit/algorithms/convex_maximization.py +0 -0
- {dit-2.2 → dit-2.3}/dit/algorithms/distribution_optimizers.py +0 -0
- {dit-2.2 → dit-2.3}/dit/algorithms/frankwolfe.py +0 -0
- {dit-2.2 → dit-2.3}/dit/algorithms/ipf.py +0 -0
- {dit-2.2 → dit-2.3}/dit/algorithms/lattice.py +0 -0
- {dit-2.2 → dit-2.3}/dit/algorithms/maxentropy.py +0 -0
- {dit-2.2 → dit-2.3}/dit/algorithms/maxentropyfw.py +0 -0
- {dit-2.2 → dit-2.3}/dit/algorithms/minimal_sufficient_statistic.py +0 -0
- {dit-2.2 → dit-2.3}/dit/algorithms/optimization.py +0 -0
- {dit-2.2 → dit-2.3}/dit/algorithms/optimization_jax.py +0 -0
- {dit-2.2 → dit-2.3}/dit/algorithms/optimization_pytensor.py +0 -0
- {dit-2.2 → dit-2.3}/dit/algorithms/optimization_torch.py +0 -0
- {dit-2.2 → dit-2.3}/dit/algorithms/optutil.py +0 -0
- {dit-2.2 → dit-2.3}/dit/algorithms/pid_broja.py +0 -0
- {dit-2.2 → dit-2.3}/dit/algorithms/prune_expand.py +0 -0
- {dit-2.2 → dit-2.3}/dit/algorithms/stats.py +0 -0
- {dit-2.2 → dit-2.3}/dit/algorithms/submodular.py +0 -0
- {dit-2.2 → dit-2.3}/dit/bgm.py +0 -0
- {dit-2.2 → dit-2.3}/dit/cdisthelpers.py +0 -0
- {dit-2.2 → dit-2.3}/dit/channelorder/__init__.py +0 -0
- {dit-2.2 → dit-2.3}/dit/channelorder/_utils.py +0 -0
- {dit-2.2 → dit-2.3}/dit/channelorder/deficiency.py +0 -0
- {dit-2.2 → dit-2.3}/dit/channelorder/orderings.py +0 -0
- {dit-2.2 → dit-2.3}/dit/coding/__init__.py +0 -0
- {dit-2.2 → dit-2.3}/dit/coding/_channel.py +0 -0
- {dit-2.2 → dit-2.3}/dit/coding/_gf2.py +0 -0
- {dit-2.2 → dit-2.3}/dit/coding/_util.py +0 -0
- {dit-2.2 → dit-2.3}/dit/coding/base.py +0 -0
- {dit-2.2 → dit-2.3}/dit/coding/block_codes.py +0 -0
- {dit-2.2 → dit-2.3}/dit/coding/codes.py +0 -0
- {dit-2.2 → dit-2.3}/dit/coding/convolutional.py +0 -0
- {dit-2.2 → dit-2.3}/dit/coding/ldpc.py +0 -0
- {dit-2.2 → dit-2.3}/dit/coding/linear.py +0 -0
- {dit-2.2 → dit-2.3}/dit/coding/polar.py +0 -0
- {dit-2.2 → dit-2.3}/dit/coding/source_polar.py +0 -0
- {dit-2.2 → dit-2.3}/dit/coding/symbol_code.py +0 -0
- {dit-2.2 → dit-2.3}/dit/coding/tunstall.py +0 -0
- {dit-2.2 → dit-2.3}/dit/coding/universal.py +0 -0
- {dit-2.2 → dit-2.3}/dit/distconst.py +0 -0
- {dit-2.2 → dit-2.3}/dit/divergences/__init__.py +0 -0
- {dit-2.2 → dit-2.3}/dit/divergences/_kl_nonmerge.py +0 -0
- {dit-2.2 → dit-2.3}/dit/divergences/copy_mutual_information.py +0 -0
- {dit-2.2 → dit-2.3}/dit/divergences/coupling_metrics.py +0 -0
- {dit-2.2 → dit-2.3}/dit/divergences/cross_entropy.py +0 -0
- {dit-2.2 → dit-2.3}/dit/divergences/earth_movers_distance.py +0 -0
- {dit-2.2 → dit-2.3}/dit/divergences/generalized_divergences.py +0 -0
- {dit-2.2 → dit-2.3}/dit/divergences/hypercontractivity_coefficient.py +0 -0
- {dit-2.2 → dit-2.3}/dit/divergences/jensen_shannon_divergence.py +0 -0
- {dit-2.2 → dit-2.3}/dit/divergences/kullback_leibler_divergence.py +0 -0
- {dit-2.2 → dit-2.3}/dit/divergences/maximum_correlation.py +0 -0
- {dit-2.2 → dit-2.3}/dit/divergences/pmf.py +0 -0
- {dit-2.2 → dit-2.3}/dit/divergences/variational_distance.py +0 -0
- {dit-2.2 → dit-2.3}/dit/example_channels/__init__.py +0 -0
- {dit-2.2 → dit-2.3}/dit/example_channels/_util.py +0 -0
- {dit-2.2 → dit-2.3}/dit/example_channels/binary.py +0 -0
- {dit-2.2 → dit-2.3}/dit/example_channels/qary.py +0 -0
- {dit-2.2 → dit-2.3}/dit/example_channels/trivial.py +0 -0
- {dit-2.2 → dit-2.3}/dit/example_dists/__init__.py +0 -0
- {dit-2.2 → dit-2.3}/dit/example_dists/circuits.py +0 -0
- {dit-2.2 → dit-2.3}/dit/example_dists/dependencies.py +0 -0
- {dit-2.2 → dit-2.3}/dit/example_dists/dice.py +0 -0
- {dit-2.2 → dit-2.3}/dit/example_dists/empirical/__init__.py +0 -0
- {dit-2.2 → dit-2.3}/dit/example_dists/empirical/_music.py +0 -0
- {dit-2.2 → dit-2.3}/dit/example_dists/empirical/bach.py +0 -0
- {dit-2.2 → dit-2.3}/dit/example_dists/empirical/blood_types.py +0 -0
- {dit-2.2 → dit-2.3}/dit/example_dists/empirical/car.py +0 -0
- {dit-2.2 → dit-2.3}/dit/example_dists/empirical/congress.py +0 -0
- {dit-2.2 → dit-2.3}/dit/example_dists/empirical/corelli.py +0 -0
- {dit-2.2 → dit-2.3}/dit/example_dists/empirical/penguins.py +0 -0
- {dit-2.2 → dit-2.3}/dit/example_dists/empirical/student.py +0 -0
- {dit-2.2 → dit-2.3}/dit/example_dists/empirical/titanic.py +0 -0
- {dit-2.2 → dit-2.3}/dit/example_dists/giant_bit.py +0 -0
- {dit-2.2 → dit-2.3}/dit/example_dists/intrinsic.py +0 -0
- {dit-2.2 → dit-2.3}/dit/example_dists/mdbsi.py +0 -0
- {dit-2.2 → dit-2.3}/dit/example_dists/miscellaneous.py +0 -0
- {dit-2.2 → dit-2.3}/dit/example_dists/n_mod_m.py +0 -0
- {dit-2.2 → dit-2.3}/dit/example_dists/nonsignalling_boxes.py +0 -0
- {dit-2.2 → dit-2.3}/dit/example_dists/numeric.py +0 -0
- {dit-2.2 → dit-2.3}/dit/exceptions.py +0 -0
- {dit-2.2 → dit-2.3}/dit/helpers.py +0 -0
- {dit-2.2 → dit-2.3}/dit/inference/__init__.py +0 -0
- {dit-2.2 → dit-2.3}/dit/inference/binning.py +0 -0
- {dit-2.2 → dit-2.3}/dit/inference/counts.c +0 -0
- {dit-2.2 → dit-2.3}/dit/inference/counts.h +0 -0
- {dit-2.2 → dit-2.3}/dit/inference/counts.py +0 -0
- {dit-2.2 → dit-2.3}/dit/inference/estimators.py +0 -0
- {dit-2.2 → dit-2.3}/dit/inference/knn_estimators.py +0 -0
- {dit-2.2 → dit-2.3}/dit/inference/pycounts.pyx +0 -0
- {dit-2.2 → dit-2.3}/dit/inference/segmentaxis.py +0 -0
- {dit-2.2 → dit-2.3}/dit/inference/time_series.py +0 -0
- {dit-2.2 → dit-2.3}/dit/math/__init__.py +0 -0
- {dit-2.2 → dit-2.3}/dit/math/_close.pyx +0 -0
- {dit-2.2 → dit-2.3}/dit/math/_samplediscrete.pyx +0 -0
- {dit-2.2 → dit-2.3}/dit/math/aitchison.py +0 -0
- {dit-2.2 → dit-2.3}/dit/math/combinatorics.py +0 -0
- {dit-2.2 → dit-2.3}/dit/math/equal.py +0 -0
- {dit-2.2 → dit-2.3}/dit/math/fraction.py +0 -0
- {dit-2.2 → dit-2.3}/dit/math/misc.py +0 -0
- {dit-2.2 → dit-2.3}/dit/math/ops.py +0 -0
- {dit-2.2 → dit-2.3}/dit/math/pmfops.py +0 -0
- {dit-2.2 → dit-2.3}/dit/math/sampling.py +0 -0
- {dit-2.2 → dit-2.3}/dit/math/sigmaalgebra.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/_backend.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/caekl_mutual_information.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/cohesion.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/coinformation.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/common_informations/_functional_partition.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/common_informations/base_markov_optimizer.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/common_informations/beta_common_information.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/common_informations/functional_common_information.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/common_informations/gk_common_information.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/common_informations/kamath_common_information.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/common_informations/maxent_function.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/common_informations/mss_common_information.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/common_informations/stochastic_gk_common_information.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/common_informations/symbolic_ansatz.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/common_informations/symbolic_markov.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/common_informations/symbolic_solve.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/common_informations/wyner_common_information.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/cross_mutual_information.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/delta_gamma.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/deweese.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/dual_total_correlation.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/entropy.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/interaction_information.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/logarithmic_decomposition.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/mmi_psp.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/necessary_conditional_entropy.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/o_information.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/quax_synergy.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/s_information.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/secret_key_agreement/__init__.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/secret_key_agreement/base_skar_optimizers.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/secret_key_agreement/interactive_intrinsic_mutual_informations.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/secret_key_agreement/intrinsic_mutual_informations.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/secret_key_agreement/minimal_intrinsic_mutual_informations.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/secret_key_agreement/no_communication.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/secret_key_agreement/one_way_skar.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/secret_key_agreement/reduced_intrinsic_mutual_informations.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/secret_key_agreement/secrecy_capacity.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/secret_key_agreement/skar_lower_bounds.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/secret_key_agreement/trivial_bounds.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/secret_key_agreement/two_part_intrinsic_mutual_informations.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/secret_key_agreement/two_way_skar.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/synergistic_disclosure.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/total_correlation.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/transmission.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/tse_complexity.py +0 -0
- {dit-2.2 → dit-2.3}/dit/multivariate/union_information.py +0 -0
- {dit-2.2 → dit-2.3}/dit/other/__init__.py +0 -0
- {dit-2.2 → dit-2.3}/dit/other/cumulative_residual_entropy.py +0 -0
- {dit-2.2 → dit-2.3}/dit/other/disequilibrium.py +0 -0
- {dit-2.2 → dit-2.3}/dit/other/extropy.py +0 -0
- {dit-2.2 → dit-2.3}/dit/other/lautum_information.py +0 -0
- {dit-2.2 → dit-2.3}/dit/other/negentropy.py +0 -0
- {dit-2.2 → dit-2.3}/dit/other/perplexity.py +0 -0
- {dit-2.2 → dit-2.3}/dit/other/renyi_entropy.py +0 -0
- {dit-2.2 → dit-2.3}/dit/other/sibson_mutual_information.py +0 -0
- {dit-2.2 → dit-2.3}/dit/other/tsallis_entropy.py +0 -0
- {dit-2.2 → dit-2.3}/dit/params.py +0 -0
- {dit-2.2 → dit-2.3}/dit/pid/__init__.py +0 -0
- {dit-2.2 → dit-2.3}/dit/pid/distributions/__init__.py +0 -0
- {dit-2.2 → dit-2.3}/dit/pid/distributions/bivariate.py +0 -0
- {dit-2.2 → dit-2.3}/dit/pid/distributions/trivariate.py +0 -0
- {dit-2.2 → dit-2.3}/dit/pid/hcs.py +0 -0
- {dit-2.2 → dit-2.3}/dit/pid/helpers.py +0 -0
- {dit-2.2 → dit-2.3}/dit/pid/hmos.py +0 -0
- {dit-2.2 → dit-2.3}/dit/pid/measures/ibroja.py +0 -0
- {dit-2.2 → dit-2.3}/dit/pid/measures/iccs.py +0 -0
- {dit-2.2 → dit-2.3}/dit/pid/measures/ict.py +0 -0
- {dit-2.2 → dit-2.3}/dit/pid/measures/ideg.py +0 -0
- {dit-2.2 → dit-2.3}/dit/pid/measures/idelta.py +0 -0
- {dit-2.2 → dit-2.3}/dit/pid/measures/ideltalambda.py +0 -0
- {dit-2.2 → dit-2.3}/dit/pid/measures/idep.py +0 -0
- {dit-2.2 → dit-2.3}/dit/pid/measures/ido.py +0 -0
- {dit-2.2 → dit-2.3}/dit/pid/measures/igh.py +0 -0
- {dit-2.2 → dit-2.3}/dit/pid/measures/iig.py +0 -0
- {dit-2.2 → dit-2.3}/dit/pid/measures/iipid.py +0 -0
- {dit-2.2 → dit-2.3}/dit/pid/measures/imc.py +0 -0
- {dit-2.2 → dit-2.3}/dit/pid/measures/imes.py +0 -0
- {dit-2.2 → dit-2.3}/dit/pid/measures/imin.py +0 -0
- {dit-2.2 → dit-2.3}/dit/pid/measures/immi.py +0 -0
- {dit-2.2 → dit-2.3}/dit/pid/measures/ipm.py +0 -0
- {dit-2.2 → dit-2.3}/dit/pid/measures/iprec.py +0 -0
- {dit-2.2 → dit-2.3}/dit/pid/measures/iproj.py +0 -0
- {dit-2.2 → dit-2.3}/dit/pid/measures/irav.py +0 -0
- {dit-2.2 → dit-2.3}/dit/pid/measures/irdr.py +0 -0
- {dit-2.2 → dit-2.3}/dit/pid/measures/irr.py +0 -0
- {dit-2.2 → dit-2.3}/dit/pid/measures/iskar.py +0 -0
- {dit-2.2 → dit-2.3}/dit/pid/measures/isx.py +0 -0
- {dit-2.2 → dit-2.3}/dit/pid/measures/iwedge.py +0 -0
- {dit-2.2 → dit-2.3}/dit/pid/ped.py +0 -0
- {dit-2.2 → dit-2.3}/dit/pid/pid.py +0 -0
- {dit-2.2 → dit-2.3}/dit/pid/syndisc.py +0 -0
- {dit-2.2 → dit-2.3}/dit/profiles/base_profile.py +0 -0
- {dit-2.2 → dit-2.3}/dit/profiles/complexity_profile.py +0 -0
- {dit-2.2 → dit-2.3}/dit/profiles/entropy_triangle.py +0 -0
- {dit-2.2 → dit-2.3}/dit/profiles/marginal_utility_of_information.py +0 -0
- {dit-2.2 → dit-2.3}/dit/profiles/shapley_info_decomposition.py +0 -0
- {dit-2.2 → dit-2.3}/dit/rate_distortion/__init__.py +0 -0
- {dit-2.2 → dit-2.3}/dit/rate_distortion/blahut_arimoto.py +0 -0
- {dit-2.2 → dit-2.3}/dit/rate_distortion/bottleneck_algorithms.py +0 -0
- {dit-2.2 → dit-2.3}/dit/rate_distortion/curves.py +0 -0
- {dit-2.2 → dit-2.3}/dit/rate_distortion/distortions.py +0 -0
- {dit-2.2 → dit-2.3}/dit/rate_distortion/gray_wyner/curve.py +0 -0
- {dit-2.2 → dit-2.3}/dit/rate_distortion/information_bottleneck.py +0 -0
- {dit-2.2 → dit-2.3}/dit/rate_distortion/plotting.py +0 -0
- {dit-2.2 → dit-2.3}/dit/rate_distortion/rate_distortion.py +0 -0
- {dit-2.2 → dit-2.3}/dit/samplespace.py +0 -0
- {dit-2.2 → dit-2.3}/dit/shannon/__init__.py +0 -0
- {dit-2.2 → dit-2.3}/dit/shannon/shannon.py +0 -0
- {dit-2.2 → dit-2.3}/dit/symbolic/__init__.py +0 -0
- {dit-2.2 → dit-2.3}/dit/symbolic/distributions.py +0 -0
- {dit-2.2 → dit-2.3}/dit/utils/__init__.py +0 -0
- {dit-2.2 → dit-2.3}/dit/utils/bindargs.py +0 -0
- {dit-2.2 → dit-2.3}/dit/utils/context.py +0 -0
- {dit-2.2 → dit-2.3}/dit/utils/latexarray.py +0 -0
- {dit-2.2 → dit-2.3}/dit/utils/logger.py +0 -0
- {dit-2.2 → dit-2.3}/dit/utils/misc.py +0 -0
- {dit-2.2 → dit-2.3}/dit/utils/optimization.py +0 -0
- {dit-2.2 → dit-2.3}/dit/utils/table.py +0 -0
- {dit-2.2 → dit-2.3}/dit/utils/testing.py +0 -0
- {dit-2.2 → dit-2.3}/dit/utils/units.py +0 -0
- {dit-2.2 → dit-2.3}/dit/validate.py +0 -0
- {dit-2.2 → dit-2.3}/dit/visualization/__init__.py +0 -0
- {dit-2.2 → dit-2.3}/dit/visualization/upset.py +0 -0
- {dit-2.2 → dit-2.3}/tests/__init__.py +0 -0
- {dit-2.2 → dit-2.3}/tests/_backends.py +0 -0
- {dit-2.2 → dit-2.3}/tests/algorithms/__init__.py +0 -0
- {dit-2.2 → dit-2.3}/tests/algorithms/test_admui.py +0 -0
- {dit-2.2 → dit-2.3}/tests/algorithms/test_broja_cone.py +0 -0
- {dit-2.2 → dit-2.3}/tests/algorithms/test_caekl_psp_optimizer.py +0 -0
- {dit-2.2 → dit-2.3}/tests/algorithms/test_channelcapacity.py +0 -0
- {dit-2.2 → dit-2.3}/tests/algorithms/test_degrees_of_freedom.py +0 -0
- {dit-2.2 → dit-2.3}/tests/algorithms/test_ipf.py +0 -0
- {dit-2.2 → dit-2.3}/tests/algorithms/test_lattice.py +0 -0
- {dit-2.2 → dit-2.3}/tests/algorithms/test_marginal_constraints.py +0 -0
- {dit-2.2 → dit-2.3}/tests/algorithms/test_maxentropy_fast.py +0 -0
- {dit-2.2 → dit-2.3}/tests/algorithms/test_minimal_sufficient_statistic.py +0 -0
- {dit-2.2 → dit-2.3}/tests/algorithms/test_optimizers.py +0 -0
- {dit-2.2 → dit-2.3}/tests/algorithms/test_parallel_sweep.py +0 -0
- {dit-2.2 → dit-2.3}/tests/algorithms/test_prune_expand.py +0 -0
- {dit-2.2 → dit-2.3}/tests/algorithms/test_stats.py +0 -0
- {dit-2.2 → dit-2.3}/tests/algorithms/test_submodular.py +0 -0
- {dit-2.2 → dit-2.3}/tests/channelorder/__init__.py +0 -0
- {dit-2.2 → dit-2.3}/tests/channelorder/test_deficiency.py +0 -0
- {dit-2.2 → dit-2.3}/tests/channelorder/test_orderings.py +0 -0
- {dit-2.2 → dit-2.3}/tests/channelorder/test_properties.py +0 -0
- {dit-2.2 → dit-2.3}/tests/channelorder/test_utils.py +0 -0
- {dit-2.2 → dit-2.3}/tests/coding/__init__.py +0 -0
- {dit-2.2 → dit-2.3}/tests/coding/test_base.py +0 -0
- {dit-2.2 → dit-2.3}/tests/coding/test_channel.py +0 -0
- {dit-2.2 → dit-2.3}/tests/coding/test_channel_codes.py +0 -0
- {dit-2.2 → dit-2.3}/tests/coding/test_edge_cases.py +0 -0
- {dit-2.2 → dit-2.3}/tests/coding/test_gf2.py +0 -0
- {dit-2.2 → dit-2.3}/tests/coding/test_golomb.py +0 -0
- {dit-2.2 → dit-2.3}/tests/coding/test_linear.py +0 -0
- {dit-2.2 → dit-2.3}/tests/coding/test_source_edges.py +0 -0
- {dit-2.2 → dit-2.3}/tests/coding/test_source_polar.py +0 -0
- {dit-2.2 → dit-2.3}/tests/coding/test_symbol_codes.py +0 -0
- {dit-2.2 → dit-2.3}/tests/coding/test_tunstall.py +0 -0
- {dit-2.2 → dit-2.3}/tests/coding/test_universal.py +0 -0
- {dit-2.2 → dit-2.3}/tests/conftest.py +0 -0
- {dit-2.2 → dit-2.3}/tests/divergences/__init__.py +0 -0
- {dit-2.2 → dit-2.3}/tests/divergences/test_copy_mutual_information.py +0 -0
- {dit-2.2 → dit-2.3}/tests/divergences/test_coupling_metrics.py +0 -0
- {dit-2.2 → dit-2.3}/tests/divergences/test_cross_entropy.py +0 -0
- {dit-2.2 → dit-2.3}/tests/divergences/test_emd.py +0 -0
- {dit-2.2 → dit-2.3}/tests/divergences/test_generalized_divergences.py +0 -0
- {dit-2.2 → dit-2.3}/tests/divergences/test_hypercontractivity_coefficient.py +0 -0
- {dit-2.2 → dit-2.3}/tests/divergences/test_jensen_shannon_divergence.py +0 -0
- {dit-2.2 → dit-2.3}/tests/divergences/test_kullback_leibler_divergence.py +0 -0
- {dit-2.2 → dit-2.3}/tests/divergences/test_maximum_correlation.py +0 -0
- {dit-2.2 → dit-2.3}/tests/divergences/test_nonmerge.py +0 -0
- {dit-2.2 → dit-2.3}/tests/divergences/test_variational_distance.py +0 -0
- {dit-2.2 → dit-2.3}/tests/example_channels/__init__.py +0 -0
- {dit-2.2 → dit-2.3}/tests/example_channels/test_binary.py +0 -0
- {dit-2.2 → dit-2.3}/tests/example_channels/test_qary.py +0 -0
- {dit-2.2 → dit-2.3}/tests/example_channels/test_trivial.py +0 -0
- {dit-2.2 → dit-2.3}/tests/example_channels/test_util.py +0 -0
- {dit-2.2 → dit-2.3}/tests/example_dists/__init__.py +0 -0
- {dit-2.2 → dit-2.3}/tests/example_dists/empirical/__init__.py +0 -0
- {dit-2.2 → dit-2.3}/tests/example_dists/empirical/test_bach.py +0 -0
- {dit-2.2 → dit-2.3}/tests/example_dists/empirical/test_blood_types.py +0 -0
- {dit-2.2 → dit-2.3}/tests/example_dists/empirical/test_car.py +0 -0
- {dit-2.2 → dit-2.3}/tests/example_dists/empirical/test_congress.py +0 -0
- {dit-2.2 → dit-2.3}/tests/example_dists/empirical/test_corelli.py +0 -0
- {dit-2.2 → dit-2.3}/tests/example_dists/empirical/test_penguins.py +0 -0
- {dit-2.2 → dit-2.3}/tests/example_dists/empirical/test_student.py +0 -0
- {dit-2.2 → dit-2.3}/tests/example_dists/empirical/test_titanic.py +0 -0
- {dit-2.2 → dit-2.3}/tests/example_dists/test_circuits.py +0 -0
- {dit-2.2 → dit-2.3}/tests/example_dists/test_dependencies.py +0 -0
- {dit-2.2 → dit-2.3}/tests/example_dists/test_dice.py +0 -0
- {dit-2.2 → dit-2.3}/tests/example_dists/test_giant_bit.py +0 -0
- {dit-2.2 → dit-2.3}/tests/example_dists/test_mdbsi.py +0 -0
- {dit-2.2 → dit-2.3}/tests/example_dists/test_miscellaneous.py +0 -0
- {dit-2.2 → dit-2.3}/tests/example_dists/test_n_mod_m.py +0 -0
- {dit-2.2 → dit-2.3}/tests/example_dists/test_numeric.py +0 -0
- {dit-2.2 → dit-2.3}/tests/example_dists/test_pr_box.py +0 -0
- {dit-2.2 → dit-2.3}/tests/inference/__init__.py +0 -0
- {dit-2.2 → dit-2.3}/tests/inference/test_binning.py +0 -0
- {dit-2.2 → dit-2.3}/tests/inference/test_counts.py +0 -0
- {dit-2.2 → dit-2.3}/tests/inference/test_estimators.py +0 -0
- {dit-2.2 → dit-2.3}/tests/inference/test_knn_estimators.py +0 -0
- {dit-2.2 → dit-2.3}/tests/inference/test_segmentaxis.py +0 -0
- {dit-2.2 → dit-2.3}/tests/inference/test_timeseries.py +0 -0
- {dit-2.2 → dit-2.3}/tests/math/__init__.py +0 -0
- {dit-2.2 → dit-2.3}/tests/math/test_aitchison.py +0 -0
- {dit-2.2 → dit-2.3}/tests/math/test_combinatorics.py +0 -0
- {dit-2.2 → dit-2.3}/tests/math/test_equal.py +0 -0
- {dit-2.2 → dit-2.3}/tests/math/test_fraction.py +0 -0
- {dit-2.2 → dit-2.3}/tests/math/test_misc.py +0 -0
- {dit-2.2 → dit-2.3}/tests/math/test_ops.py +0 -0
- {dit-2.2 → dit-2.3}/tests/math/test_pmfops.py +0 -0
- {dit-2.2 → dit-2.3}/tests/math/test_sampling.py +0 -0
- {dit-2.2 → dit-2.3}/tests/math/test_sigmaalgebra.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/__init__.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/common_informations/__init__.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/common_informations/test_backend_switching.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/common_informations/test_beta_common_information.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/common_informations/test_common_informations.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/common_informations/test_functional_common_information.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/common_informations/test_gk_common_information.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/common_informations/test_kamath_common_information.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/common_informations/test_maxent_function.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/common_informations/test_mss_common_information.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/common_informations/test_stochastic_gk_common_information.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/common_informations/test_wyner_common_information.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/secret_key_agreement/__init__.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/secret_key_agreement/test_interactive_intrinsic_mutual_information.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/secret_key_agreement/test_intrinsic_mutual_information.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/secret_key_agreement/test_lower_intrinsic_mutual_information.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/secret_key_agreement/test_minimal_intrinsic_mutual_information.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/secret_key_agreement/test_necessary_intrinsic_mutual_information.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/secret_key_agreement/test_reduced_intrinsic_mutual_information.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/secret_key_agreement/test_secrecy_capacity.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/secret_key_agreement/test_skars.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/secret_key_agreement/test_trivial_bounds.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/secret_key_agreement/test_two_part_intrinsic_mutual_information.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/secret_key_agreement/test_two_way_skar.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/test_caekl_mutual_information.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/test_cohesion.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/test_coinformation.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/test_cross_mutual_information.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/test_delta_gamma.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/test_deweese.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/test_dual_total_correlation.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/test_entropy.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/test_interaction_information.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/test_logarithmic_decomposition.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/test_mmi_psp.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/test_mutual_informations.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/test_necessary_conditional_entropy.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/test_o_information.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/test_quax_synergy.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/test_s_information.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/test_synergistic_disclosure.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/test_total_correlation.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/test_transmission.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/test_tse_complexity.py +0 -0
- {dit-2.2 → dit-2.3}/tests/multivariate/test_union_information.py +0 -0
- {dit-2.2 → dit-2.3}/tests/other/__init__.py +0 -0
- {dit-2.2 → dit-2.3}/tests/other/test_cumulative_residual_entropy.py +0 -0
- {dit-2.2 → dit-2.3}/tests/other/test_disequilibrium.py +0 -0
- {dit-2.2 → dit-2.3}/tests/other/test_extropy.py +0 -0
- {dit-2.2 → dit-2.3}/tests/other/test_lautum_information.py +0 -0
- {dit-2.2 → dit-2.3}/tests/other/test_negentropy.py +0 -0
- {dit-2.2 → dit-2.3}/tests/other/test_perplexity.py +0 -0
- {dit-2.2 → dit-2.3}/tests/other/test_renyi_entropy.py +0 -0
- {dit-2.2 → dit-2.3}/tests/other/test_sibson_mutual_information.py +0 -0
- {dit-2.2 → dit-2.3}/tests/other/test_tsallis_entropy.py +0 -0
- {dit-2.2 → dit-2.3}/tests/pid/__init__.py +0 -0
- {dit-2.2 → dit-2.3}/tests/pid/test_hcs.py +0 -0
- {dit-2.2 → dit-2.3}/tests/pid/test_hmos.py +0 -0
- {dit-2.2 → dit-2.3}/tests/pid/test_ibroja.py +0 -0
- {dit-2.2 → dit-2.3}/tests/pid/test_iccs.py +0 -0
- {dit-2.2 → dit-2.3}/tests/pid/test_ict.py +0 -0
- {dit-2.2 → dit-2.3}/tests/pid/test_ideg.py +0 -0
- {dit-2.2 → dit-2.3}/tests/pid/test_idelta.py +0 -0
- {dit-2.2 → dit-2.3}/tests/pid/test_idep.py +0 -0
- {dit-2.2 → dit-2.3}/tests/pid/test_ido.py +0 -0
- {dit-2.2 → dit-2.3}/tests/pid/test_igh.py +0 -0
- {dit-2.2 → dit-2.3}/tests/pid/test_iig.py +0 -0
- {dit-2.2 → dit-2.3}/tests/pid/test_iipid.py +0 -0
- {dit-2.2 → dit-2.3}/tests/pid/test_imc.py +0 -0
- {dit-2.2 → dit-2.3}/tests/pid/test_imes.py +0 -0
- {dit-2.2 → dit-2.3}/tests/pid/test_imin.py +0 -0
- {dit-2.2 → dit-2.3}/tests/pid/test_immi.py +0 -0
- {dit-2.2 → dit-2.3}/tests/pid/test_ipm.py +0 -0
- {dit-2.2 → dit-2.3}/tests/pid/test_iprec.py +0 -0
- {dit-2.2 → dit-2.3}/tests/pid/test_iproj.py +0 -0
- {dit-2.2 → dit-2.3}/tests/pid/test_irav.py +0 -0
- {dit-2.2 → dit-2.3}/tests/pid/test_irdr.py +0 -0
- {dit-2.2 → dit-2.3}/tests/pid/test_irr.py +0 -0
- {dit-2.2 → dit-2.3}/tests/pid/test_iskar.py +0 -0
- {dit-2.2 → dit-2.3}/tests/pid/test_isx.py +0 -0
- {dit-2.2 → dit-2.3}/tests/pid/test_iwedge.py +0 -0
- {dit-2.2 → dit-2.3}/tests/pid/test_modified_syndisc.py +0 -0
- {dit-2.2 → dit-2.3}/tests/pid/test_pid_distribution.py +0 -0
- {dit-2.2 → dit-2.3}/tests/pid/test_syndisc.py +0 -0
- {dit-2.2 → dit-2.3}/tests/pid/test_syndisc_fast.py +0 -0
- {dit-2.2 → dit-2.3}/tests/pid/test_syndisc_lattice.py +0 -0
- {dit-2.2 → dit-2.3}/tests/profiles/__init__.py +0 -0
- {dit-2.2 → dit-2.3}/tests/profiles/test_base_profile.py +0 -0
- {dit-2.2 → dit-2.3}/tests/profiles/test_complexity_profile.py +0 -0
- {dit-2.2 → dit-2.3}/tests/profiles/test_entropy_triangle.py +0 -0
- {dit-2.2 → dit-2.3}/tests/profiles/test_information_partitions.py +0 -0
- {dit-2.2 → dit-2.3}/tests/profiles/test_mui.py +0 -0
- {dit-2.2 → dit-2.3}/tests/profiles/test_schneidman.py +0 -0
- {dit-2.2 → dit-2.3}/tests/profiles/test_shapley_info_decomposition.py +0 -0
- {dit-2.2 → dit-2.3}/tests/rate_distortion/__init__.py +0 -0
- {dit-2.2 → dit-2.3}/tests/rate_distortion/test_bottleneck_algorithms.py +0 -0
- {dit-2.2 → dit-2.3}/tests/rate_distortion/test_curves.py +0 -0
- {dit-2.2 → dit-2.3}/tests/rate_distortion/test_gray_wyner.py +0 -0
- {dit-2.2 → dit-2.3}/tests/rate_distortion/test_ib.py +0 -0
- {dit-2.2 → dit-2.3}/tests/rate_distortion/test_rd.py +0 -0
- {dit-2.2 → dit-2.3}/tests/shannon/__init__.py +0 -0
- {dit-2.2 → dit-2.3}/tests/shannon/test_shannon.py +0 -0
- {dit-2.2 → dit-2.3}/tests/symbolic/__init__.py +0 -0
- {dit-2.2 → dit-2.3}/tests/symbolic/test_common_information.py +0 -0
- {dit-2.2 → dit-2.3}/tests/symbolic/test_cross_validation.py +0 -0
- {dit-2.2 → dit-2.3}/tests/symbolic/test_symbolic.py +0 -0
- {dit-2.2 → dit-2.3}/tests/test_abstractdist.py +0 -0
- {dit-2.2 → dit-2.3}/tests/test_bgm.py +0 -0
- {dit-2.2 → dit-2.3}/tests/test_cdisthelpers.py +0 -0
- {dit-2.2 → dit-2.3}/tests/test_distconst.py +0 -0
- {dit-2.2 → dit-2.3}/tests/test_distribution_coverage.py +0 -0
- {dit-2.2 → dit-2.3}/tests/test_exceptions.py +0 -0
- {dit-2.2 → dit-2.3}/tests/test_helpers.py +0 -0
- {dit-2.2 → dit-2.3}/tests/test_inequalities.py +0 -0
- {dit-2.2 → dit-2.3}/tests/test_params.py +0 -0
- {dit-2.2 → dit-2.3}/tests/test_samplespace.py +0 -0
- {dit-2.2 → dit-2.3}/tests/test_validate.py +0 -0
- {dit-2.2 → dit-2.3}/tests/utils/__init__.py +0 -0
- {dit-2.2 → dit-2.3}/tests/utils/test_bindargs.py +0 -0
- {dit-2.2 → dit-2.3}/tests/utils/test_bindargs3.py +0 -0
- {dit-2.2 → dit-2.3}/tests/utils/test_context.py +0 -0
- {dit-2.2 → dit-2.3}/tests/utils/test_latexarray.py +0 -0
- {dit-2.2 → dit-2.3}/tests/utils/test_misc.py +0 -0
- {dit-2.2 → dit-2.3}/tests/utils/test_optimization.py +0 -0
- {dit-2.2 → dit-2.3}/tests/utils/test_table.py +0 -0
- {dit-2.2 → dit-2.3}/tests/utils/test_testing.py +0 -0
- {dit-2.2 → dit-2.3}/tests/utils/test_units.py +0 -0
- {dit-2.2 → dit-2.3}/tests/visualization/__init__.py +0 -0
- {dit-2.2 → dit-2.3}/tests/visualization/test_upset.py +0 -0
{dit-2.2 → dit-2.3}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: dit
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.3
|
|
4
4
|
Summary: Python package for information theory on discrete random variables.
|
|
5
5
|
Project-URL: Homepage, http://dit.io
|
|
6
6
|
Project-URL: Repository, https://github.com/dit/dit
|
|
@@ -10,8 +10,6 @@ License-Expression: BSD-3-Clause
|
|
|
10
10
|
License-File: LICENSE.txt
|
|
11
11
|
Classifier: Intended Audience :: Science/Research
|
|
12
12
|
Classifier: License :: OSI Approved :: BSD License
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
15
13
|
Classifier: Programming Language :: Python :: 3.11
|
|
16
14
|
Classifier: Programming Language :: Python :: 3.12
|
|
17
15
|
Classifier: Programming Language :: Python :: 3.13
|
|
@@ -10,7 +10,13 @@ Python package for sigma-algebras defined on finite sets.
|
|
|
10
10
|
|
|
11
11
|
"""
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
from importlib.metadata import PackageNotFoundError
|
|
14
|
+
from importlib.metadata import version as _pkg_version
|
|
15
|
+
|
|
16
|
+
try:
|
|
17
|
+
__version__ = _pkg_version("dit")
|
|
18
|
+
except PackageNotFoundError: # pragma: no cover
|
|
19
|
+
__version__ = "0.0.0"
|
|
14
20
|
|
|
15
21
|
from loguru import logger as _logger
|
|
16
22
|
|
|
@@ -12,6 +12,17 @@ from .maxentropyfw import *
|
|
|
12
12
|
from .minimal_sufficient_statistic import *
|
|
13
13
|
from .optimization import *
|
|
14
14
|
from .distribution_optimizers import *
|
|
15
|
+
from .mixture_of_products import fit_mixture_of_products, mixture_of_products_dists
|
|
16
|
+
from .marginal_lifts import fit_marginal_lift_mixture, lift_marginal, marginal_lift_dists
|
|
17
|
+
from .mprojection import (
|
|
18
|
+
m_projection,
|
|
19
|
+
m_projection_eps_limit,
|
|
20
|
+
m_projection_from_subsets,
|
|
21
|
+
mflat_design_matrix,
|
|
22
|
+
mflat_mprojection_dists,
|
|
23
|
+
mflat_subsets_from_dependency,
|
|
24
|
+
symmetric_smooth,
|
|
25
|
+
)
|
|
15
26
|
from .prune_expand import expanded_samplespace, pruned_samplespace
|
|
16
27
|
from .stats import (
|
|
17
28
|
cdf,
|
|
@@ -34,6 +45,11 @@ from .stats import (
|
|
|
34
45
|
standard_moment,
|
|
35
46
|
variance,
|
|
36
47
|
)
|
|
48
|
+
from .support_spectrum import (
|
|
49
|
+
spectral_entanglement_bound,
|
|
50
|
+
support_biadjacency,
|
|
51
|
+
support_singular_values,
|
|
52
|
+
)
|
|
37
53
|
|
|
38
54
|
# Don't expose anything yet.
|
|
39
55
|
# from . import pid_broja
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Convex combinations of lifts of a joint's own marginals.
|
|
3
|
+
|
|
4
|
+
At order :math:`k`, form building blocks
|
|
5
|
+
|
|
6
|
+
.. math::
|
|
7
|
+
|
|
8
|
+
\\bigl\\{ U \\bigr\\} \\cup
|
|
9
|
+
\\bigl\\{ \\mathrm{Lift}(P_S) : 1 \\le |S| \\le k \\bigr\\}
|
|
10
|
+
|
|
11
|
+
and fit nonnegative weights summing to one by least squares:
|
|
12
|
+
|
|
13
|
+
.. math::
|
|
14
|
+
|
|
15
|
+
Q^{(k)} = \\arg\\min_{\\alpha \\ge 0,\\ \\sum \\alpha = 1}
|
|
16
|
+
\\bigl\\| P - \\textstyle\\sum_S \\alpha_S \\mathrm{Lift}(P_S) \\bigr\\|_2^2.
|
|
17
|
+
|
|
18
|
+
Lifts:
|
|
19
|
+
|
|
20
|
+
* ``uniform`` — :math:`P_S \\otimes U_{X \\setminus S}`
|
|
21
|
+
* ``product`` — :math:`P_S \\otimes \\prod_{i \\notin S} P_i`
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
from collections import defaultdict
|
|
25
|
+
from copy import deepcopy
|
|
26
|
+
from itertools import combinations, product
|
|
27
|
+
|
|
28
|
+
import numpy as np
|
|
29
|
+
from scipy.optimize import minimize
|
|
30
|
+
|
|
31
|
+
from ..algorithms.optutil import prepare_dist
|
|
32
|
+
from ..distribution import Distribution
|
|
33
|
+
from ..exceptions import ditException
|
|
34
|
+
|
|
35
|
+
__all__ = (
|
|
36
|
+
"lift_marginal",
|
|
37
|
+
"fit_marginal_lift_mixture",
|
|
38
|
+
"marginal_lift_dists",
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def _cartesian(dist):
|
|
43
|
+
d = prepare_dist(deepcopy(dist))
|
|
44
|
+
n = d.outcome_length()
|
|
45
|
+
alph = [tuple(sorted({o[i] for o in d.outcomes})) for i in range(n)]
|
|
46
|
+
outs = list(product(*alph))
|
|
47
|
+
pmf_map = {tuple(o): float(p) for o, p in zip(d.outcomes, d.pmf, strict=True)}
|
|
48
|
+
pmf = np.array([pmf_map.get(o, 0.0) for o in outs], dtype=float)
|
|
49
|
+
pmf /= pmf.sum()
|
|
50
|
+
return outs, pmf, alph, d
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def lift_marginal(outs, pmf, alph, S, mode="uniform"):
|
|
54
|
+
"""
|
|
55
|
+
Lift a marginal on coordinates ``S`` to a full joint pmf.
|
|
56
|
+
|
|
57
|
+
Parameters
|
|
58
|
+
----------
|
|
59
|
+
outs, pmf, alph
|
|
60
|
+
Dense Cartesian table for the joint.
|
|
61
|
+
S : tuple of int
|
|
62
|
+
Variable indices of the marginal.
|
|
63
|
+
mode : {'uniform', 'product'}
|
|
64
|
+
How to extend off ``S``.
|
|
65
|
+
"""
|
|
66
|
+
n = len(alph)
|
|
67
|
+
S = tuple(S)
|
|
68
|
+
marg = defaultdict(float)
|
|
69
|
+
for o, p in zip(outs, pmf, strict=True):
|
|
70
|
+
marg[tuple(o[i] for i in S)] += p
|
|
71
|
+
rest = [i for i in range(n) if i not in S]
|
|
72
|
+
if mode == "uniform":
|
|
73
|
+
rest_size = int(np.prod([len(alph[i]) for i in rest])) if rest else 1
|
|
74
|
+
return np.array([marg[tuple(o[i] for i in S)] / rest_size for o in outs], dtype=float)
|
|
75
|
+
if mode != "product":
|
|
76
|
+
msg = f"unknown lift mode {mode!r}"
|
|
77
|
+
raise ditException(msg)
|
|
78
|
+
ones = []
|
|
79
|
+
for i in range(n):
|
|
80
|
+
m1 = defaultdict(float)
|
|
81
|
+
for o, p in zip(outs, pmf, strict=True):
|
|
82
|
+
m1[o[i]] += p
|
|
83
|
+
ones.append(m1)
|
|
84
|
+
q = np.empty(len(outs), dtype=float)
|
|
85
|
+
for t, o in enumerate(outs):
|
|
86
|
+
val = marg[tuple(o[i] for i in S)]
|
|
87
|
+
for i in rest:
|
|
88
|
+
val *= ones[i][o[i]]
|
|
89
|
+
q[t] = val
|
|
90
|
+
return q / q.sum()
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def fit_marginal_lift_mixture(dist, order, mode="uniform", n_init=12, seed=0):
|
|
94
|
+
"""
|
|
95
|
+
Fit a convex combination of lifts of marginals of order at most ``order``.
|
|
96
|
+
|
|
97
|
+
Returns
|
|
98
|
+
-------
|
|
99
|
+
result : dict
|
|
100
|
+
Keys ``dist``, ``labels``, ``alpha``, ``L2``.
|
|
101
|
+
"""
|
|
102
|
+
if order < 0:
|
|
103
|
+
msg = "order must be nonnegative"
|
|
104
|
+
raise ditException(msg)
|
|
105
|
+
outs, pmf, alph, template = _cartesian(dist)
|
|
106
|
+
n = len(alph)
|
|
107
|
+
order = min(order, n)
|
|
108
|
+
|
|
109
|
+
blocks, labels = [], []
|
|
110
|
+
blocks.append(np.ones(len(outs)) / len(outs))
|
|
111
|
+
labels.append(())
|
|
112
|
+
for k in range(1, order + 1):
|
|
113
|
+
for S in combinations(range(n), k):
|
|
114
|
+
blocks.append(lift_marginal(outs, pmf, alph, S, mode=mode))
|
|
115
|
+
labels.append(S)
|
|
116
|
+
A = np.column_stack(blocks)
|
|
117
|
+
nb = A.shape[1]
|
|
118
|
+
|
|
119
|
+
def loss(x):
|
|
120
|
+
return float(np.sum((A @ x - pmf) ** 2))
|
|
121
|
+
|
|
122
|
+
cons = {"type": "eq", "fun": lambda x: float(x.sum() - 1.0)}
|
|
123
|
+
best = None
|
|
124
|
+
rng = np.random.default_rng(seed)
|
|
125
|
+
for _ in range(n_init):
|
|
126
|
+
x0 = rng.dirichlet(np.ones(nb))
|
|
127
|
+
res = minimize(
|
|
128
|
+
loss,
|
|
129
|
+
x0,
|
|
130
|
+
bounds=[(0.0, None)] * nb,
|
|
131
|
+
constraints=cons,
|
|
132
|
+
method="SLSQP",
|
|
133
|
+
options={"maxiter": 2000, "ftol": 1e-14, "disp": False},
|
|
134
|
+
)
|
|
135
|
+
if best is None or res.fun < best[0]:
|
|
136
|
+
best = (res.fun, res.x)
|
|
137
|
+
|
|
138
|
+
alpha = np.maximum(best[1], 0.0)
|
|
139
|
+
alpha = alpha / alpha.sum()
|
|
140
|
+
q = A @ alpha
|
|
141
|
+
q = np.maximum(q, 0.0)
|
|
142
|
+
q = q / q.sum()
|
|
143
|
+
qd = Distribution(outs, q, base="linear", validate=False)
|
|
144
|
+
qd.normalize()
|
|
145
|
+
if template.get_rv_names() is not None:
|
|
146
|
+
qd.set_rv_names(template.get_rv_names())
|
|
147
|
+
return {
|
|
148
|
+
"dist": qd,
|
|
149
|
+
"labels": labels,
|
|
150
|
+
"alpha": alpha,
|
|
151
|
+
"L2": float(np.sqrt(best[0])),
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
def marginal_lift_dists(dist, k_max=None, mode="uniform", n_init=12, seed=0):
|
|
156
|
+
"""
|
|
157
|
+
Ladder of marginal-lift mixtures for orders :math:`0,\\ldots,k_{\\max}`.
|
|
158
|
+
|
|
159
|
+
Order 0 is the uniform distribution. Order :math:`n` includes the full
|
|
160
|
+
joint as a block and recovers :math:`P` exactly.
|
|
161
|
+
"""
|
|
162
|
+
n = dist.outcome_length()
|
|
163
|
+
if k_max is None:
|
|
164
|
+
k_max = n
|
|
165
|
+
k_max = min(int(k_max), n)
|
|
166
|
+
|
|
167
|
+
dists = []
|
|
168
|
+
metas = []
|
|
169
|
+
for k in range(0, k_max + 1):
|
|
170
|
+
if k == 0:
|
|
171
|
+
outs, _, _, template = _cartesian(dist)
|
|
172
|
+
q = Distribution(outs, np.ones(len(outs)) / len(outs), base="linear", validate=False)
|
|
173
|
+
q.normalize()
|
|
174
|
+
if template.get_rv_names() is not None:
|
|
175
|
+
q.set_rv_names(template.get_rv_names())
|
|
176
|
+
dists.append(q)
|
|
177
|
+
metas.append({"labels": [()], "alpha": np.array([1.0]), "L2": None})
|
|
178
|
+
else:
|
|
179
|
+
fit = fit_marginal_lift_mixture(dist, k, mode=mode, n_init=n_init, seed=seed + k)
|
|
180
|
+
dists.append(fit["dist"])
|
|
181
|
+
metas.append({key: fit[key] for key in ("labels", "alpha", "L2")})
|
|
182
|
+
return dists, metas
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Mixtures of fully factorized distributions (latent-class / naive-Bayes).
|
|
3
|
+
|
|
4
|
+
The family
|
|
5
|
+
|
|
6
|
+
.. math::
|
|
7
|
+
|
|
8
|
+
\\mathcal{F}_k = \\Bigl\\{
|
|
9
|
+
Q : Q(x) = \\sum_{\\alpha=1}^{k} \\pi_\\alpha
|
|
10
|
+
\\prod_{i=1}^{n} Q_i(x_i \\mid \\alpha)
|
|
11
|
+
\\Bigr\\}
|
|
12
|
+
|
|
13
|
+
is the standard representation underlying Wyner common information: variables
|
|
14
|
+
are independent given a discrete latent of cardinality :math:`k`. Maximum
|
|
15
|
+
likelihood under :math:`P` is equivalent to the forward-KL projection
|
|
16
|
+
|
|
17
|
+
.. math::
|
|
18
|
+
|
|
19
|
+
Q^{(k)} = \\arg\\min_{Q \\in \\mathcal{F}_k} D(P \\Vert Q)
|
|
20
|
+
|
|
21
|
+
and is fit by EM. No support jitter is required: :math:`Q` may place mass
|
|
22
|
+
outside the support of a sparse :math:`P`.
|
|
23
|
+
|
|
24
|
+
See Rosas et al. (2019) for the shared-randomness / binding interpretation of
|
|
25
|
+
dual total correlation, and Wyner (1975) / Abdallah & Plumbley (2012) for the
|
|
26
|
+
common-information side.
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
from copy import deepcopy
|
|
30
|
+
from itertools import product
|
|
31
|
+
|
|
32
|
+
import numpy as np
|
|
33
|
+
|
|
34
|
+
from ..distribution import Distribution
|
|
35
|
+
from .optutil import prepare_dist
|
|
36
|
+
|
|
37
|
+
__all__ = (
|
|
38
|
+
"fit_mixture_of_products",
|
|
39
|
+
"mixture_of_products_dists",
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def _dense_table(dist):
|
|
44
|
+
"""
|
|
45
|
+
Expand ``dist`` onto its Cartesian sample space.
|
|
46
|
+
|
|
47
|
+
Returns
|
|
48
|
+
-------
|
|
49
|
+
outcomes : list of tuple
|
|
50
|
+
pmf : ndarray, shape (n_outcomes,)
|
|
51
|
+
X : ndarray, shape (n_outcomes, n_vars), integer-coded symbols
|
|
52
|
+
sizes : list of int
|
|
53
|
+
"""
|
|
54
|
+
d = prepare_dist(deepcopy(dist))
|
|
55
|
+
n = d.outcome_length()
|
|
56
|
+
alphabets = [tuple(sorted({o[i] for o in d.outcomes})) for i in range(n)]
|
|
57
|
+
outcomes = list(product(*alphabets))
|
|
58
|
+
pmf_map = {tuple(o): float(p) for o, p in zip(d.outcomes, d.pmf, strict=True)}
|
|
59
|
+
pmf = np.array([pmf_map.get(o, 0.0) for o in outcomes], dtype=float)
|
|
60
|
+
total = pmf.sum()
|
|
61
|
+
if total <= 0:
|
|
62
|
+
msg = "Distribution has no mass."
|
|
63
|
+
raise ValueError(msg)
|
|
64
|
+
pmf /= total
|
|
65
|
+
sym_index = [{s: j for j, s in enumerate(a)} for a in alphabets]
|
|
66
|
+
X = np.array([[sym_index[i][o[i]] for i in range(n)] for o in outcomes], dtype=int)
|
|
67
|
+
sizes = [len(a) for a in alphabets]
|
|
68
|
+
return outcomes, pmf, X, sizes
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def _component_logprob(pi, conds, X):
|
|
72
|
+
"""Log joint component densities ``log(π_α ∏_i Q_i(x_i|α))``, shape (k, n_out)."""
|
|
73
|
+
log_comp = np.log(pi + 1e-300)[:, None]
|
|
74
|
+
for i, cond in enumerate(conds):
|
|
75
|
+
log_comp = log_comp + np.log(cond[:, X[:, i]] + 1e-300)
|
|
76
|
+
return log_comp
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def _em_once(pmf, X, sizes, k, *, max_iter, tol, rng):
|
|
80
|
+
"""Single EM run. Returns (loglik, q_pmf, pi, conds, I_xv, H_v)."""
|
|
81
|
+
n_out, n = X.shape
|
|
82
|
+
pi = rng.dirichlet(np.ones(k))
|
|
83
|
+
conds = [rng.dirichlet(np.ones(s), size=k) for s in sizes]
|
|
84
|
+
prev_ll = -np.inf
|
|
85
|
+
|
|
86
|
+
for _ in range(max_iter):
|
|
87
|
+
log_comp = _component_logprob(pi, conds, X)
|
|
88
|
+
m = log_comp.max(axis=0, keepdims=True)
|
|
89
|
+
comp = np.exp(log_comp - m)
|
|
90
|
+
r = comp / (comp.sum(axis=0, keepdims=True) + 1e-300)
|
|
91
|
+
|
|
92
|
+
w = r * pmf[None, :]
|
|
93
|
+
pi = w.sum(axis=1)
|
|
94
|
+
pi = pi / (pi.sum() + 1e-300)
|
|
95
|
+
|
|
96
|
+
for i in range(n):
|
|
97
|
+
s = sizes[i]
|
|
98
|
+
c = np.zeros((k, s))
|
|
99
|
+
for a in range(k):
|
|
100
|
+
for v in range(s):
|
|
101
|
+
c[a, v] = w[a, X[:, i] == v].sum()
|
|
102
|
+
c[a] /= c[a].sum() + 1e-300
|
|
103
|
+
conds[i] = c
|
|
104
|
+
|
|
105
|
+
log_comp = _component_logprob(pi, conds, X)
|
|
106
|
+
m = log_comp.max(axis=0)
|
|
107
|
+
ll = float(np.sum(pmf * (m + np.log(np.exp(log_comp - m).sum(axis=0) + 1e-300))))
|
|
108
|
+
if abs(ll - prev_ll) < tol:
|
|
109
|
+
break
|
|
110
|
+
prev_ll = ll
|
|
111
|
+
|
|
112
|
+
log_comp = _component_logprob(pi, conds, X)
|
|
113
|
+
m = log_comp.max(axis=0)
|
|
114
|
+
q = np.exp(m) * np.exp(log_comp - m).sum(axis=0)
|
|
115
|
+
q = q / q.sum()
|
|
116
|
+
|
|
117
|
+
# Responsibilities under the data for I(X; V).
|
|
118
|
+
m = log_comp.max(axis=0, keepdims=True)
|
|
119
|
+
r = np.exp(log_comp - m)
|
|
120
|
+
r = r / (r.sum(axis=0, keepdims=True) + 1e-300)
|
|
121
|
+
p_a = (r * pmf[None, :]).sum(axis=1)
|
|
122
|
+
p_a = p_a / (p_a.sum() + 1e-300)
|
|
123
|
+
hv = float(-np.sum(p_a[p_a > 0] * np.log2(p_a[p_a > 0])))
|
|
124
|
+
hv_x = 0.0
|
|
125
|
+
for t in range(n_out):
|
|
126
|
+
if pmf[t] <= 0:
|
|
127
|
+
continue
|
|
128
|
+
rt = r[:, t]
|
|
129
|
+
rt = rt[rt > 0]
|
|
130
|
+
hv_x += float(pmf[t] * (-np.sum(rt * np.log2(rt))))
|
|
131
|
+
ixv = hv - hv_x
|
|
132
|
+
|
|
133
|
+
return ll, q, pi, conds, float(ixv), hv
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
def fit_mixture_of_products(
|
|
137
|
+
dist,
|
|
138
|
+
k,
|
|
139
|
+
*,
|
|
140
|
+
n_init=12,
|
|
141
|
+
max_iter=200,
|
|
142
|
+
tol=1e-10,
|
|
143
|
+
seed=0,
|
|
144
|
+
):
|
|
145
|
+
"""
|
|
146
|
+
Fit a :math:`k`-mixture of product distributions to ``dist`` by EM.
|
|
147
|
+
|
|
148
|
+
Parameters
|
|
149
|
+
----------
|
|
150
|
+
dist : Distribution
|
|
151
|
+
Target joint.
|
|
152
|
+
k : int
|
|
153
|
+
Number of mixture components.
|
|
154
|
+
n_init, max_iter : int
|
|
155
|
+
Random restarts and EM iteration cap.
|
|
156
|
+
tol : float
|
|
157
|
+
Log-likelihood convergence tolerance.
|
|
158
|
+
seed : int
|
|
159
|
+
RNG seed for restarts.
|
|
160
|
+
|
|
161
|
+
Returns
|
|
162
|
+
-------
|
|
163
|
+
result : dict
|
|
164
|
+
Keys ``dist`` (fitted :class:`Distribution`), ``pi``, ``conds``,
|
|
165
|
+
``I_xv`` (:math:`I(X;V)` under data-weighted responsibilities),
|
|
166
|
+
``H_v``, ``loglik``.
|
|
167
|
+
"""
|
|
168
|
+
if k < 1:
|
|
169
|
+
msg = "k must be >= 1"
|
|
170
|
+
raise ValueError(msg)
|
|
171
|
+
|
|
172
|
+
outcomes, pmf, X, sizes = _dense_table(dist)
|
|
173
|
+
rng = np.random.default_rng(seed)
|
|
174
|
+
best = None
|
|
175
|
+
for _ in range(n_init):
|
|
176
|
+
run_rng = np.random.default_rng(rng.integers(0, 2**31 - 1))
|
|
177
|
+
cand = _em_once(pmf, X, sizes, k, max_iter=max_iter, tol=tol, rng=run_rng)
|
|
178
|
+
if best is None or cand[0] > best[0]:
|
|
179
|
+
best = cand
|
|
180
|
+
|
|
181
|
+
ll, q_pmf, pi, conds, ixv, hv = best
|
|
182
|
+
q = Distribution(outcomes, q_pmf, base="linear", validate=False)
|
|
183
|
+
q.normalize()
|
|
184
|
+
return {
|
|
185
|
+
"dist": q,
|
|
186
|
+
"pi": pi,
|
|
187
|
+
"conds": conds,
|
|
188
|
+
"I_xv": ixv,
|
|
189
|
+
"H_v": hv,
|
|
190
|
+
"loglik": ll,
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
def mixture_of_products_dists(
|
|
195
|
+
dist,
|
|
196
|
+
k_max=None,
|
|
197
|
+
*,
|
|
198
|
+
n_init=12,
|
|
199
|
+
max_iter=200,
|
|
200
|
+
tol=1e-10,
|
|
201
|
+
seed=0,
|
|
202
|
+
early_stop=True,
|
|
203
|
+
kl_tol=1e-8,
|
|
204
|
+
):
|
|
205
|
+
"""
|
|
206
|
+
Fit the mixture-of-products ladder :math:`Q^{(1)},\\ldots,Q^{(k_{\\max})}`.
|
|
207
|
+
|
|
208
|
+
Parameters
|
|
209
|
+
----------
|
|
210
|
+
dist : Distribution
|
|
211
|
+
k_max : int or None
|
|
212
|
+
Maximum number of components. Default ``min(8, |X|)``.
|
|
213
|
+
n_init, max_iter, tol, seed
|
|
214
|
+
Passed to :func:`fit_mixture_of_products` (seed offset by ``k``).
|
|
215
|
+
early_stop : bool
|
|
216
|
+
If True, stop once :math:`D(P\\Vert Q^{(k)}) <` ``kl_tol``.
|
|
217
|
+
kl_tol : float
|
|
218
|
+
Forward-KL threshold for early stopping.
|
|
219
|
+
|
|
220
|
+
Returns
|
|
221
|
+
-------
|
|
222
|
+
dists : list of Distribution
|
|
223
|
+
``dists[k-1]`` is the MLE in :math:`\\mathcal{F}_k`.
|
|
224
|
+
meta : list of dict
|
|
225
|
+
Per-``k`` diagnostics (``I_xv``, ``H_v``, ``loglik``, ``pi``, ``conds``).
|
|
226
|
+
"""
|
|
227
|
+
from ..divergences import kullback_leibler_divergence as D
|
|
228
|
+
|
|
229
|
+
outcomes, pmf, _, _ = _dense_table(dist)
|
|
230
|
+
p_dense = Distribution(outcomes, pmf, base="linear", validate=False)
|
|
231
|
+
p_dense.normalize()
|
|
232
|
+
|
|
233
|
+
if k_max is None:
|
|
234
|
+
k_max = min(8, len(outcomes))
|
|
235
|
+
k_max = max(1, int(k_max))
|
|
236
|
+
|
|
237
|
+
dists = []
|
|
238
|
+
meta = []
|
|
239
|
+
for k in range(1, k_max + 1):
|
|
240
|
+
fit = fit_mixture_of_products(
|
|
241
|
+
dist,
|
|
242
|
+
k,
|
|
243
|
+
n_init=n_init,
|
|
244
|
+
max_iter=max_iter,
|
|
245
|
+
tol=tol,
|
|
246
|
+
seed=seed + 17 * k,
|
|
247
|
+
)
|
|
248
|
+
dists.append(fit["dist"])
|
|
249
|
+
entry = {key: fit[key] for key in ("I_xv", "H_v", "loglik", "pi", "conds")}
|
|
250
|
+
entry["forward_kl"] = float(D(p_dense, fit["dist"]))
|
|
251
|
+
meta.append(entry)
|
|
252
|
+
if early_stop and entry["forward_kl"] < kl_tol:
|
|
253
|
+
break
|
|
254
|
+
|
|
255
|
+
return dists, meta
|