probflow 2.4.0__tar.gz → 2.5.1__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.
- probflow-2.5.1/.codecov.yml +7 -0
- probflow-2.5.1/.github/workflows/python-publish.yml +37 -0
- probflow-2.5.1/.github/workflows/tests.yml +71 -0
- probflow-2.5.1/.gitignore +109 -0
- probflow-2.5.1/.pre-commit-config.yaml +31 -0
- probflow-2.5.1/.readthedocs.yml +23 -0
- probflow-2.5.1/LICENSE +21 -0
- probflow-2.5.1/Makefile +46 -0
- probflow-2.5.1/PKG-INFO +203 -0
- probflow-2.5.1/README.md +172 -0
- probflow-2.5.1/docs/api/api.rst +80 -0
- probflow-2.5.1/docs/api/applications.rst +10 -0
- probflow-2.5.1/docs/api/callbacks.rst +10 -0
- probflow-2.5.1/docs/api/data.rst +10 -0
- probflow-2.5.1/docs/api/distributions.rst +10 -0
- probflow-2.5.1/docs/api/models.rst +10 -0
- probflow-2.5.1/docs/api/modules.rst +10 -0
- probflow-2.5.1/docs/api/parameters.rst +10 -0
- probflow-2.5.1/docs/api/utils.rst +127 -0
- probflow-2.5.1/docs/conf.py +208 -0
- probflow-2.5.1/docs/dev_guide/dev_guide.rst +111 -0
- probflow-2.5.1/docs/examples/ar.rst +97 -0
- probflow-2.5.1/docs/examples/batch_normalization.rst +64 -0
- probflow-2.5.1/docs/examples/correlation.rst +175 -0
- probflow-2.5.1/docs/examples/embedding.rst +50 -0
- probflow-2.5.1/docs/examples/examples.rst +32 -0
- probflow-2.5.1/docs/examples/fully_connected.rst +670 -0
- probflow-2.5.1/docs/examples/gan.rst +166 -0
- probflow-2.5.1/docs/examples/glm.rst +184 -0
- probflow-2.5.1/docs/examples/gmm.rst +149 -0
- probflow-2.5.1/docs/examples/img/correlation/correlation1.svg +1 -0
- probflow-2.5.1/docs/examples/img/correlation/correlation2.svg +1 -0
- probflow-2.5.1/docs/examples/img/correlation/correlation3.svg +1 -0
- probflow-2.5.1/docs/examples/img/correlation/correlation4.svg +1 -0
- probflow-2.5.1/docs/examples/img/correlation/correlation5.svg +1 -0
- probflow-2.5.1/docs/examples/img/correlation/correlation6.svg +1 -0
- probflow-2.5.1/docs/examples/img/correlation/covariance.svg +1 -0
- probflow-2.5.1/docs/examples/img/fully_connected/net_diagram.svg +1 -0
- probflow-2.5.1/docs/examples/img/fully_connected/output_17_0.svg +1 -0
- probflow-2.5.1/docs/examples/img/fully_connected/output_19_0.svg +1 -0
- probflow-2.5.1/docs/examples/img/fully_connected/output_31_0.svg +1 -0
- probflow-2.5.1/docs/examples/img/fully_connected/output_33_0.svg +1 -0
- probflow-2.5.1/docs/examples/img/fully_connected/output_35_0.svg +1 -0
- probflow-2.5.1/docs/examples/img/fully_connected/output_37_1.svg +1 -0
- probflow-2.5.1/docs/examples/img/fully_connected/output_5_0.svg +1 -0
- probflow-2.5.1/docs/examples/img/gmm/output_10_0.svg +1 -0
- probflow-2.5.1/docs/examples/img/gmm/output_12_0.svg +1 -0
- probflow-2.5.1/docs/examples/img/gmm/output_4_0.svg +1 -0
- probflow-2.5.1/docs/examples/img/heteroscedastic/output_10_0.svg +1 -0
- probflow-2.5.1/docs/examples/img/heteroscedastic/output_16_0.svg +1 -0
- probflow-2.5.1/docs/examples/img/heteroscedastic/output_18_0.svg +1 -0
- probflow-2.5.1/docs/examples/img/heteroscedastic/output_20_0.svg +1 -0
- probflow-2.5.1/docs/examples/img/heteroscedastic/output_4_0.svg +1 -0
- probflow-2.5.1/docs/examples/img/heteroscedastic/output_8_1.svg +1 -0
- probflow-2.5.1/docs/examples/img/linear_regression/output_10_0.svg +1 -0
- probflow-2.5.1/docs/examples/img/linear_regression/output_12_1.svg +1 -0
- probflow-2.5.1/docs/examples/img/linear_regression/output_14_0.svg +1 -0
- probflow-2.5.1/docs/examples/img/linear_regression/output_16_0.svg +1199 -0
- probflow-2.5.1/docs/examples/img/linear_regression/output_18_1.svg +1 -0
- probflow-2.5.1/docs/examples/img/linear_regression/output_20_0.svg +1 -0
- probflow-2.5.1/docs/examples/img/linear_regression/output_22_1.svg +1 -0
- probflow-2.5.1/docs/examples/img/linear_regression/output_24_0.svg +1 -0
- probflow-2.5.1/docs/examples/img/linear_regression/output_30_1.svg +1 -0
- probflow-2.5.1/docs/examples/img/linear_regression/output_38_1.svg +1 -0
- probflow-2.5.1/docs/examples/img/linear_regression/output_4_1.svg +1 -0
- probflow-2.5.1/docs/examples/img/logistic_regression/output_14_1.svg +4012 -0
- probflow-2.5.1/docs/examples/img/logistic_regression/output_18_0.svg +3422 -0
- probflow-2.5.1/docs/examples/img/logistic_regression/output_20_1.svg +7086 -0
- probflow-2.5.1/docs/examples/img/logistic_regression/output_24_2.svg +823 -0
- probflow-2.5.1/docs/examples/img/logistic_regression/output_4_0.svg +1919 -0
- probflow-2.5.1/docs/examples/img/multivariate_regression/predictive_0.svg +1014 -0
- probflow-2.5.1/docs/examples/img/multivariate_regression/predictive_1.svg +1041 -0
- probflow-2.5.1/docs/examples/img/multivariate_regression/predictive_2.svg +1012 -0
- probflow-2.5.1/docs/examples/img/multivariate_regression/predictive_3.svg +991 -0
- probflow-2.5.1/docs/examples/img/multivariate_regression/predictive_4.svg +1059 -0
- probflow-2.5.1/docs/examples/img/multivariate_regression/two_headed_net.svg +1 -0
- probflow-2.5.1/docs/examples/img/neural_linear/calibration.svg +1228 -0
- probflow-2.5.1/docs/examples/img/neural_linear/mae.svg +1123 -0
- probflow-2.5.1/docs/examples/img/normalizing_flows/output_2_0.svg +1 -0
- probflow-2.5.1/docs/examples/img/normalizing_flows/output_7_0.svg +1 -0
- probflow-2.5.1/docs/examples/img/normalizing_flows/output_8_1.svg +1 -0
- probflow-2.5.1/docs/examples/img/normalizing_flows/output_9_0.svg +1 -0
- probflow-2.5.1/docs/examples/img/poisson_regression/output_10_0.svg +1 -0
- probflow-2.5.1/docs/examples/img/poisson_regression/output_15_2.svg +1 -0
- probflow-2.5.1/docs/examples/img/poisson_regression/output_4_0.svg +1 -0
- probflow-2.5.1/docs/examples/img/stochastic_volatility/output_17_0.svg +1 -0
- probflow-2.5.1/docs/examples/img/stochastic_volatility/output_19_1.svg +1 -0
- probflow-2.5.1/docs/examples/img/stochastic_volatility/output_21_0.svg +1 -0
- probflow-2.5.1/docs/examples/img/stochastic_volatility/output_7_1.svg +1 -0
- probflow-2.5.1/docs/examples/img/stochastic_volatility/output_9_1.svg +1 -0
- probflow-2.5.1/docs/examples/img/time_to_event/model1.svg +1 -0
- probflow-2.5.1/docs/examples/img/time_to_event/model2.svg +1 -0
- probflow-2.5.1/docs/examples/img/time_to_event/model3.svg +1 -0
- probflow-2.5.1/docs/examples/img/time_to_event/output_19_2.svg +1 -0
- probflow-2.5.1/docs/examples/img/time_to_event/output_21_0.svg +1 -0
- probflow-2.5.1/docs/examples/img/time_to_event/output_23_2.svg +1 -0
- probflow-2.5.1/docs/examples/img/time_to_event/output_26_0.svg +1 -0
- probflow-2.5.1/docs/examples/img/time_to_event/output_34_2.svg +1 -0
- probflow-2.5.1/docs/examples/img/time_to_event/output_36_0.svg +1 -0
- probflow-2.5.1/docs/examples/img/time_to_event/output_41_0.svg +1 -0
- probflow-2.5.1/docs/examples/img/time_to_event/output_43_0.svg +1 -0
- probflow-2.5.1/docs/examples/img/time_to_event/output_4_0.svg +1 -0
- probflow-2.5.1/docs/examples/img/time_to_event/output_55_0.svg +1 -0
- probflow-2.5.1/docs/examples/img/time_to_event/output_57_0.svg +1 -0
- probflow-2.5.1/docs/examples/img/time_to_event/output_63_0.svg +1 -0
- probflow-2.5.1/docs/examples/img/time_to_event/output_6_0.svg +1 -0
- probflow-2.5.1/docs/examples/img/time_to_event/output_9_0.svg +1 -0
- probflow-2.5.1/docs/examples/lda.rst +126 -0
- probflow-2.5.1/docs/examples/linear_regression.rst +458 -0
- probflow-2.5.1/docs/examples/lme.rst +70 -0
- probflow-2.5.1/docs/examples/logistic_regression.rst +264 -0
- probflow-2.5.1/docs/examples/mixture_density.rst +49 -0
- probflow-2.5.1/docs/examples/multivariate_regression.rst +170 -0
- probflow-2.5.1/docs/examples/neural_linear.rst +362 -0
- probflow-2.5.1/docs/examples/nmf.rst +189 -0
- probflow-2.5.1/docs/examples/normalizing_flows.rst +181 -0
- probflow-2.5.1/docs/examples/ppca.rst +50 -0
- probflow-2.5.1/docs/examples/robust_heteroscedastic.rst +301 -0
- probflow-2.5.1/docs/examples/stochastic_volatility.rst +200 -0
- probflow-2.5.1/docs/examples/time_to_event.rst +543 -0
- probflow-2.5.1/docs/examples/variational_autoencoder.rst +65 -0
- probflow-2.5.1/docs/img/colab-badge.svg +1 -0
- probflow-2.5.1/docs/img/coverage.svg +1 -0
- probflow-2.5.1/docs/img/coverage_light.svg +1 -0
- probflow-2.5.1/docs/img/dual_headed_net.svg +1 -0
- probflow-2.5.1/docs/img/dual_headed_net_light.svg +1 -0
- probflow-2.5.1/docs/img/posteriors.svg +1 -0
- probflow-2.5.1/docs/img/posteriors_light.svg +1 -0
- probflow-2.5.1/docs/img/pred_dist.svg +1 -0
- probflow-2.5.1/docs/img/pred_dist_light.svg +1 -0
- probflow-2.5.1/docs/img/probflow_og_image.png +0 -0
- probflow-2.5.1/docs/img/regression_equation.svg +1 -0
- probflow-2.5.1/docs/index.rst +302 -0
- probflow-2.5.1/docs/macros.hrst +37 -0
- probflow-2.5.1/docs/todo.rst +28 -0
- probflow-2.5.1/docs/user_guide/applications.rst +6 -0
- probflow-2.5.1/docs/user_guide/backend.rst +62 -0
- probflow-2.5.1/docs/user_guide/callbacks.rst +469 -0
- probflow-2.5.1/docs/user_guide/datagenerators.rst +8 -0
- probflow-2.5.1/docs/user_guide/distributions.rst +195 -0
- probflow-2.5.1/docs/user_guide/evaluating.rst +35 -0
- probflow-2.5.1/docs/user_guide/fitting.rst +111 -0
- probflow-2.5.1/docs/user_guide/img/callbacks/elbo1.svg +884 -0
- probflow-2.5.1/docs/user_guide/img/callbacks/elbo2.svg +926 -0
- probflow-2.5.1/docs/user_guide/img/callbacks/kl1.svg +787 -0
- probflow-2.5.1/docs/user_guide/img/callbacks/kl2.svg +787 -0
- probflow-2.5.1/docs/user_guide/img/callbacks/lr1.svg +821 -0
- probflow-2.5.1/docs/user_guide/img/callbacks/lr2.svg +921 -0
- probflow-2.5.1/docs/user_guide/img/callbacks/mae1.svg +835 -0
- probflow-2.5.1/docs/user_guide/img/callbacks/mae2.svg +863 -0
- probflow-2.5.1/docs/user_guide/img/callbacks/param1.svg +942 -0
- probflow-2.5.1/docs/user_guide/img/callbacks/param2.svg +1077 -0
- probflow-2.5.1/docs/user_guide/img/distributions/normal_dist.svg +850 -0
- probflow-2.5.1/docs/user_guide/img/inference/line_fit.svg +1 -0
- probflow-2.5.1/docs/user_guide/img/inference/line_fit_params.svg +1 -0
- probflow-2.5.1/docs/user_guide/img/inference/prior_likelihood_posterior.svg +1 -0
- probflow-2.5.1/docs/user_guide/img/inference/regular_vs_probabilistic.svg +1 -0
- probflow-2.5.1/docs/user_guide/img/parameters/bayesian_update_1.svg +1023 -0
- probflow-2.5.1/docs/user_guide/img/parameters/bayesian_update_2.svg +1035 -0
- probflow-2.5.1/docs/user_guide/img/parameters/bayesian_update_3.svg +1115 -0
- probflow-2.5.1/docs/user_guide/img/parameters/bounded_1.svg +1 -0
- probflow-2.5.1/docs/user_guide/img/parameters/bounded_2.svg +1 -0
- probflow-2.5.1/docs/user_guide/img/parameters/mvn_1.svg +1 -0
- probflow-2.5.1/docs/user_guide/img/parameters/mvn_2.svg +1 -0
- probflow-2.5.1/docs/user_guide/img/parameters/positive.svg +1 -0
- probflow-2.5.1/docs/user_guide/img/parameters/posterior_plot_1.svg +1 -0
- probflow-2.5.1/docs/user_guide/img/parameters/posterior_plot_2.svg +1 -0
- probflow-2.5.1/docs/user_guide/img/parameters/posterior_plot_3.svg +1 -0
- probflow-2.5.1/docs/user_guide/img/parameters/posterior_plot_4.svg +1 -0
- probflow-2.5.1/docs/user_guide/img/parameters/prior_plot.svg +1 -0
- probflow-2.5.1/docs/user_guide/img/parameters/transform_1.svg +1 -0
- probflow-2.5.1/docs/user_guide/img/parameters/transform_2.svg +1 -0
- probflow-2.5.1/docs/user_guide/inference.rst +161 -0
- probflow-2.5.1/docs/user_guide/inspecting.rst +7 -0
- probflow-2.5.1/docs/user_guide/math.rst +119 -0
- probflow-2.5.1/docs/user_guide/models.rst +122 -0
- probflow-2.5.1/docs/user_guide/modules.rst +12 -0
- probflow-2.5.1/docs/user_guide/parameters.rst +778 -0
- probflow-2.5.1/docs/user_guide/predicting.rst +30 -0
- probflow-2.5.1/docs/user_guide/saving_and_loading.rst +73 -0
- probflow-2.5.1/docs/user_guide/user_guide.rst +42 -0
- probflow-2.5.1/pyproject.toml +87 -0
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/__init__.py +8 -1
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/applications/__init__.py +3 -4
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/applications/dense_classifier.py +10 -5
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/applications/dense_regression.py +8 -5
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/applications/linear_regression.py +7 -2
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/applications/logistic_regression.py +7 -2
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/applications/poisson_regression.py +7 -2
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/callbacks/__init__.py +0 -1
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/callbacks/callback.py +11 -7
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/callbacks/early_stopping.py +12 -5
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/callbacks/kl_weight_scheduler.py +18 -15
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/callbacks/learning_rate_scheduler.py +15 -12
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/callbacks/monitor_elbo.py +22 -20
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/callbacks/monitor_metric.py +31 -19
- probflow-2.5.1/src/probflow/callbacks/monitor_parameter.py +71 -0
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/callbacks/time_out.py +16 -10
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/data/__init__.py +1 -2
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/data/array_data_generator.py +23 -19
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/data/data_generator.py +20 -17
- probflow-2.5.1/src/probflow/data/make_generator.py +29 -0
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/distributions/__init__.py +0 -1
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/distributions/bernoulli.py +8 -3
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/distributions/categorical.py +26 -11
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/distributions/cauchy.py +7 -4
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/distributions/deterministic.py +6 -3
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/distributions/dirichlet.py +6 -3
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/distributions/gamma.py +6 -3
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/distributions/hidden_markov_model.py +13 -4
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/distributions/inverse_gamma.py +6 -3
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/distributions/mixture.py +19 -5
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/distributions/multivariate_normal.py +6 -3
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/distributions/normal.py +6 -3
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/distributions/one_hot_categorical.py +8 -3
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/distributions/poisson.py +6 -3
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/distributions/student_t.py +12 -4
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/models/__init__.py +2 -3
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/models/categorical_model.py +14 -42
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/models/continuous_model.py +169 -72
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/models/discrete_model.py +34 -13
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/models/model.py +204 -103
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/modules/__init__.py +3 -4
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/modules/batch_normalization.py +21 -13
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/modules/dense.py +6 -5
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/modules/dense_network.py +13 -7
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/modules/embedding.py +10 -8
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/modules/module.py +68 -56
- probflow-2.5.1/src/probflow/modules/sequential.py +33 -0
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/parameters/__init__.py +19 -17
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/parameters/bounded_parameter.py +20 -11
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/parameters/categorical_parameter.py +14 -11
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/parameters/centered_parameter.py +9 -10
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/parameters/deterministic_parameter.py +13 -10
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/parameters/dirichlet_parameter.py +14 -11
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/parameters/multivariate_normal_parameter.py +6 -7
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/parameters/parameter.py +102 -75
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/parameters/positive_parameter.py +19 -10
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/parameters/scale_parameter.py +19 -10
- probflow-2.5.1/src/probflow/utils/__init__.py +1 -0
- probflow-2.5.1/src/probflow/utils/base.py +338 -0
- probflow-2.5.1/src/probflow/utils/casting.py +100 -0
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/utils/initializers.py +17 -11
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/utils/io.py +13 -12
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/utils/metrics.py +45 -51
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/utils/ops.py +121 -86
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/utils/plotting.py +82 -41
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/utils/settings.py +91 -35
- probflow-2.5.1/src/probflow/utils/shape.py +31 -0
- {probflow-2.4.0 → probflow-2.5.1}/src/probflow/utils/torch_distributions.py +7 -7
- probflow-2.5.1/src/probflow/utils/typing.py +46 -0
- probflow-2.5.1/src/probflow/utils/validation.py +45 -0
- probflow-2.5.1/tests/conftest.py +38 -0
- probflow-2.5.1/tests/examples/test_example_correlation.py +63 -0
- probflow-2.5.1/tests/examples/test_example_fully_connected.py +122 -0
- probflow-2.5.1/tests/examples/test_example_gan.py +77 -0
- probflow-2.5.1/tests/examples/test_example_gmm.py +45 -0
- probflow-2.5.1/tests/examples/test_example_heteroscedastic.py +35 -0
- probflow-2.5.1/tests/examples/test_example_linear_regression.py +55 -0
- probflow-2.5.1/tests/examples/test_example_ppca.py +47 -0
- probflow-2.5.1/tests/performance/test_linear_regression.py +56 -0
- probflow-2.5.1/tests/stats/conftest.py +24 -0
- probflow-2.5.1/tests/stats/test_LinearRegression.py +44 -0
- probflow-2.5.1/tests/stats/test_LogisticRegression.py +47 -0
- probflow-2.5.1/tests/stats/test_distribution_fits.py +221 -0
- probflow-2.5.1/tests/unit/pytorch/applications/test_dense_classifier.py +75 -0
- probflow-2.5.1/tests/unit/pytorch/applications/test_dense_regression.py +164 -0
- probflow-2.5.1/tests/unit/pytorch/applications/test_linear_regression.py +164 -0
- probflow-2.5.1/tests/unit/pytorch/applications/test_logistic_regression.py +78 -0
- probflow-2.5.1/tests/unit/pytorch/applications/test_poisson_regression.py +57 -0
- probflow-2.5.1/tests/unit/pytorch/callbacks/get_model_and_data.py +29 -0
- probflow-2.5.1/tests/unit/pytorch/callbacks/test_callback.py +26 -0
- probflow-2.5.1/tests/unit/pytorch/callbacks/test_early_stopping.py +64 -0
- probflow-2.5.1/tests/unit/pytorch/callbacks/test_kl_weight_scheduler.py +33 -0
- probflow-2.5.1/tests/unit/pytorch/callbacks/test_learning_rate_scheduler.py +35 -0
- probflow-2.5.1/tests/unit/pytorch/callbacks/test_monitor_elbo.py +30 -0
- probflow-2.5.1/tests/unit/pytorch/callbacks/test_monitor_metric.py +51 -0
- probflow-2.5.1/tests/unit/pytorch/callbacks/test_monitor_parameter.py +23 -0
- probflow-2.5.1/tests/unit/pytorch/callbacks/test_time_out.py +17 -0
- probflow-2.5.1/tests/unit/pytorch/conftest.py +9 -0
- probflow-2.5.1/tests/unit/pytorch/distributions/test_bernoulli.py +54 -0
- probflow-2.5.1/tests/unit/pytorch/distributions/test_categorical.py +94 -0
- probflow-2.5.1/tests/unit/pytorch/distributions/test_cauchy.py +55 -0
- probflow-2.5.1/tests/unit/pytorch/distributions/test_deterministic.py +78 -0
- probflow-2.5.1/tests/unit/pytorch/distributions/test_dirichlet.py +86 -0
- probflow-2.5.1/tests/unit/pytorch/distributions/test_gamma.py +56 -0
- probflow-2.5.1/tests/unit/pytorch/distributions/test_inverse_gamma.py +59 -0
- probflow-2.5.1/tests/unit/pytorch/distributions/test_mixture.py +89 -0
- probflow-2.5.1/tests/unit/pytorch/distributions/test_multivariate_normal.py +52 -0
- probflow-2.5.1/tests/unit/pytorch/distributions/test_normal.py +59 -0
- probflow-2.5.1/tests/unit/pytorch/distributions/test_one_hot_categorical.py +96 -0
- probflow-2.5.1/tests/unit/pytorch/distributions/test_poisson.py +55 -0
- probflow-2.5.1/tests/unit/pytorch/distributions/test_student_t.py +59 -0
- probflow-2.5.1/tests/unit/pytorch/models/test_categorical_model.py +39 -0
- probflow-2.5.1/tests/unit/pytorch/models/test_continuous_model.py +330 -0
- probflow-2.5.1/tests/unit/pytorch/models/test_discrete_model.py +71 -0
- probflow-2.5.1/tests/unit/pytorch/models/test_model.py +1095 -0
- probflow-2.5.1/tests/unit/pytorch/modules/test_batch_normalization.py +85 -0
- probflow-2.5.1/tests/unit/pytorch/modules/test_dense_network.py +110 -0
- probflow-2.5.1/tests/unit/pytorch/parameters/test_bounded_parameter.py +37 -0
- probflow-2.5.1/tests/unit/pytorch/parameters/test_categorical_parameter.py +38 -0
- probflow-2.5.1/tests/unit/pytorch/parameters/test_centered_parameter.py +239 -0
- probflow-2.5.1/tests/unit/pytorch/parameters/test_deterministic_parameter.py +36 -0
- probflow-2.5.1/tests/unit/pytorch/parameters/test_dirichlet_parameter.py +41 -0
- probflow-2.5.1/tests/unit/pytorch/parameters/test_multivariate_normal_parameter.py +72 -0
- probflow-2.5.1/tests/unit/pytorch/parameters/test_parameter.py +385 -0
- probflow-2.5.1/tests/unit/pytorch/parameters/test_positive_parameter.py +31 -0
- probflow-2.5.1/tests/unit/pytorch/parameters/test_scale_parameter.py +29 -0
- probflow-2.5.1/tests/unit/pytorch/utils/test_initializers.py +73 -0
- probflow-2.5.1/tests/unit/pytorch/utils/test_io.py +76 -0
- probflow-2.5.1/tests/unit/pytorch/utils/test_ops.py +535 -0
- probflow-2.5.1/tests/unit/pytorch/utils/test_settings.py +20 -0
- probflow-2.5.1/tests/unit/tensorflow/applications/test_dense_classifier.py +75 -0
- probflow-2.5.1/tests/unit/tensorflow/applications/test_dense_regression.py +196 -0
- probflow-2.5.1/tests/unit/tensorflow/applications/test_linear_regression.py +164 -0
- probflow-2.5.1/tests/unit/tensorflow/applications/test_logistic_regression.py +78 -0
- probflow-2.5.1/tests/unit/tensorflow/applications/test_poisson_regression.py +57 -0
- probflow-2.5.1/tests/unit/tensorflow/callbacks/get_model_and_data.py +27 -0
- probflow-2.5.1/tests/unit/tensorflow/callbacks/test_callback.py +26 -0
- probflow-2.5.1/tests/unit/tensorflow/callbacks/test_early_stopping.py +64 -0
- probflow-2.5.1/tests/unit/tensorflow/callbacks/test_kl_weight_scheduler.py +33 -0
- probflow-2.5.1/tests/unit/tensorflow/callbacks/test_learning_rate_scheduler.py +33 -0
- probflow-2.5.1/tests/unit/tensorflow/callbacks/test_monitor_elbo.py +30 -0
- probflow-2.5.1/tests/unit/tensorflow/callbacks/test_monitor_metric.py +51 -0
- probflow-2.5.1/tests/unit/tensorflow/callbacks/test_monitor_parameter.py +41 -0
- probflow-2.5.1/tests/unit/tensorflow/callbacks/test_time_out.py +17 -0
- probflow-2.5.1/tests/unit/tensorflow/conftest.py +7 -0
- probflow-2.5.1/tests/unit/tensorflow/data/test_array_data_generator.py +137 -0
- probflow-2.5.1/tests/unit/tensorflow/data/test_data_generator.py +19 -0
- probflow-2.5.1/tests/unit/tensorflow/data/test_make_generator.py +21 -0
- probflow-2.5.1/tests/unit/tensorflow/distributions/test_bernoulli.py +55 -0
- probflow-2.5.1/tests/unit/tensorflow/distributions/test_categorical.py +95 -0
- probflow-2.5.1/tests/unit/tensorflow/distributions/test_cauchy.py +52 -0
- probflow-2.5.1/tests/unit/tensorflow/distributions/test_deterministic.py +62 -0
- probflow-2.5.1/tests/unit/tensorflow/distributions/test_dirichlet.py +80 -0
- probflow-2.5.1/tests/unit/tensorflow/distributions/test_gamma.py +51 -0
- probflow-2.5.1/tests/unit/tensorflow/distributions/test_hidden_markov_model.py +71 -0
- probflow-2.5.1/tests/unit/tensorflow/distributions/test_inverse_gamma.py +51 -0
- probflow-2.5.1/tests/unit/tensorflow/distributions/test_mixture.py +82 -0
- probflow-2.5.1/tests/unit/tensorflow/distributions/test_multivariate_normal.py +53 -0
- probflow-2.5.1/tests/unit/tensorflow/distributions/test_normal.py +56 -0
- probflow-2.5.1/tests/unit/tensorflow/distributions/test_one_hot_categorical.py +82 -0
- probflow-2.5.1/tests/unit/tensorflow/distributions/test_poisson.py +52 -0
- probflow-2.5.1/tests/unit/tensorflow/distributions/test_student_t.py +54 -0
- probflow-2.5.1/tests/unit/tensorflow/models/test_categorical_model.py +75 -0
- probflow-2.5.1/tests/unit/tensorflow/models/test_continuous_model.py +368 -0
- probflow-2.5.1/tests/unit/tensorflow/models/test_discrete_model.py +78 -0
- probflow-2.5.1/tests/unit/tensorflow/models/test_model.py +1081 -0
- probflow-2.5.1/tests/unit/tensorflow/modules/test_batch_normalization.py +88 -0
- probflow-2.5.1/tests/unit/tensorflow/modules/test_dense.py +94 -0
- probflow-2.5.1/tests/unit/tensorflow/modules/test_dense_network.py +113 -0
- probflow-2.5.1/tests/unit/tensorflow/modules/test_embedding.py +97 -0
- probflow-2.5.1/tests/unit/tensorflow/modules/test_module.py +324 -0
- probflow-2.5.1/tests/unit/tensorflow/modules/test_sequential.py +65 -0
- probflow-2.5.1/tests/unit/tensorflow/parameters/test_bounded_parameter.py +46 -0
- probflow-2.5.1/tests/unit/tensorflow/parameters/test_categorical_parameter.py +47 -0
- probflow-2.5.1/tests/unit/tensorflow/parameters/test_centered_parameter.py +237 -0
- probflow-2.5.1/tests/unit/tensorflow/parameters/test_deterministic_parameter.py +44 -0
- probflow-2.5.1/tests/unit/tensorflow/parameters/test_dirichlet_parameter.py +50 -0
- probflow-2.5.1/tests/unit/tensorflow/parameters/test_multivariate_normal_parameter.py +80 -0
- probflow-2.5.1/tests/unit/tensorflow/parameters/test_parameter.py +389 -0
- probflow-2.5.1/tests/unit/tensorflow/parameters/test_positive_parameter.py +41 -0
- probflow-2.5.1/tests/unit/tensorflow/parameters/test_scale_parameter.py +37 -0
- probflow-2.5.1/tests/unit/tensorflow/utils/test_casting.py +43 -0
- probflow-2.5.1/tests/unit/tensorflow/utils/test_initializers.py +66 -0
- probflow-2.5.1/tests/unit/tensorflow/utils/test_io.py +72 -0
- probflow-2.5.1/tests/unit/tensorflow/utils/test_metrics.py +207 -0
- probflow-2.5.1/tests/unit/tensorflow/utils/test_ops.py +484 -0
- probflow-2.5.1/tests/unit/tensorflow/utils/test_plotting.py +331 -0
- probflow-2.5.1/tests/unit/tensorflow/utils/test_settings.py +182 -0
- probflow-2.5.1/uv.lock +3303 -0
- probflow-2.4.0/PKG-INFO +0 -243
- probflow-2.4.0/README.rst +0 -223
- probflow-2.4.0/pyproject.toml +0 -8
- probflow-2.4.0/setup.cfg +0 -4
- probflow-2.4.0/setup.py +0 -64
- probflow-2.4.0/src/probflow/callbacks/monitor_parameter.py +0 -60
- probflow-2.4.0/src/probflow/data/make_generator.py +0 -25
- probflow-2.4.0/src/probflow/modules/sequential.py +0 -26
- probflow-2.4.0/src/probflow/utils/__init__.py +0 -0
- probflow-2.4.0/src/probflow/utils/base.py +0 -202
- probflow-2.4.0/src/probflow/utils/casting.py +0 -77
- probflow-2.4.0/src/probflow/utils/validation.py +0 -35
- probflow-2.4.0/src/probflow.egg-info/PKG-INFO +0 -243
- probflow-2.4.0/src/probflow.egg-info/SOURCES.txt +0 -77
- probflow-2.4.0/src/probflow.egg-info/dependency_links.txt +0 -1
- probflow-2.4.0/src/probflow.egg-info/not-zip-safe +0 -1
- probflow-2.4.0/src/probflow.egg-info/requires.txt +0 -35
- probflow-2.4.0/src/probflow.egg-info/top_level.txt +0 -1
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# This workflow will upload a Python Package using uv when a release is published
|
|
2
|
+
# For more information see: https://docs.astral.sh/uv/guides/publish/
|
|
3
|
+
|
|
4
|
+
name: Publish Python Package
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
release:
|
|
8
|
+
types: [published]
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
pypi-publish:
|
|
12
|
+
|
|
13
|
+
name: Upload release to PyPI
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
|
|
16
|
+
# Environment to restrict deployment permissions
|
|
17
|
+
environment:
|
|
18
|
+
name: pypi
|
|
19
|
+
url: https://pypi.org/p/probflow
|
|
20
|
+
|
|
21
|
+
# Permissions for Trusted Publishing (OIDC)
|
|
22
|
+
permissions:
|
|
23
|
+
id-token: write
|
|
24
|
+
contents: read
|
|
25
|
+
|
|
26
|
+
steps:
|
|
27
|
+
- name: Checkout repository
|
|
28
|
+
uses: actions/checkout@v4
|
|
29
|
+
|
|
30
|
+
- name: Set up uv
|
|
31
|
+
uses: astral-sh/setup-uv@v10.1.0
|
|
32
|
+
|
|
33
|
+
- name: Build distribution
|
|
34
|
+
run: uv build
|
|
35
|
+
|
|
36
|
+
- name: Publish package to PyPI
|
|
37
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
|
|
2
|
+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
|
|
3
|
+
|
|
4
|
+
name: tests
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
push:
|
|
8
|
+
branches: [ main ]
|
|
9
|
+
pull_request:
|
|
10
|
+
branches: [ main ]
|
|
11
|
+
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
code-quality: write
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
# Lint code
|
|
18
|
+
lint:
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
- uses: actions/setup-python@v5
|
|
23
|
+
with:
|
|
24
|
+
python-version: '3.10'
|
|
25
|
+
- uses: pre-commit/action@v3.0.1
|
|
26
|
+
|
|
27
|
+
# Build docs
|
|
28
|
+
docs:
|
|
29
|
+
runs-on: ubuntu-latest
|
|
30
|
+
steps:
|
|
31
|
+
- name: Checkout repository
|
|
32
|
+
uses: actions/checkout@v4
|
|
33
|
+
- name: Set up uv
|
|
34
|
+
uses: astral-sh/setup-uv@v10.1.0
|
|
35
|
+
- name: Install dependencies
|
|
36
|
+
run: |
|
|
37
|
+
uv sync --extra docs
|
|
38
|
+
- name: Build docs
|
|
39
|
+
run: |
|
|
40
|
+
uv run sphinx-build -b html docs docs/_html
|
|
41
|
+
|
|
42
|
+
unit-test:
|
|
43
|
+
|
|
44
|
+
runs-on: ubuntu-latest
|
|
45
|
+
strategy:
|
|
46
|
+
matrix:
|
|
47
|
+
python-version: ['3.10', '3.11', '3.12', '3.13']
|
|
48
|
+
backend: [tensorflow, pytorch]
|
|
49
|
+
#os: [ubuntu-latest, macos-latest, windows-latest]
|
|
50
|
+
|
|
51
|
+
steps:
|
|
52
|
+
- name: Checkout repository
|
|
53
|
+
uses: actions/checkout@v4
|
|
54
|
+
- name: Set up uv
|
|
55
|
+
uses: astral-sh/setup-uv@v10.1.0
|
|
56
|
+
with:
|
|
57
|
+
python-version: ${{ matrix.python-version }}
|
|
58
|
+
- name: Install dependencies, ${{ matrix.backend }}, and probflow
|
|
59
|
+
run: |
|
|
60
|
+
uv sync --extra ${{ matrix.backend }}
|
|
61
|
+
- name: Run tests
|
|
62
|
+
run: |
|
|
63
|
+
uv run pytest tests/unit/${{ matrix.backend }} --cov=probflow --cov-report xml:coverage.xml
|
|
64
|
+
- name: Upload coverage report to CodeCov
|
|
65
|
+
uses: codecov/codecov-action@v5
|
|
66
|
+
with:
|
|
67
|
+
files: ./coverage.xml
|
|
68
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
69
|
+
- name: Ensure the package builds
|
|
70
|
+
run: |
|
|
71
|
+
uv build
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# vim
|
|
2
|
+
*.swp
|
|
3
|
+
*.vim
|
|
4
|
+
|
|
5
|
+
# Byte-compiled / optimized / DLL files
|
|
6
|
+
__pycache__/
|
|
7
|
+
*.py[cod]
|
|
8
|
+
*$py.class
|
|
9
|
+
|
|
10
|
+
# C extensions
|
|
11
|
+
*.so
|
|
12
|
+
|
|
13
|
+
# Distribution / packaging
|
|
14
|
+
.Python
|
|
15
|
+
build/
|
|
16
|
+
develop-eggs/
|
|
17
|
+
dist/
|
|
18
|
+
downloads/
|
|
19
|
+
eggs/
|
|
20
|
+
.eggs/
|
|
21
|
+
lib/
|
|
22
|
+
lib64/
|
|
23
|
+
parts/
|
|
24
|
+
sdist/
|
|
25
|
+
var/
|
|
26
|
+
wheels/
|
|
27
|
+
*.egg-info/
|
|
28
|
+
.installed.cfg
|
|
29
|
+
*.egg
|
|
30
|
+
MANIFEST
|
|
31
|
+
|
|
32
|
+
# PyInstaller
|
|
33
|
+
# Usually these files are written by a python script from a template
|
|
34
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
35
|
+
*.manifest
|
|
36
|
+
*.spec
|
|
37
|
+
|
|
38
|
+
# Installer logs
|
|
39
|
+
pip-log.txt
|
|
40
|
+
pip-delete-this-directory.txt
|
|
41
|
+
|
|
42
|
+
# Unit test / coverage reports
|
|
43
|
+
htmlcov/
|
|
44
|
+
.tox/
|
|
45
|
+
.coverage
|
|
46
|
+
.coverage.*
|
|
47
|
+
.cache
|
|
48
|
+
nosetests.xml
|
|
49
|
+
coverage.xml
|
|
50
|
+
*.cover
|
|
51
|
+
.hypothesis/
|
|
52
|
+
.pytest_cache/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
|
|
63
|
+
# Flask stuff:
|
|
64
|
+
instance/
|
|
65
|
+
.webassets-cache
|
|
66
|
+
|
|
67
|
+
# Scrapy stuff:
|
|
68
|
+
.scrapy
|
|
69
|
+
|
|
70
|
+
# Sphinx documentation
|
|
71
|
+
docs/_build/
|
|
72
|
+
|
|
73
|
+
# PyBuilder
|
|
74
|
+
target/
|
|
75
|
+
|
|
76
|
+
# Jupyter Notebook
|
|
77
|
+
.ipynb_checkpoints
|
|
78
|
+
|
|
79
|
+
# pyenv
|
|
80
|
+
.python-version
|
|
81
|
+
|
|
82
|
+
# celery beat schedule file
|
|
83
|
+
celerybeat-schedule
|
|
84
|
+
|
|
85
|
+
# SageMath parsed files
|
|
86
|
+
*.sage.py
|
|
87
|
+
|
|
88
|
+
# Environments
|
|
89
|
+
.env
|
|
90
|
+
.venv
|
|
91
|
+
env/
|
|
92
|
+
venv/
|
|
93
|
+
ENV/
|
|
94
|
+
env.bak/
|
|
95
|
+
venv.bak/
|
|
96
|
+
|
|
97
|
+
# Spyder project settings
|
|
98
|
+
.spyderproject
|
|
99
|
+
.spyproject
|
|
100
|
+
|
|
101
|
+
# Rope project settings
|
|
102
|
+
.ropeproject
|
|
103
|
+
|
|
104
|
+
# mkdocs documentation
|
|
105
|
+
/site
|
|
106
|
+
docs/_html
|
|
107
|
+
|
|
108
|
+
# mypy
|
|
109
|
+
.mypy_cache/
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
default_language_version:
|
|
2
|
+
python: python3.12
|
|
3
|
+
|
|
4
|
+
repos:
|
|
5
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
6
|
+
rev: v0.16.5
|
|
7
|
+
hooks:
|
|
8
|
+
- id: ruff
|
|
9
|
+
args: [--fix]
|
|
10
|
+
- id: ruff-format
|
|
11
|
+
|
|
12
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
13
|
+
rev: v6.0.0
|
|
14
|
+
hooks:
|
|
15
|
+
- id: trailing-whitespace
|
|
16
|
+
exclude: ^docs/
|
|
17
|
+
- id: end-of-file-fixer
|
|
18
|
+
exclude: ^docs/
|
|
19
|
+
- id: check-yaml
|
|
20
|
+
- id: check-toml
|
|
21
|
+
- id: check-json
|
|
22
|
+
- id: check-merge-conflict
|
|
23
|
+
- id: check-added-large-files
|
|
24
|
+
args: [--maxkb=1000]
|
|
25
|
+
|
|
26
|
+
- repo: https://github.com/pre-commit/mirrors-mypy
|
|
27
|
+
rev: v2.3.1
|
|
28
|
+
hooks:
|
|
29
|
+
- id: mypy
|
|
30
|
+
args: [src/probflow]
|
|
31
|
+
pass_filenames: false
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# .readthedocs.yml
|
|
2
|
+
# Read the Docs configuration file
|
|
3
|
+
|
|
4
|
+
# Required
|
|
5
|
+
version: 2
|
|
6
|
+
|
|
7
|
+
build:
|
|
8
|
+
os: ubuntu-22.04
|
|
9
|
+
tools:
|
|
10
|
+
python: "3.11"
|
|
11
|
+
|
|
12
|
+
# Build documentation in the docs/ directory with Sphinx
|
|
13
|
+
sphinx:
|
|
14
|
+
configuration: docs/conf.py
|
|
15
|
+
fail_on_warning: true
|
|
16
|
+
|
|
17
|
+
# Install the package (and its "docs" extra) from pyproject.toml
|
|
18
|
+
python:
|
|
19
|
+
install:
|
|
20
|
+
- method: pip
|
|
21
|
+
path: .
|
|
22
|
+
extra_requirements:
|
|
23
|
+
- docs
|
probflow-2.5.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2019 Brendan Hasz
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
probflow-2.5.1/Makefile
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
|
|
2
|
+
.PHONY: install test-unit test-stats test format docs bump-minor bump-patch package push-package clean
|
|
3
|
+
|
|
4
|
+
BACKEND ?= tensorflow
|
|
5
|
+
AVAILABLE_BACKENDS := tensorflow pytorch
|
|
6
|
+
|
|
7
|
+
# Install probflow package and requirements
|
|
8
|
+
install:
|
|
9
|
+
uv sync --extra $(BACKEND) --extra docs
|
|
10
|
+
|
|
11
|
+
# Run unit tests
|
|
12
|
+
test-unit: install
|
|
13
|
+
uv run pytest tests/unit/$(BACKEND)
|
|
14
|
+
|
|
15
|
+
# Run statistical checks
|
|
16
|
+
test-stats: install
|
|
17
|
+
uv run pytest tests/stats --backend=$(BACKEND)
|
|
18
|
+
|
|
19
|
+
# Run all tests, including statistical checks, for all backends
|
|
20
|
+
test:
|
|
21
|
+
@for backend in $(AVAILABLE_BACKENDS); do \
|
|
22
|
+
$(MAKE) test-unit BACKEND=$$backend; \
|
|
23
|
+
$(MAKE) test-stats BACKEND=$$backend; \
|
|
24
|
+
done
|
|
25
|
+
|
|
26
|
+
# Format, lint, and type check code
|
|
27
|
+
format:
|
|
28
|
+
uv run pre-commit run --all-files
|
|
29
|
+
|
|
30
|
+
# Build documentation
|
|
31
|
+
docs:
|
|
32
|
+
uv sync --extra docs
|
|
33
|
+
uv run sphinx-build -b html docs docs/_html
|
|
34
|
+
|
|
35
|
+
# Bump minor version number
|
|
36
|
+
bump-minor:
|
|
37
|
+
uv version --bump minor
|
|
38
|
+
|
|
39
|
+
# Bump patch version number
|
|
40
|
+
bump-patch:
|
|
41
|
+
uv version --bump patch
|
|
42
|
+
|
|
43
|
+
# Clean up build artifacts and caches
|
|
44
|
+
clean:
|
|
45
|
+
rm -rf .pytest_cache docs/_html build dist src/probflow.egg-info
|
|
46
|
+
find . -type d -name __pycache__ -exec rm -rf {} \+
|
probflow-2.5.1/PKG-INFO
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: probflow
|
|
3
|
+
Version: 2.5.1
|
|
4
|
+
Summary: A Python package for building Bayesian models with TensorFlow or PyTorch
|
|
5
|
+
Project-URL: Homepage, https://github.com/brendanhasz/probflow
|
|
6
|
+
Author-email: Brendan Hasz <winsto99@gmail.com>
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Classifier: Development Status :: 3 - Alpha
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Requires-Python: >=3.10
|
|
14
|
+
Requires-Dist: cloudpickle>=1.3
|
|
15
|
+
Requires-Dist: matplotlib>=3.1.0
|
|
16
|
+
Requires-Dist: numpy>=1.17.0
|
|
17
|
+
Requires-Dist: pandas>=0.25.0
|
|
18
|
+
Provides-Extra: docs
|
|
19
|
+
Requires-Dist: sphinx-rtd-theme>=0.5.0; extra == 'docs'
|
|
20
|
+
Requires-Dist: sphinx-tabs>=1.1.13; extra == 'docs'
|
|
21
|
+
Requires-Dist: sphinx>=3.1.2; extra == 'docs'
|
|
22
|
+
Requires-Dist: tensorflow-probability>=0.10.0; extra == 'docs'
|
|
23
|
+
Requires-Dist: tensorflow>=2.2.0; extra == 'docs'
|
|
24
|
+
Provides-Extra: pytorch
|
|
25
|
+
Requires-Dist: torch>=1.5.0; extra == 'pytorch'
|
|
26
|
+
Provides-Extra: tensorflow
|
|
27
|
+
Requires-Dist: tensorflow-probability>=0.10.0; extra == 'tensorflow'
|
|
28
|
+
Requires-Dist: tensorflow>=2.2.0; extra == 'tensorflow'
|
|
29
|
+
Requires-Dist: tf-keras; extra == 'tensorflow'
|
|
30
|
+
Description-Content-Type: text/markdown
|
|
31
|
+
|
|
32
|
+
# ProbFlow
|
|
33
|
+
|
|
34
|
+
[](https://pypi.org/project/probflow/) [](https://github.com/brendanhasz/probflow/actions?query=branch%3Amain) [](http://probflow.readthedocs.io) [](https://codecov.io/gh/brendanhasz/probflow)
|
|
35
|
+
|
|
36
|
+
ProbFlow is a Python package for building probabilistic Bayesian models with [TensorFlow 2.0](http://www.tensorflow.org/beta) or [PyTorch](http://pytorch.org), performing stochastic variational inference with those models, and evaluating the models' inferences. It provides both high-level modules for building Bayesian neural networks, as well as low-level parameters and distributions for constructing custom Bayesian models.
|
|
37
|
+
|
|
38
|
+
It's very much still a work in progress.
|
|
39
|
+
|
|
40
|
+
- **Git repository:** http://github.com/brendanhasz/probflow
|
|
41
|
+
- **Documentation:** http://probflow.readthedocs.io
|
|
42
|
+
- **Bug reports:** http://github.com/brendanhasz/probflow/issues
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
## Getting Started
|
|
46
|
+
|
|
47
|
+
**ProbFlow** allows you to quickly and less painfully build, fit, and evaluate custom Bayesian models (or [ready-made](http://probflow.readthedocs.io/en/latest/api/applications.html) ones!) which run on top of either [TensorFlow 2.0](http://www.tensorflow.org/beta) and [TensorFlow Probability](http://www.tensorflow.org/probability) or [PyTorch](http://pytorch.org).
|
|
48
|
+
|
|
49
|
+
With ProbFlow, the core building blocks of a Bayesian model are parameters and probability distributions (and, of course, the input data). Parameters define how the independent variables (the features) predict the probability distribution of the dependent variables (the target).
|
|
50
|
+
|
|
51
|
+
For example, a simple Bayesian linear regression
|
|
52
|
+
|
|
53
|
+
$$y \sim \text{Normal}(wx + b, \sigma)$$
|
|
54
|
+
|
|
55
|
+
can be built by creating a ProbFlow Model. This is just a class which inherits `pf.Model` (or `pf.ContinuousModel` or `pf.CategoricalModel` depending on the target type). The `__init__` method sets up the parameters, and the `__call__` method performs a forward pass of the model, returning the predicted probability distribution of the target:
|
|
56
|
+
|
|
57
|
+
```python
|
|
58
|
+
import probflow as pf
|
|
59
|
+
import tensorflow as tf
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
class LinearRegression(pf.ContinuousModel):
|
|
63
|
+
def __init__(self):
|
|
64
|
+
self.weight = pf.Parameter(name="weight")
|
|
65
|
+
self.bias = pf.Parameter(name="bias")
|
|
66
|
+
self.std = pf.ScaleParameter(name="sigma")
|
|
67
|
+
|
|
68
|
+
def __call__(self, x):
|
|
69
|
+
return pf.Normal(x * self.weight() + self.bias(), self.std())
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
model = LinearRegression()
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Then, the model can be fit using stochastic variational inference, in *one line*:
|
|
76
|
+
|
|
77
|
+
```python
|
|
78
|
+
# x and y are Numpy arrays or pandas DataFrame/Series
|
|
79
|
+
model.fit(x, y)
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
You can generate predictions for new data:
|
|
83
|
+
|
|
84
|
+
```python
|
|
85
|
+
# x_test is a Numpy array or pandas DataFrame
|
|
86
|
+
>>> model.predict(x_test)
|
|
87
|
+
[0.983]
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Compute *probabilistic* predictions for new data, with 95% confidence intervals:
|
|
91
|
+
|
|
92
|
+
```python
|
|
93
|
+
model.pred_dist_plot(x_test, ci=0.95)
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+

|
|
97
|
+
|
|
98
|
+
Evaluate your model's performance using metrics:
|
|
99
|
+
|
|
100
|
+
```python
|
|
101
|
+
>>> model.metric('mse', x_test, y_test)
|
|
102
|
+
0.217
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Inspect the posterior distributions of your fit model's parameters, with 95% confidence intervals:
|
|
106
|
+
|
|
107
|
+
```python
|
|
108
|
+
model.posterior_plot(ci=0.95)
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+

|
|
112
|
+
|
|
113
|
+
Investigate how well your model is capturing uncertainty by examining how accurate its predictive intervals are:
|
|
114
|
+
|
|
115
|
+
```python
|
|
116
|
+
>>> model.pred_dist_coverage(ci=0.95)
|
|
117
|
+
0.903
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
and diagnose *where* your model is having problems capturing uncertainty:
|
|
121
|
+
|
|
122
|
+
```python
|
|
123
|
+
model.coverage_by(ci=0.95)
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+

|
|
127
|
+
|
|
128
|
+
ProbFlow also provides more complex modules, such as those required for building Bayesian neural networks. Also, you can mix ProbFlow with TensorFlow (or PyTorch!) code. For example, even a somewhat complex multi-layer Bayesian neural network like this:
|
|
129
|
+
|
|
130
|
+

|
|
131
|
+
|
|
132
|
+
Can be built and fit with ProbFlow in only a few lines:
|
|
133
|
+
|
|
134
|
+
```python
|
|
135
|
+
class DensityNetwork(pf.ContinuousModel):
|
|
136
|
+
def __init__(self, units, head_units):
|
|
137
|
+
self.core = pf.DenseNetwork(units)
|
|
138
|
+
self.mean = pf.DenseNetwork(head_units)
|
|
139
|
+
self.std = pf.DenseNetwork(head_units)
|
|
140
|
+
|
|
141
|
+
def __call__(self, x):
|
|
142
|
+
z = tf.nn.relu(self.core(x))
|
|
143
|
+
return pf.Normal(self.mean(z), tf.exp(self.std(z)))
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
# Create the model
|
|
147
|
+
model = DensityNetwork([x.shape[1], 256, 128], [128, 64, 32, 1])
|
|
148
|
+
|
|
149
|
+
# Fit it!
|
|
150
|
+
model.fit(x, y)
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
For convenience, ProbFlow also includes several [pre-built models](http://probflow.readthedocs.io/en/latest/api/applications.html) for standard tasks (such as linear regressions, logistic regressions, and multi-layer dense neural networks). For example, the above linear regression example could have been done with much less work by using ProbFlow's ready-made LinearRegression model:
|
|
154
|
+
|
|
155
|
+
```python
|
|
156
|
+
model = pf.LinearRegression(x.shape[1])
|
|
157
|
+
model.fit(x, y)
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
And a multi-layer Bayesian neural net can be made easily using ProbFlow's ready-made DenseRegression model:
|
|
161
|
+
|
|
162
|
+
```python
|
|
163
|
+
model = pf.DenseRegression([x.shape[1], 128, 64, 1])
|
|
164
|
+
model.fit(x, y)
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Using parameters and distributions as simple building blocks, ProbFlow allows for the painless creation of more complicated Bayesian models like [generalized linear models](http://probflow.readthedocs.io/en/latest/examples/glm.html), [deep time-to-event models](http://probflow.readthedocs.io/en/latest/examples/time_to_event.html), [neural matrix factorization](http://probflow.readthedocs.io/en/latest/examples/nmf.html) models, and [Gaussian mixture models](http://probflow.readthedocs.io/en/latest/examples/gmm.html). You can even mix [probabilistic and non-probabilistic models](http://probflow.readthedocs.io/en/latest/examples/neural_linear.html)! Take a look at the [examples](http://probflow.readthedocs.io/en/latest/examples/examples.html) and the [user guide](http://probflow.readthedocs.io/en/latest/user_guide/user_guide.html) for more!
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
## Installation
|
|
171
|
+
|
|
172
|
+
If you already have your desired backend installed (i.e. Tensorflow/TFP or PyTorch), then you can just do:
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
pip install probflow
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Or, to install both ProbFlow and the CPU version of TensorFlow + TensorFlow Probability,
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
pip install probflow[tensorflow]
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Or, to install ProbFlow and PyTorch,
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
pip install probflow[pytorch]
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
## Support
|
|
192
|
+
|
|
193
|
+
Post bug reports, feature requests, and tutorial requests in [GitHub issues](http://github.com/brendanhasz/probflow/issues).
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
## Contributing
|
|
197
|
+
|
|
198
|
+
[Pull requests](http://github.com/brendanhasz/probflow/pulls) are totally welcome! Any contribution would be appreciated, from things as minor as pointing out typos to things as major as writing new applications and distributions.
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
## Why the name, ProbFlow?
|
|
202
|
+
|
|
203
|
+
Because it's a package for probabilistic modeling, and it was built on TensorFlow. ¯\\\_(ツ)_/¯
|