gpflow 2.9.0__tar.gz → 2.9.2__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.
- {gpflow-2.9.0/gpflow.egg-info → gpflow-2.9.2}/PKG-INFO +3 -1
- {gpflow-2.9.0 → gpflow-2.9.2}/RELEASE.md +33 -0
- gpflow-2.9.2/VERSION +1 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/benchmark/plotters.py +7 -3
- {gpflow-2.9.0 → gpflow-2.9.2}/doc/sphinx/conf.py +1 -1
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/__init__.py +1 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/base.py +3 -3
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/functions.py +9 -1
- gpflow-2.9.2/gpflow/keras.py +32 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/models/training_mixins.py +3 -3
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/monitor/tensorboard.py +6 -2
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/optimizers/natgrad.py +5 -5
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/optimizers/scipy.py +7 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/utilities/misc.py +4 -2
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/utilities/traversal.py +1 -1
- {gpflow-2.9.0 → gpflow-2.9.2/gpflow.egg-info}/PKG-INFO +3 -1
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow.egg-info/SOURCES.txt +1 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow.egg-info/requires.txt +1 -1
- {gpflow-2.9.0 → gpflow-2.9.2}/setup.py +1 -1
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/conditionals/test_uncertain_conditional.py +4 -3
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/likelihoods/test_multiclass.py +1 -1
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/models/test_svgp.py +2 -1
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/optimizers/test_scipy.py +33 -1
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/test_all.py +3 -6
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/test_functions.py +23 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/test_inducing_variables.py +2 -1
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/test_monitor.py +5 -3
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/utilities/test_training_loop.py +12 -4
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/utilities/test_traversal.py +8 -6
- gpflow-2.9.0/VERSION +0 -1
- {gpflow-2.9.0 → gpflow-2.9.2}/LICENSE +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/MANIFEST.in +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/README.md +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/benchmark/__init__.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/benchmark/benchmark_api.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/benchmark/benchmarks.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/benchmark/dataset_api.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/benchmark/datasets.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/benchmark/grouping.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/benchmark/metadata.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/benchmark/metric_api.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/benchmark/metrics.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/benchmark/model_api.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/benchmark/models.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/benchmark/paths.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/benchmark/plot.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/benchmark/plotter_api.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/benchmark/registry.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/benchmark/run.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/benchmark/sharding.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/benchmark/tag.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/doc/sphinx/benchmarks.rst +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/doc/sphinx/bibliography.rst +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/doc/sphinx/getting_started.rst +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/doc/sphinx/index.rst +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/doc/sphinx/installation.rst +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/doc/sphinx/user_guide.rst +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/ci_utils.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/conditionals/__init__.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/conditionals/conditionals.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/conditionals/dispatch.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/conditionals/multioutput/__init__.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/conditionals/multioutput/conditionals.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/conditionals/multioutput/sample_conditionals.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/conditionals/sample_conditionals.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/conditionals/uncertain_conditionals.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/conditionals/util.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/config/__config__.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/config/__init__.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/covariances/__init__.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/covariances/dispatch.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/covariances/kufs.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/covariances/kuus.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/covariances/multioutput/__init__.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/covariances/multioutput/kufs.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/covariances/multioutput/kuus.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/expectations/__init__.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/expectations/cross_kernels.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/expectations/dispatch.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/expectations/expectations.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/expectations/linears.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/expectations/mean_functions.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/expectations/misc.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/expectations/products.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/expectations/quadratures.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/expectations/squared_exponentials.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/expectations/sums.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/experimental/__init__.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/experimental/utils.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/inducing_variables/__init__.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/inducing_variables/inducing_patch.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/inducing_variables/inducing_variables.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/inducing_variables/multioutput/__init__.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/inducing_variables/multioutput/inducing_variables.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/kernels/__init__.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/kernels/base.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/kernels/categorical.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/kernels/changepoints.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/kernels/convolutional.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/kernels/linears.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/kernels/misc.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/kernels/multioutput/__init__.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/kernels/multioutput/kernels.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/kernels/periodic.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/kernels/statics.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/kernels/stationaries.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/kullback_leiblers.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/likelihoods/__init__.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/likelihoods/base.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/likelihoods/misc.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/likelihoods/multiclass.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/likelihoods/multilatent.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/likelihoods/scalar_continuous.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/likelihoods/scalar_discrete.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/likelihoods/utils.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/logdensities.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/mean_functions.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/models/__init__.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/models/cglb.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/models/gplvm.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/models/gpmc.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/models/gpr.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/models/model.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/models/sgpmc.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/models/sgpr.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/models/svgp.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/models/util.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/models/vgp.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/monitor/__init__.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/monitor/base.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/mypy_flags.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/optimizers/__init__.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/optimizers/mcmc.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/posteriors.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/probability_distributions.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/py.typed +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/quadrature/__init__.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/quadrature/base.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/quadrature/deprecated.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/quadrature/gauss_hermite.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/type_flags.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/utilities/__init__.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/utilities/bijectors.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/utilities/model_utils.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/utilities/multipledispatch.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/utilities/ops.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/utilities/parameter_or_function.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow/versions.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow.egg-info/dependency_links.txt +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/gpflow.egg-info/top_level.txt +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/setup.cfg +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/__init__.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/conditionals/__init__.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/conditionals/test_broadcasted_conditionals.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/conditionals/test_conditionals.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/conditionals/test_multioutput.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/conditionals/test_util.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/config/__init__.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/config/test_config.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/conftest.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/covariances/__init__.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/covariances/test_base_covariances.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/covariances/test_multioutput.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/expectations/__init__.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/expectations/test_expectations.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/experimental/__init__.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/experimental/test_utils.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/kernels/__init__.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/kernels/reference.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/kernels/test_broadcasting.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/kernels/test_changepoints.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/kernels/test_coregion.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/kernels/test_kernels.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/kernels/test_positive_semidefinite.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/kernels/test_scaled_euclid_dist.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/likelihoods/__init__.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/likelihoods/test_function_params.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/likelihoods/test_heteroskedastic.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/likelihoods/test_heteroskedastic_constant_variance.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/likelihoods/test_likelihoods.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/likelihoods/test_switched_likelihood.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/models/__init__.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/models/test_cglb.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/models/test_gplvm.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/models/test_gpr.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/models/test_gpr_posterior.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/models/test_mcmc.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/models/test_methods.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/models/test_model_predict.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/models/test_sgpr.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/models/test_sgpr_posterior.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/models/test_svgp_posterior.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/models/test_training_mixins.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/models/test_variational.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/models/test_vgp.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/models/test_vgp_posterior.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/optimizers/__init__.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/optimizers/test_mcmc.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/optimizers/test_natural_gradient.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/posteriors/__init__.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/posteriors/conftest.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/posteriors/test_bo_integration.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/posteriors/test_posteriors.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/test_base.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/test_base_prior.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/test_base_training.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/test_initial_value.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/test_kullback_leiblers.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/test_logdensities.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/utilities/__init__.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/utilities/test_bijectors.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/utilities/test_deepcopy.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/utilities/test_misc.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/utilities/test_model_utils.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/utilities/test_multipledispatch.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/utilities/test_ops.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/utilities/test_parameter_or_function.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/utilities/test_set_trainable.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/gpflow/utilities/test_utilities.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/integration/__init__.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/integration/test_benchmark.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/integration/test_docs.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/integration/test_dynamic_shapes.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/integration/test_linear_noise.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/integration/test_method_equivalence.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/integration/test_model_serialization.py +0 -0
- {gpflow-2.9.0 → gpflow-2.9.2}/tests/integration/test_notebooks.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: gpflow
|
|
3
|
-
Version: 2.9.
|
|
3
|
+
Version: 2.9.2
|
|
4
4
|
Summary: Gaussian process methods in TensorFlow
|
|
5
5
|
Home-page: https://www.gpflow.org
|
|
6
6
|
Author: James Hensman, Alex Matthews
|
|
@@ -9,6 +9,7 @@ License: Apache License 2.0
|
|
|
9
9
|
Project-URL: Source on GitHub, https://github.com/GPflow/GPflow
|
|
10
10
|
Project-URL: Documentation, https://gpflow.github.io/GPflow/
|
|
11
11
|
Keywords: machine-learning gaussian-processes kernels tensorflow
|
|
12
|
+
Platform: UNKNOWN
|
|
12
13
|
Classifier: Development Status :: 5 - Production/Stable
|
|
13
14
|
Classifier: Environment :: GPU :: NVIDIA CUDA
|
|
14
15
|
Classifier: Intended Audience :: Developers
|
|
@@ -216,3 +217,4 @@ which can be cited by users.
|
|
|
216
217
|
url = {https://arxiv.org/abs/2003.01115}
|
|
217
218
|
}
|
|
218
219
|
```
|
|
220
|
+
|
|
@@ -66,6 +66,39 @@ This release contains contributions from:
|
|
|
66
66
|
<INSERT>, <NAME>, <HERE>, <USING>, <GITHUB>, <HANDLE>
|
|
67
67
|
|
|
68
68
|
|
|
69
|
+
# Release 2.9.2
|
|
70
|
+
|
|
71
|
+
This patch release adds support for Tensorflow 2.16.
|
|
72
|
+
|
|
73
|
+
## Bug Fixes and Other Changes
|
|
74
|
+
|
|
75
|
+
* Support and test against Tensorflow 2.16. **Note that (like tensorflow-probability) GPflow uses Keras 2. Since TF 2.16 defaults to Keras 3, `tf.keras` must now be imported from the `tf_keras` package. Alternatively, you can import `tf_keras` from the `gpflow.keras` module, which will automatically select the right source depending on which version of TF is installed.**
|
|
76
|
+
|
|
77
|
+
## Thanks to our Contributors
|
|
78
|
+
|
|
79
|
+
This release contains contributions from:
|
|
80
|
+
|
|
81
|
+
uri-granta
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
# Release 2.9.1
|
|
85
|
+
|
|
86
|
+
This patch release fixes a number of identified issues.
|
|
87
|
+
|
|
88
|
+
## Bug Fixes and Other Changes
|
|
89
|
+
|
|
90
|
+
* Support pickling Scipy optimizers with a non-empty compile cache
|
|
91
|
+
* Allow setting a prior for A in the `Linear` mean function
|
|
92
|
+
* Avoid rounding small values in kernel summary printout
|
|
93
|
+
* Test against Tensorflow 2.15
|
|
94
|
+
|
|
95
|
+
## Thanks to our Contributors
|
|
96
|
+
|
|
97
|
+
This release contains contributions from:
|
|
98
|
+
|
|
99
|
+
JSchmiegel, uri-granta
|
|
100
|
+
|
|
101
|
+
|
|
69
102
|
# Release 2.9.0
|
|
70
103
|
|
|
71
104
|
This release adds caching of compiled graphs inside the Scipy optimizer, and adds support
|
gpflow-2.9.2/VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.9.2
|
|
@@ -18,8 +18,11 @@ from dataclasses import replace
|
|
|
18
18
|
from math import isnan
|
|
19
19
|
from typing import Collection, Tuple
|
|
20
20
|
|
|
21
|
+
import matplotlib
|
|
21
22
|
import pandas as pd
|
|
22
23
|
from matplotlib.axes import Axes
|
|
24
|
+
from matplotlib.dates import date2num
|
|
25
|
+
from packaging.version import Version
|
|
23
26
|
|
|
24
27
|
from benchmark.grouping import GroupingKey, GroupingSpec, group
|
|
25
28
|
from benchmark.metadata import BenchmarkMetadata, parse_timestamp
|
|
@@ -84,8 +87,9 @@ def metrics_box_plot(
|
|
|
84
87
|
for key, df, _ in group(metrics_df, [], metadata, line_by):
|
|
85
88
|
labels.append(_join_key(key))
|
|
86
89
|
values.append(df.value)
|
|
87
|
-
|
|
88
|
-
|
|
90
|
+
# cf https://github.com/matplotlib/matplotlib/pull/27901
|
|
91
|
+
label_id = "tick_labels" if Version(matplotlib.__version__) >= Version("3.9.0") else "labels"
|
|
92
|
+
ax.boxplot(values, **{label_id: labels}) # type: ignore[arg-type]
|
|
89
93
|
_shared_ax_config(ax, file_key, column_key, row_key, metric)
|
|
90
94
|
|
|
91
95
|
|
|
@@ -118,7 +122,7 @@ def time_line(
|
|
|
118
122
|
timestamp_by = GroupingSpec([GroupingKey.TIMESTAMP], minimise=False)
|
|
119
123
|
timestamp_groups = group(df, [], metadata, timestamp_by)
|
|
120
124
|
for (timestamp,), timestamp_df, _ in timestamp_groups:
|
|
121
|
-
parsed_timestamp = parse_timestamp(timestamp)
|
|
125
|
+
parsed_timestamp = date2num(parse_timestamp(timestamp))
|
|
122
126
|
line_xs.append(parsed_timestamp)
|
|
123
127
|
y_mean = timestamp_df.value.mean()
|
|
124
128
|
y_std = timestamp_df.value.std()
|
|
@@ -24,7 +24,7 @@ copyright = "2023, The GPflow Contributors"
|
|
|
24
24
|
author = "The GPflow Contributors"
|
|
25
25
|
|
|
26
26
|
# The full version, including alpha/beta/rc tags
|
|
27
|
-
release = "2.9.
|
|
27
|
+
release = "2.9.2"
|
|
28
28
|
|
|
29
29
|
# -- General configuration ---------------------------------------------------
|
|
30
30
|
|
|
@@ -27,19 +27,19 @@ from .type_flags import GENERIC_NP_ARRAYS, NP_TYPE_CHECKING
|
|
|
27
27
|
if TYPE_CHECKING: # pragma: no cover
|
|
28
28
|
from IPython.lib import pretty
|
|
29
29
|
|
|
30
|
-
DType = Union[np.dtype, tf.DType]
|
|
31
|
-
|
|
32
|
-
|
|
33
30
|
if TYPE_CHECKING and (not NP_TYPE_CHECKING): # pragma: no cover
|
|
34
31
|
AnyNDArray = Any
|
|
32
|
+
DType = Any
|
|
35
33
|
else:
|
|
36
34
|
if GENERIC_NP_ARRAYS:
|
|
37
35
|
# It would be nice to use something more interesting than `Any` here, but it looks like
|
|
38
36
|
# the infrastructure in the rest of the ecosystem isn't really set up for this
|
|
39
37
|
# yet. Maybe when we get Python 3.11?
|
|
40
38
|
AnyNDArray = np.ndarray[Any, Any] # type: ignore[misc]
|
|
39
|
+
DType = Union[np.dtype[Any], tf.DType] # type: ignore[misc]
|
|
41
40
|
else:
|
|
42
41
|
AnyNDArray = Union[np.ndarray] # type: ignore[misc]
|
|
42
|
+
DType = Union[np.dtype, tf.DType] # type: ignore[misc]
|
|
43
43
|
|
|
44
44
|
VariableData = Union[List[Any], Tuple[Any], AnyNDArray, int, float] # deprecated
|
|
45
45
|
Transform = Union[tfp.bijectors.Bijector]
|
|
@@ -110,7 +110,15 @@ class Linear(MeanFunction, Function):
|
|
|
110
110
|
MeanFunction.__init__(self)
|
|
111
111
|
A = np.ones((1, 1), dtype=default_float()) if A is None else A
|
|
112
112
|
b = np.zeros(1, dtype=default_float()) if b is None else b
|
|
113
|
-
|
|
113
|
+
if isinstance(A, Parameter):
|
|
114
|
+
if len(A._shape) >= 2:
|
|
115
|
+
self.A = A
|
|
116
|
+
else:
|
|
117
|
+
raise ValueError(
|
|
118
|
+
"Error 'gpflow.funcitons.Linear()' mean function. A has not the correct shape (at least 2d)."
|
|
119
|
+
)
|
|
120
|
+
else:
|
|
121
|
+
self.A = Parameter(np.atleast_2d(A))
|
|
114
122
|
self.b = Parameter(b)
|
|
115
123
|
|
|
116
124
|
@inherit_check_shapes
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Copyright 2024 The GPflow Contributors. All Rights Reserved.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
# GPflow currently uses Keras 2. Depending on the version of Tensorflow installed,
|
|
16
|
+
# this is available either at tf_keras or at tensorflow.keras. This module provides
|
|
17
|
+
# a helpful version-agnostic shortcut for importing this. Note though that importing specific
|
|
18
|
+
# identifiers can only be done via attribute lookups:
|
|
19
|
+
#
|
|
20
|
+
# >> from gpflow.keras import tf_keras
|
|
21
|
+
# >> Adam = tf_keras.optimizers.Adam
|
|
22
|
+
# >> # The following does NOT work
|
|
23
|
+
# >> from tf_keras.optimizers import Adam
|
|
24
|
+
|
|
25
|
+
try:
|
|
26
|
+
import tf_keras
|
|
27
|
+
except ModuleNotFoundError:
|
|
28
|
+
import tensorflow.keras as tf_keras
|
|
29
|
+
|
|
30
|
+
tf_keras = tf_keras
|
|
31
|
+
|
|
32
|
+
__all__ = ["tf_keras"]
|
|
@@ -47,7 +47,7 @@ class InternalDataTrainingLossMixin:
|
|
|
47
47
|
- a uniform API for the training loss :meth:`training_loss`
|
|
48
48
|
- a convenience method :meth:`training_loss_closure` for constructing the closure expected by
|
|
49
49
|
various optimizers, namely :class:`gpflow.optimizers.Scipy` and subclasses of
|
|
50
|
-
`
|
|
50
|
+
`tf_keras.optimizers.Optimizer`.
|
|
51
51
|
|
|
52
52
|
See :class:`ExternalDataTrainingLossMixin` for an equivalent mixin for models that do **not**
|
|
53
53
|
own their own data.
|
|
@@ -67,7 +67,7 @@ class InternalDataTrainingLossMixin:
|
|
|
67
67
|
"""
|
|
68
68
|
Convenience method. Returns a closure which itself returns the training loss. This closure
|
|
69
69
|
can be passed to the minimize methods on :class:`gpflow.optimizers.Scipy` and subclasses of
|
|
70
|
-
`
|
|
70
|
+
`tf_keras.optimizers.Optimizer`.
|
|
71
71
|
|
|
72
72
|
:param compile: If `True` (default), compile the training loss function in a TensorFlow
|
|
73
73
|
graph by wrapping it in tf.function()
|
|
@@ -86,7 +86,7 @@ class ExternalDataTrainingLossMixin:
|
|
|
86
86
|
- a uniform API for the training loss :meth:`training_loss`
|
|
87
87
|
- a convenience method :meth:`training_loss_closure` for constructing the closure expected by
|
|
88
88
|
various optimizers, namely :class:`gpflow.optimizers.Scipy` and subclasses of
|
|
89
|
-
`
|
|
89
|
+
`tf_keras.optimizers.Optimizer`.
|
|
90
90
|
|
|
91
91
|
See :class:`InternalDataTrainingLossMixin` for an equivalent mixin for models that **do** own
|
|
92
92
|
their own data.
|
|
@@ -20,7 +20,7 @@ from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Union
|
|
|
20
20
|
import numpy as np
|
|
21
21
|
import tensorflow as tf
|
|
22
22
|
|
|
23
|
-
from ..base import Parameter
|
|
23
|
+
from ..base import AnyNDArray, Parameter
|
|
24
24
|
from ..models import BayesianModel
|
|
25
25
|
from ..utilities import parameter_dict
|
|
26
26
|
from .base import MonitorTask
|
|
@@ -168,7 +168,11 @@ class ImageToTensorBoard(ToTensorBoard):
|
|
|
168
168
|
def __init__(
|
|
169
169
|
self,
|
|
170
170
|
log_dir: str,
|
|
171
|
-
plotting_function:
|
|
171
|
+
plotting_function: Union[
|
|
172
|
+
# if len(subplots_kw) > 1 then the function is passed an array of axes
|
|
173
|
+
Callable[["matplotlib.figure.Figure", "matplotlib.axes.Axes"], None],
|
|
174
|
+
Callable[["matplotlib.figure.Figure", AnyNDArray], None],
|
|
175
|
+
],
|
|
172
176
|
name: Optional[str] = None,
|
|
173
177
|
*,
|
|
174
178
|
fig_kw: Optional[Dict[str, Any]] = None,
|
|
@@ -16,13 +16,13 @@ import abc
|
|
|
16
16
|
import functools
|
|
17
17
|
from typing import Any, Callable, Dict, Optional, Sequence, Tuple, Union
|
|
18
18
|
|
|
19
|
-
import numpy as np
|
|
20
19
|
import tensorflow as tf
|
|
21
20
|
from check_shapes import check_shapes
|
|
22
21
|
|
|
23
|
-
from ..base import Parameter, _to_constrained
|
|
22
|
+
from ..base import AnyNDArray, Parameter, _to_constrained
|
|
23
|
+
from ..keras import tf_keras
|
|
24
24
|
|
|
25
|
-
Scalar = Union[float, tf.Tensor,
|
|
25
|
+
Scalar = Union[float, tf.Tensor, AnyNDArray]
|
|
26
26
|
LossClosure = Callable[[], tf.Tensor]
|
|
27
27
|
NatGradParameters = Union[Tuple[Parameter, Parameter], Tuple[Parameter, Parameter, "XiTransform"]]
|
|
28
28
|
|
|
@@ -173,7 +173,7 @@ class XiSqrtMeanVar(XiTransform):
|
|
|
173
173
|
return natural_to_meanvarsqrt(nat1, nat2)
|
|
174
174
|
|
|
175
175
|
|
|
176
|
-
class NaturalGradient(
|
|
176
|
+
class NaturalGradient(tf_keras.optimizers.Optimizer):
|
|
177
177
|
"""
|
|
178
178
|
Implements a natural gradient descent optimizer for variational models
|
|
179
179
|
that are based on a distribution q(u) = N(q_mu, q_sqrt q_sqrtᵀ) that is
|
|
@@ -181,7 +181,7 @@ class NaturalGradient(tf.optimizers.Optimizer):
|
|
|
181
181
|
of the covariance.
|
|
182
182
|
|
|
183
183
|
Note that this optimizer does not implement the standard API of
|
|
184
|
-
|
|
184
|
+
tf_keras.optimizers.Optimizer. Its only public method is minimize(), which has
|
|
185
185
|
a custom signature (var_list needs to be a list of (q_mu, q_sqrt) tuples,
|
|
186
186
|
where q_mu and q_sqrt are gpflow.Parameter instances, not tf.Variable).
|
|
187
187
|
|
|
@@ -17,6 +17,7 @@ from collections import OrderedDict
|
|
|
17
17
|
from typing import (
|
|
18
18
|
Any,
|
|
19
19
|
Callable,
|
|
20
|
+
Dict,
|
|
20
21
|
FrozenSet,
|
|
21
22
|
Iterable,
|
|
22
23
|
List,
|
|
@@ -68,6 +69,12 @@ class Scipy:
|
|
|
68
69
|
)
|
|
69
70
|
self.compile_cache_size = compile_cache_size
|
|
70
71
|
|
|
72
|
+
def __getstate__(self) -> Dict[str, Any]:
|
|
73
|
+
# Don't try to save the compile cache
|
|
74
|
+
state = self.__dict__.copy()
|
|
75
|
+
state["compile_cache"] = OrderedDict()
|
|
76
|
+
return state
|
|
77
|
+
|
|
71
78
|
def minimize(
|
|
72
79
|
self,
|
|
73
80
|
closure: LossClosure,
|
|
@@ -29,6 +29,8 @@ __all__ = [
|
|
|
29
29
|
"training_loop",
|
|
30
30
|
]
|
|
31
31
|
|
|
32
|
+
from ..keras import tf_keras
|
|
33
|
+
|
|
32
34
|
|
|
33
35
|
@check_shapes(
|
|
34
36
|
"x: [any...]",
|
|
@@ -73,7 +75,7 @@ def is_variable(t: TensorData) -> bool:
|
|
|
73
75
|
|
|
74
76
|
def training_loop(
|
|
75
77
|
closure: Callable[[], tf.Tensor],
|
|
76
|
-
optimizer: Optional[
|
|
78
|
+
optimizer: Optional[tf_keras.optimizers.Optimizer] = None,
|
|
77
79
|
var_list: Optional[List[tf.Variable]] = None,
|
|
78
80
|
maxiter: int = 1_000,
|
|
79
81
|
compile: bool = False,
|
|
@@ -90,7 +92,7 @@ def training_loop(
|
|
|
90
92
|
:return:
|
|
91
93
|
"""
|
|
92
94
|
|
|
93
|
-
safe_optimizer =
|
|
95
|
+
safe_optimizer = tf_keras.optimizers.Adam() if optimizer is None else optimizer
|
|
94
96
|
safe_var_list = [] if var_list is None else var_list
|
|
95
97
|
|
|
96
98
|
def optimization_step() -> None:
|
|
@@ -331,7 +331,7 @@ def _first_three_elements_regexp() -> Pattern[str]:
|
|
|
331
331
|
|
|
332
332
|
|
|
333
333
|
def _str_tensor_value(value: AnyNDArray) -> str:
|
|
334
|
-
value_str = str(np.around(value, 5))
|
|
334
|
+
value_str = str(np.where(np.abs(value) < 1, value, np.around(value, 5)))
|
|
335
335
|
if value.size <= 3:
|
|
336
336
|
return value_str
|
|
337
337
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: gpflow
|
|
3
|
-
Version: 2.9.
|
|
3
|
+
Version: 2.9.2
|
|
4
4
|
Summary: Gaussian process methods in TensorFlow
|
|
5
5
|
Home-page: https://www.gpflow.org
|
|
6
6
|
Author: James Hensman, Alex Matthews
|
|
@@ -9,6 +9,7 @@ License: Apache License 2.0
|
|
|
9
9
|
Project-URL: Source on GitHub, https://github.com/GPflow/GPflow
|
|
10
10
|
Project-URL: Documentation, https://gpflow.github.io/GPflow/
|
|
11
11
|
Keywords: machine-learning gaussian-processes kernels tensorflow
|
|
12
|
+
Platform: UNKNOWN
|
|
12
13
|
Classifier: Development Status :: 5 - Production/Stable
|
|
13
14
|
Classifier: Environment :: GPU :: NVIDIA CUDA
|
|
14
15
|
Classifier: Intended Audience :: Developers
|
|
@@ -216,3 +217,4 @@ which can be cited by users.
|
|
|
216
217
|
url = {https://arxiv.org/abs/2003.01115}
|
|
217
218
|
}
|
|
218
219
|
```
|
|
220
|
+
|
|
@@ -16,7 +16,7 @@ requirements = [
|
|
|
16
16
|
"scipy",
|
|
17
17
|
"setuptools>=41.0.0", # to satisfy dependency constraints
|
|
18
18
|
"tabulate",
|
|
19
|
-
"tensorflow-probability>=0.12.0",
|
|
19
|
+
"tensorflow-probability[tf]>=0.12.0",
|
|
20
20
|
"tensorflow>=2.4.0; platform_system!='Darwin' or platform_machine!='arm64'",
|
|
21
21
|
# NOTE: Support of Apple Silicon MacOS platforms is in an experimental mode
|
|
22
22
|
"tensorflow-macos>=2.4.0; platform_system=='Darwin' and platform_machine=='arm64'",
|
|
@@ -24,6 +24,7 @@ import gpflow
|
|
|
24
24
|
from gpflow.base import AnyNDArray, MeanAndVariance
|
|
25
25
|
from gpflow.conditionals import conditional, uncertain_conditional
|
|
26
26
|
from gpflow.config import default_float
|
|
27
|
+
from gpflow.keras import tf_keras
|
|
27
28
|
from gpflow.mean_functions import Constant, Linear, MeanFunction, Zero
|
|
28
29
|
from gpflow.quadrature import mvnquad
|
|
29
30
|
from gpflow.utilities import training_loop
|
|
@@ -193,7 +194,7 @@ def test_no_uncertainty(white: bool, mean: Optional[str]) -> None:
|
|
|
193
194
|
|
|
194
195
|
training_loop(
|
|
195
196
|
model.training_loss_closure(Data.data),
|
|
196
|
-
optimizer=
|
|
197
|
+
optimizer=tf_keras.optimizers.Adam(),
|
|
197
198
|
var_list=model.trainable_variables,
|
|
198
199
|
maxiter=100,
|
|
199
200
|
compile=True,
|
|
@@ -226,7 +227,7 @@ def test_monte_carlo_1_din(white: bool, mean: Optional[str]) -> None:
|
|
|
226
227
|
|
|
227
228
|
training_loop(
|
|
228
229
|
model.training_loss_closure(DataMC1.data),
|
|
229
|
-
optimizer=
|
|
230
|
+
optimizer=tf_keras.optimizers.Adam(),
|
|
230
231
|
var_list=model.trainable_variables,
|
|
231
232
|
maxiter=200,
|
|
232
233
|
compile=True,
|
|
@@ -261,7 +262,7 @@ def test_monte_carlo_2_din(white: bool, mean: Optional[str]) -> None:
|
|
|
261
262
|
|
|
262
263
|
training_loop(
|
|
263
264
|
model.training_loss_closure(DataMC2.data),
|
|
264
|
-
optimizer=
|
|
265
|
+
optimizer=tf_keras.optimizers.Adam(),
|
|
265
266
|
var_list=model.trainable_variables,
|
|
266
267
|
maxiter=100,
|
|
267
268
|
compile=True,
|
|
@@ -48,7 +48,7 @@ def test_softmax_y_shape_assert(num: int, dimX: int, dimF: int, dimY: int) -> No
|
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
@pytest.mark.parametrize("dimX", [3])
|
|
51
|
-
@pytest.mark.parametrize("num", [
|
|
51
|
+
@pytest.mark.parametrize("num", [8, 3])
|
|
52
52
|
@pytest.mark.parametrize("dimF, dimY", [[2, 1]])
|
|
53
53
|
def test_softmax_bernoulli_equivalence(num: int, dimX: int, dimF: int, dimY: int) -> None:
|
|
54
54
|
X = tf.random.normal((num, dimX))
|
|
@@ -21,6 +21,7 @@ from numpy.testing import assert_allclose
|
|
|
21
21
|
import gpflow
|
|
22
22
|
from gpflow import set_trainable
|
|
23
23
|
from gpflow.base import AnyNDArray
|
|
24
|
+
from gpflow.keras import tf_keras
|
|
24
25
|
from gpflow.models import SVGP
|
|
25
26
|
|
|
26
27
|
|
|
@@ -184,7 +185,7 @@ def test_stochastic_gradients(
|
|
|
184
185
|
|
|
185
186
|
def training_loop(indices: Sequence[int], num_data: int, max_iter: int) -> SVGP:
|
|
186
187
|
model = get_model(num_data)
|
|
187
|
-
opt =
|
|
188
|
+
opt = tf_keras.optimizers.SGD(learning_rate=0.001)
|
|
188
189
|
data = X[indices], Y[indices]
|
|
189
190
|
for _ in range(max_iter):
|
|
190
191
|
with tf.GradientTape() as tape:
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
|
-
|
|
14
|
+
import copy
|
|
15
15
|
import unittest
|
|
16
16
|
import warnings
|
|
17
17
|
from typing import Any, Callable, Dict, List, Sequence, Tuple
|
|
@@ -545,3 +545,35 @@ def test_scipy__cache_with_different_models() -> None:
|
|
|
545
545
|
|
|
546
546
|
# Check that the cache was bypassed and a new compiled function was created
|
|
547
547
|
assert len(opt.compile_cache) == 2
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
def test_scipy__deep_copyable() -> None:
|
|
551
|
+
opt = gpflow.optimizers.Scipy()
|
|
552
|
+
variables1 = _create_variables()
|
|
553
|
+
counter1 = [0]
|
|
554
|
+
closure1 = _loss_closure_builder(counter1, variables1)
|
|
555
|
+
|
|
556
|
+
# Ensure the cache is empty
|
|
557
|
+
assert len(opt.compile_cache) == 0
|
|
558
|
+
|
|
559
|
+
# Call eval_func multiple times with the same arguments
|
|
560
|
+
for _ in range(4):
|
|
561
|
+
opt.minimize(
|
|
562
|
+
closure1, variables1, compile=True, tf_fun_args={}, allow_unused_variables=False
|
|
563
|
+
)
|
|
564
|
+
# Check that the cache was used
|
|
565
|
+
assert len(opt.compile_cache) == 1
|
|
566
|
+
|
|
567
|
+
# Check that the optimizer can still be deepcopied
|
|
568
|
+
opt_copy = copy.deepcopy(opt)
|
|
569
|
+
|
|
570
|
+
# The cache is not copied
|
|
571
|
+
assert len(opt_copy.compile_cache) == 0
|
|
572
|
+
|
|
573
|
+
# Call eval_func multiple times with the same arguments
|
|
574
|
+
for _ in range(4):
|
|
575
|
+
opt_copy.minimize(
|
|
576
|
+
closure1, variables1, compile=True, tf_fun_args={}, allow_unused_variables=False
|
|
577
|
+
)
|
|
578
|
+
# Check that the cache was used
|
|
579
|
+
assert len(opt_copy.compile_cache) == 1
|
|
@@ -58,14 +58,11 @@ _MODULES_WITH_ALL = [m for m in _MODULES if hasattr(m, "__all__")]
|
|
|
58
58
|
|
|
59
59
|
@pytest.mark.parametrize("package", _PACKAGES)
|
|
60
60
|
def test_all_present_and_up_to_date(package: ModuleType) -> None:
|
|
61
|
-
|
|
61
|
+
imported_set = set(attr for attr in dir(package) if not is_dunder(attr))
|
|
62
62
|
all_list = getattr(package, "__all__", None)
|
|
63
63
|
assert all_list is not None, f"Package {package} is missing an explicit __all__."
|
|
64
|
-
|
|
65
|
-
assert
|
|
66
|
-
f"{package}.__all__ is outdated."
|
|
67
|
-
f" Imported values are {imported_sorted}, but exported values are {all_list}."
|
|
68
|
-
)
|
|
64
|
+
all_set = set(attr for attr in all_list if not is_dunder(attr))
|
|
65
|
+
assert imported_set == all_set, f"{package}.__all__ is outdated."
|
|
69
66
|
|
|
70
67
|
|
|
71
68
|
@pytest.mark.parametrize("module", _MODULES_WITH_ALL)
|
|
@@ -16,6 +16,7 @@ from typing import Any, Sequence, Tuple, Type
|
|
|
16
16
|
|
|
17
17
|
import numpy as np
|
|
18
18
|
import pytest
|
|
19
|
+
import tensorflow_probability as tfp
|
|
19
20
|
from check_shapes import check_shapes
|
|
20
21
|
from numpy.testing import assert_allclose
|
|
21
22
|
|
|
@@ -371,3 +372,25 @@ def test_models_with_mean_functions_changes(model_class: Type[Any]) -> None:
|
|
|
371
372
|
assert np.all(var_zero.numpy() == var_non_zero.numpy())
|
|
372
373
|
# predictive mean changes after modifying mean function
|
|
373
374
|
assert not np.all(mu_zero.numpy() == mu_non_zero.numpy())
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
class TestIssue2091EnsureParameterTypeForLinearMeanFunction:
|
|
378
|
+
"""
|
|
379
|
+
See github issue #2091. These are tests to ensure that the prior is kept if A is already given as Parameter.
|
|
380
|
+
"""
|
|
381
|
+
|
|
382
|
+
# test_parameter_with_correct_shape
|
|
383
|
+
def test_parameter_with_correct_shape(self) -> None:
|
|
384
|
+
"Check that Linear copies the prior from a correctly shaped A Parameter"
|
|
385
|
+
A = gpflow.Parameter(
|
|
386
|
+
np.ones((1, 1)), dtype=np.float64, prior=tfp.distributions.Normal(0.0, 1.0)
|
|
387
|
+
)
|
|
388
|
+
linear_function = Linear(A, 1)
|
|
389
|
+
assert linear_function.A.prior is not None
|
|
390
|
+
|
|
391
|
+
# test_parameter_with_incorrect_shape
|
|
392
|
+
def test_parameter_with_incorrect_shape(self) -> None:
|
|
393
|
+
"Check that Linear throws an error when the A Parameter is not correctly shaped"
|
|
394
|
+
A = gpflow.Parameter(np.zeros(20), dtype=np.float64)
|
|
395
|
+
with pytest.raises(ValueError):
|
|
396
|
+
Linear(A, 1)
|
|
@@ -23,6 +23,7 @@ from check_shapes.error_contexts import ErrorContext, MessageBuilder
|
|
|
23
23
|
|
|
24
24
|
import gpflow
|
|
25
25
|
import gpflow.inducing_variables as giv
|
|
26
|
+
from gpflow.keras import tf_keras
|
|
26
27
|
|
|
27
28
|
|
|
28
29
|
@dataclass(frozen=True)
|
|
@@ -50,7 +51,7 @@ def test_inducing_points_with_variable_shape() -> None:
|
|
|
50
51
|
m = gpflow.models.SGPR(data=(X, Y), kernel=gpflow.kernels.Matern32(), inducing_variable=iv)
|
|
51
52
|
|
|
52
53
|
# Check 1: that we can still optimize with None shape
|
|
53
|
-
opt =
|
|
54
|
+
opt = tf_keras.optimizers.Adam()
|
|
54
55
|
|
|
55
56
|
@tf.function
|
|
56
57
|
def optimization_step() -> None:
|
|
@@ -11,6 +11,8 @@ from matplotlib.axes import Axes
|
|
|
11
11
|
from matplotlib.figure import Figure
|
|
12
12
|
|
|
13
13
|
import gpflow
|
|
14
|
+
from gpflow.base import AnyNDArray
|
|
15
|
+
from gpflow.keras import tf_keras
|
|
14
16
|
from gpflow.models import GPR, GPModel
|
|
15
17
|
from gpflow.monitor import (
|
|
16
18
|
ExecuteCallback,
|
|
@@ -105,7 +107,7 @@ def test_ImageToTensorBoard(tmp_path: Path) -> None:
|
|
|
105
107
|
"""Smoke test `ImageToTensorBoard` in Eager and Compiled mode."""
|
|
106
108
|
tmp_path_str = str(tmp_path)
|
|
107
109
|
|
|
108
|
-
def plotting_cb(fig: Figure, axes:
|
|
110
|
+
def plotting_cb(fig: Figure, axes: AnyNDArray) -> None:
|
|
109
111
|
axes[0, 0].plot(np.random.randn(2), np.random.randn(2))
|
|
110
112
|
axes[1, 0].plot(np.random.randn(2), np.random.randn(2))
|
|
111
113
|
axes[0, 1].plot(np.random.randn(2), np.random.randn(2))
|
|
@@ -303,7 +305,7 @@ def test_logdir_created(monitor: Monitor, model: GPModel, tmp_path: Path) -> Non
|
|
|
303
305
|
size_before = _get_size_directory(tmp_path)
|
|
304
306
|
assert size_before > 0
|
|
305
307
|
|
|
306
|
-
opt =
|
|
308
|
+
opt = tf_keras.optimizers.Adam()
|
|
307
309
|
for step in range(Data.num_steps):
|
|
308
310
|
opt.minimize(model.training_loss, model.trainable_variables)
|
|
309
311
|
monitor(step)
|
|
@@ -313,7 +315,7 @@ def test_logdir_created(monitor: Monitor, model: GPModel, tmp_path: Path) -> Non
|
|
|
313
315
|
|
|
314
316
|
|
|
315
317
|
def test_compile_monitor(monitor: Monitor, model: GPModel) -> None:
|
|
316
|
-
opt =
|
|
318
|
+
opt = tf_keras.optimizers.Adam()
|
|
317
319
|
|
|
318
320
|
@tf.function
|
|
319
321
|
def tf_func(step: tf.Tensor) -> None:
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
from typing import Any
|
|
2
2
|
|
|
3
3
|
import numpy as np
|
|
4
|
-
import tensorflow as tf
|
|
5
4
|
from check_shapes import ShapeChecker
|
|
6
5
|
|
|
7
6
|
import gpflow
|
|
7
|
+
from gpflow.keras import tf_keras
|
|
8
8
|
from gpflow.utilities import training_loop
|
|
9
9
|
|
|
10
10
|
|
|
@@ -43,10 +43,18 @@ def test_training_loop_compiles() -> None:
|
|
|
43
43
|
m1 = create_model()
|
|
44
44
|
m2 = create_model()
|
|
45
45
|
training_loop(
|
|
46
|
-
m1.training_loss,
|
|
46
|
+
m1.training_loss,
|
|
47
|
+
tf_keras.optimizers.Adam(),
|
|
48
|
+
m1.trainable_variables,
|
|
49
|
+
maxiter=50,
|
|
50
|
+
compile=True,
|
|
47
51
|
)
|
|
48
52
|
training_loop(
|
|
49
|
-
m2.training_loss,
|
|
53
|
+
m2.training_loss,
|
|
54
|
+
tf_keras.optimizers.Adam(),
|
|
55
|
+
m2.trainable_variables,
|
|
56
|
+
maxiter=50,
|
|
57
|
+
compile=False,
|
|
50
58
|
)
|
|
51
59
|
assert_models_close(m1, m2)
|
|
52
60
|
|
|
@@ -57,7 +65,7 @@ def test_training_loop_converges() -> None:
|
|
|
57
65
|
gpflow.optimizers.Scipy().minimize(mref.training_loss, mref.trainable_variables)
|
|
58
66
|
training_loop(
|
|
59
67
|
m.training_loss,
|
|
60
|
-
|
|
68
|
+
tf_keras.optimizers.Adam(learning_rate=0.01),
|
|
61
69
|
m.trainable_variables,
|
|
62
70
|
maxiter=5000,
|
|
63
71
|
compile=True,
|