qpytorch 0.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.
Potentially problematic release.
This version of qpytorch might be problematic. Click here for more details.
- qpytorch-0.1/.conda/meta.yaml +52 -0
- qpytorch-0.1/.github/workflows/deploy.yml +59 -0
- qpytorch-0.1/.github/workflows/run_test_suite.yml +85 -0
- qpytorch-0.1/.gitignore +196 -0
- qpytorch-0.1/.readthedocs.yaml +35 -0
- qpytorch-0.1/CONTRIBUTING.md +130 -0
- qpytorch-0.1/LICENSE +21 -0
- qpytorch-0.1/PKG-INFO +142 -0
- qpytorch-0.1/README.md +120 -0
- qpytorch-0.1/docs/Makefile +20 -0
- qpytorch-0.1/docs/source/.gitignore +1 -0
- qpytorch-0.1/docs/source/_static/custom.css +19 -0
- qpytorch-0.1/docs/source/_static/custom.js +35 -0
- qpytorch-0.1/docs/source/beta_features.rst +12 -0
- qpytorch-0.1/docs/source/conf.py +372 -0
- qpytorch-0.1/docs/source/constraints.rst +38 -0
- qpytorch-0.1/docs/source/distributions.rst +100 -0
- qpytorch-0.1/docs/source/functions.rst +37 -0
- qpytorch-0.1/docs/source/index.rst +81 -0
- qpytorch-0.1/docs/source/keops_kernels.rst +40 -0
- qpytorch-0.1/docs/source/kernels.rst +235 -0
- qpytorch-0.1/docs/source/likelihoods.rst +139 -0
- qpytorch-0.1/docs/source/linear_operator_objects.inv +0 -0
- qpytorch-0.1/docs/source/marginal_log_likelihoods.rst +102 -0
- qpytorch-0.1/docs/source/means.rst +73 -0
- qpytorch-0.1/docs/source/metrics.rst +20 -0
- qpytorch-0.1/docs/source/models.rst +145 -0
- qpytorch-0.1/docs/source/module.rst +13 -0
- qpytorch-0.1/docs/source/optim.rst +69 -0
- qpytorch-0.1/docs/source/priors.rst +69 -0
- qpytorch-0.1/docs/source/settings.rst +12 -0
- qpytorch-0.1/docs/source/utils.rst +41 -0
- qpytorch-0.1/docs/source/variational.rst +221 -0
- qpytorch-0.1/examples/.gitignore +5 -0
- qpytorch-0.1/examples/00_Basic_Usage/Hyperparameters.ipynb +531 -0
- qpytorch-0.1/examples/00_Basic_Usage/Implementing_a_custom_Kernel.ipynb +441 -0
- qpytorch-0.1/examples/00_Basic_Usage/Introduction_to_QExponential_Process.ipynb +236 -0
- qpytorch-0.1/examples/00_Basic_Usage/Metrics.ipynb +505 -0
- qpytorch-0.1/examples/00_Basic_Usage/README.rst +48 -0
- qpytorch-0.1/examples/00_Basic_Usage/Saving_and_Loading_Models.ipynb +440 -0
- qpytorch-0.1/examples/00_Basic_Usage/index.rst +48 -0
- qpytorch-0.1/examples/00_Basic_Usage/kernels_with_additive_or_product_structure.ipynb +590 -0
- qpytorch-0.1/examples/00_Basic_Usage/satallite_truth_obs.png +0 -0
- qpytorch-0.1/examples/00_Basic_Usage/statellite_reconstructions.png +0 -0
- qpytorch-0.1/examples/01_Exact_QEPs/QEP_Regression_DistributionalKernel.ipynb +854 -0
- qpytorch-0.1/examples/01_Exact_QEPs/QEP_Regression_Fully_Bayesian.ipynb +286 -0
- qpytorch-0.1/examples/01_Exact_QEPs/QEP_Regression_on_Classification_Labels.ipynb +480 -0
- qpytorch-0.1/examples/01_Exact_QEPs/README.rst +40 -0
- qpytorch-0.1/examples/01_Exact_QEPs/Simple_QEP_Regression.ipynb +429 -0
- qpytorch-0.1/examples/01_Exact_QEPs/Spectral_Delta_QEP_Regression.ipynb +403 -0
- qpytorch-0.1/examples/01_Exact_QEPs/Spectral_Mixture_QEP_Regression.ipynb +340 -0
- qpytorch-0.1/examples/01_Exact_QEPs/index.rst +40 -0
- qpytorch-0.1/examples/02_Scalable_Exact_QEPs/Exact_QEP_Posterior_Sampling_with_CIQ.ipynb +442 -0
- qpytorch-0.1/examples/02_Scalable_Exact_QEPs/Grid_QEP_Regression.ipynb +321 -0
- qpytorch-0.1/examples/02_Scalable_Exact_QEPs/KISSQEP_Regression.ipynb +485 -0
- qpytorch-0.1/examples/02_Scalable_Exact_QEPs/KeOps_QEP_Regression.ipynb +270 -0
- qpytorch-0.1/examples/02_Scalable_Exact_QEPs/README.rst +112 -0
- qpytorch-0.1/examples/02_Scalable_Exact_QEPs/SQEPR_Regression_CUDA.ipynb +299 -0
- qpytorch-0.1/examples/02_Scalable_Exact_QEPs/Scalable_Kernel_Interpolation_for_Products_CUDA.ipynb +354 -0
- qpytorch-0.1/examples/02_Scalable_Exact_QEPs/Simple_MultiGPU_QEP_Regression.ipynb +333 -0
- qpytorch-0.1/examples/02_Scalable_Exact_QEPs/Simple_QEP_Regression_CUDA.ipynb +362 -0
- qpytorch-0.1/examples/02_Scalable_Exact_QEPs/Simple_QEP_Regression_With_LOVE_Fast_Variances_and_Sampling.ipynb +553 -0
- qpytorch-0.1/examples/02_Scalable_Exact_QEPs/index.rst +112 -0
- qpytorch-0.1/examples/03_Multitask_Exact_QEPs/Batch_Uncorrelated_Multioutput_QEP.ipynb +338 -0
- qpytorch-0.1/examples/03_Multitask_Exact_QEPs/Hadamard_Multitask_QEP_Regression.ipynb +348 -0
- qpytorch-0.1/examples/03_Multitask_Exact_QEPs/ModelList_QEP_Regression.ipynb +338 -0
- qpytorch-0.1/examples/03_Multitask_Exact_QEPs/Multitask_QEP_Regression.ipynb +325 -0
- qpytorch-0.1/examples/03_Multitask_Exact_QEPs/README.rst +51 -0
- qpytorch-0.1/examples/03_Multitask_Exact_QEPs/index.rst +51 -0
- qpytorch-0.1/examples/045_QEPLVM/QEP_LVM_for_Regularizing_Latent_Representations.ipynb +376 -0
- qpytorch-0.1/examples/045_QEPLVM/QExponential_Process_Latent_Variable_Models_with_Stochastic_Variational_Inference.ipynb +372 -0
- qpytorch-0.1/examples/045_QEPLVM/README.rst +21 -0
- qpytorch-0.1/examples/045_QEPLVM/index.rst +21 -0
- qpytorch-0.1/examples/04_Variational_and_Approximate_QEPs/Approximate_QEP_Objective_Functions.ipynb +301 -0
- qpytorch-0.1/examples/04_Variational_and_Approximate_QEPs/Modifying_the_variational_strategy_and_distribution.ipynb +501 -0
- qpytorch-0.1/examples/04_Variational_and_Approximate_QEPs/Natural_Gradient_Descent.ipynb +398 -0
- qpytorch-0.1/examples/04_Variational_and_Approximate_QEPs/Non_Gaussian_Likelihoods.ipynb +438 -0
- qpytorch-0.1/examples/04_Variational_and_Approximate_QEPs/PolyaGamma_Binary_Classification.ipynb +1825 -0
- qpytorch-0.1/examples/04_Variational_and_Approximate_QEPs/QEP_Regression_with_Uncertain_Inputs.ipynb +302 -0
- qpytorch-0.1/examples/04_Variational_and_Approximate_QEPs/README.rst +78 -0
- qpytorch-0.1/examples/04_Variational_and_Approximate_QEPs/SVQEP_CIQ.ipynb +362 -0
- qpytorch-0.1/examples/04_Variational_and_Approximate_QEPs/SVQEP_Multitask_QEP_Regression.ipynb +462 -0
- qpytorch-0.1/examples/04_Variational_and_Approximate_QEPs/SVQEP_Regression_CUDA.ipynb +377 -0
- qpytorch-0.1/examples/04_Variational_and_Approximate_QEPs/VNNQEP.ipynb +1099 -0
- qpytorch-0.1/examples/04_Variational_and_Approximate_QEPs/index.rst +78 -0
- qpytorch-0.1/examples/05_Deep_QExponential_Processes/DQEP_Multitask_Regression.ipynb +306 -0
- qpytorch-0.1/examples/05_Deep_QExponential_Processes/Deep_QExponential_Processes.ipynb +552 -0
- qpytorch-0.1/examples/05_Deep_QExponential_Processes/Deep_Sigma_Point_Processes.ipynb +6126 -0
- qpytorch-0.1/examples/05_Deep_QExponential_Processes/README.rst +26 -0
- qpytorch-0.1/examples/05_Deep_QExponential_Processes/index.rst +26 -0
- qpytorch-0.1/examples/06_PyTorch_NN_Integration_DKL/.gitignore +2 -0
- qpytorch-0.1/examples/06_PyTorch_NN_Integration_DKL/Deep_Kernel_Learning_DenseNet_CIFAR_Tutorial.ipynb +397 -0
- qpytorch-0.1/examples/06_PyTorch_NN_Integration_DKL/KISSQEP_Deep_Kernel_Regression_CUDA.ipynb +337 -0
- qpytorch-0.1/examples/06_PyTorch_NN_Integration_DKL/README.rst +30 -0
- qpytorch-0.1/examples/06_PyTorch_NN_Integration_DKL/densenet.py +116 -0
- qpytorch-0.1/examples/06_PyTorch_NN_Integration_DKL/index.rst +30 -0
- qpytorch-0.1/examples/07_QEP_Modeling_with_Derivatives/README.rst +31 -0
- qpytorch-0.1/examples/07_QEP_Modeling_with_Derivatives/SVQEP_Regression_Derivative_Information_2d.ipynb +359 -0
- qpytorch-0.1/examples/07_QEP_Modeling_with_Derivatives/Simple_QEP_Regression_Derivative_Information_1d.ipynb +318 -0
- qpytorch-0.1/examples/07_QEP_Modeling_with_Derivatives/Simple_QEP_Regression_Derivative_Information_2d.ipynb +585 -0
- qpytorch-0.1/examples/07_QEP_Modeling_with_Derivatives/index.rst +31 -0
- qpytorch-0.1/examples/LBFGS.py +1127 -0
- qpytorch-0.1/examples/README.rst +7 -0
- qpytorch-0.1/examples/index.rst +7 -0
- qpytorch-0.1/pyproject.toml +13 -0
- qpytorch-0.1/qpytorch/__init__.py +327 -0
- qpytorch-0.1/qpytorch/constraints/__init__.py +3 -0
- qpytorch-0.1/qpytorch/distributions/__init__.py +21 -0
- qpytorch-0.1/qpytorch/distributions/delta.py +86 -0
- qpytorch-0.1/qpytorch/distributions/multitask_multivariate_qexponential.py +435 -0
- qpytorch-0.1/qpytorch/distributions/multivariate_qexponential.py +581 -0
- qpytorch-0.1/qpytorch/distributions/power.py +113 -0
- qpytorch-0.1/qpytorch/distributions/qexponential.py +153 -0
- qpytorch-0.1/qpytorch/functions/__init__.py +58 -0
- qpytorch-0.1/qpytorch/kernels/__init__.py +80 -0
- qpytorch-0.1/qpytorch/kernels/grid_interpolation_kernel.py +213 -0
- qpytorch-0.1/qpytorch/kernels/inducing_point_kernel.py +151 -0
- qpytorch-0.1/qpytorch/kernels/kernel.py +695 -0
- qpytorch-0.1/qpytorch/kernels/matern32_kernel_grad.py +155 -0
- qpytorch-0.1/qpytorch/kernels/matern52_kernel_grad.py +194 -0
- qpytorch-0.1/qpytorch/kernels/matern52_kernel_gradgrad.py +248 -0
- qpytorch-0.1/qpytorch/kernels/polynomial_kernel_grad.py +88 -0
- qpytorch-0.1/qpytorch/kernels/qexponential_symmetrized_kl_kernel.py +61 -0
- qpytorch-0.1/qpytorch/kernels/rbf_kernel_grad.py +125 -0
- qpytorch-0.1/qpytorch/kernels/rbf_kernel_gradgrad.py +186 -0
- qpytorch-0.1/qpytorch/kernels/rff_kernel.py +153 -0
- qpytorch-0.1/qpytorch/lazy/__init__.py +9 -0
- qpytorch-0.1/qpytorch/likelihoods/__init__.py +66 -0
- qpytorch-0.1/qpytorch/likelihoods/bernoulli_likelihood.py +75 -0
- qpytorch-0.1/qpytorch/likelihoods/beta_likelihood.py +76 -0
- qpytorch-0.1/qpytorch/likelihoods/gaussian_likelihood.py +472 -0
- qpytorch-0.1/qpytorch/likelihoods/laplace_likelihood.py +59 -0
- qpytorch-0.1/qpytorch/likelihoods/likelihood.py +437 -0
- qpytorch-0.1/qpytorch/likelihoods/likelihood_list.py +60 -0
- qpytorch-0.1/qpytorch/likelihoods/multitask_gaussian_likelihood.py +542 -0
- qpytorch-0.1/qpytorch/likelihoods/multitask_qexponential_likelihood.py +545 -0
- qpytorch-0.1/qpytorch/likelihoods/noise_models.py +184 -0
- qpytorch-0.1/qpytorch/likelihoods/qexponential_likelihood.py +494 -0
- qpytorch-0.1/qpytorch/likelihoods/softmax_likelihood.py +97 -0
- qpytorch-0.1/qpytorch/likelihoods/student_t_likelihood.py +90 -0
- qpytorch-0.1/qpytorch/means/__init__.py +23 -0
- qpytorch-0.1/qpytorch/metrics/__init__.py +17 -0
- qpytorch-0.1/qpytorch/mlls/__init__.py +53 -0
- qpytorch-0.1/qpytorch/mlls/_approximate_mll.py +79 -0
- qpytorch-0.1/qpytorch/mlls/deep_approximate_mll.py +30 -0
- qpytorch-0.1/qpytorch/mlls/deep_predictive_log_likelihood.py +32 -0
- qpytorch-0.1/qpytorch/mlls/exact_marginal_log_likelihood.py +96 -0
- qpytorch-0.1/qpytorch/mlls/gamma_robust_variational_elbo.py +106 -0
- qpytorch-0.1/qpytorch/mlls/inducing_point_kernel_added_loss_term.py +69 -0
- qpytorch-0.1/qpytorch/mlls/kl_qexponential_added_loss_term.py +41 -0
- qpytorch-0.1/qpytorch/mlls/leave_one_out_pseudo_likelihood.py +73 -0
- qpytorch-0.1/qpytorch/mlls/marginal_log_likelihood.py +48 -0
- qpytorch-0.1/qpytorch/mlls/predictive_log_likelihood.py +76 -0
- qpytorch-0.1/qpytorch/mlls/sum_marginal_log_likelihood.py +40 -0
- qpytorch-0.1/qpytorch/mlls/variational_elbo.py +77 -0
- qpytorch-0.1/qpytorch/models/__init__.py +72 -0
- qpytorch-0.1/qpytorch/models/approximate_qep.py +115 -0
- qpytorch-0.1/qpytorch/models/deep_qeps/__init__.py +22 -0
- qpytorch-0.1/qpytorch/models/deep_qeps/deep_qep.py +155 -0
- qpytorch-0.1/qpytorch/models/deep_qeps/dspp.py +114 -0
- qpytorch-0.1/qpytorch/models/exact_prediction_strategies.py +880 -0
- qpytorch-0.1/qpytorch/models/exact_qep.py +349 -0
- qpytorch-0.1/qpytorch/models/model_list.py +100 -0
- qpytorch-0.1/qpytorch/models/pyro/__init__.py +28 -0
- qpytorch-0.1/qpytorch/models/pyro/_pyro_mixin.py +57 -0
- qpytorch-0.1/qpytorch/models/pyro/distributions/__init__.py +5 -0
- qpytorch-0.1/qpytorch/models/pyro/pyro_qep.py +105 -0
- qpytorch-0.1/qpytorch/models/qep.py +7 -0
- qpytorch-0.1/qpytorch/models/qeplvm/__init__.py +6 -0
- qpytorch-0.1/qpytorch/models/qeplvm/bayesian_qeplvm.py +40 -0
- qpytorch-0.1/qpytorch/models/qeplvm/latent_variable.py +102 -0
- qpytorch-0.1/qpytorch/module.py +30 -0
- qpytorch-0.1/qpytorch/optim/__init__.py +5 -0
- qpytorch-0.1/qpytorch/priors/__init__.py +42 -0
- qpytorch-0.1/qpytorch/priors/qep_priors.py +81 -0
- qpytorch-0.1/qpytorch/test/__init__.py +22 -0
- qpytorch-0.1/qpytorch/test/base_likelihood_test_case.py +106 -0
- qpytorch-0.1/qpytorch/test/model_test_case.py +150 -0
- qpytorch-0.1/qpytorch/test/variational_test_case.py +400 -0
- qpytorch-0.1/qpytorch/utils/__init__.py +38 -0
- qpytorch-0.1/qpytorch/utils/warnings.py +37 -0
- qpytorch-0.1/qpytorch/variational/__init__.py +47 -0
- qpytorch-0.1/qpytorch/variational/_variational_distribution.py +61 -0
- qpytorch-0.1/qpytorch/variational/_variational_strategy.py +391 -0
- qpytorch-0.1/qpytorch/variational/additive_grid_interpolation_variational_strategy.py +90 -0
- qpytorch-0.1/qpytorch/variational/batch_decoupled_variational_strategy.py +256 -0
- qpytorch-0.1/qpytorch/variational/cholesky_variational_distribution.py +65 -0
- qpytorch-0.1/qpytorch/variational/ciq_variational_strategy.py +352 -0
- qpytorch-0.1/qpytorch/variational/delta_variational_distribution.py +41 -0
- qpytorch-0.1/qpytorch/variational/grid_interpolation_variational_strategy.py +113 -0
- qpytorch-0.1/qpytorch/variational/independent_multitask_variational_strategy.py +114 -0
- qpytorch-0.1/qpytorch/variational/lmc_variational_strategy.py +248 -0
- qpytorch-0.1/qpytorch/variational/mean_field_variational_distribution.py +58 -0
- qpytorch-0.1/qpytorch/variational/multitask_variational_strategy.py +317 -0
- qpytorch-0.1/qpytorch/variational/natural_variational_distribution.py +152 -0
- qpytorch-0.1/qpytorch/variational/nearest_neighbor_variational_strategy.py +487 -0
- qpytorch-0.1/qpytorch/variational/orthogonally_decoupled_variational_strategy.py +128 -0
- qpytorch-0.1/qpytorch/variational/tril_natural_variational_distribution.py +130 -0
- qpytorch-0.1/qpytorch/variational/uncorrelated_multitask_variational_strategy.py +114 -0
- qpytorch-0.1/qpytorch/variational/unwhitened_variational_strategy.py +225 -0
- qpytorch-0.1/qpytorch/variational/variational_strategy.py +280 -0
- qpytorch-0.1/qpytorch/version.py +4 -0
- qpytorch-0.1/qpytorch.egg-info/PKG-INFO +142 -0
- qpytorch-0.1/qpytorch.egg-info/SOURCES.txt +286 -0
- qpytorch-0.1/qpytorch.egg-info/dependency_links.txt +1 -0
- qpytorch-0.1/qpytorch.egg-info/requires.txt +47 -0
- qpytorch-0.1/qpytorch.egg-info/top_level.txt +1 -0
- qpytorch-0.1/setup.cfg +19 -0
- qpytorch-0.1/setup.py +101 -0
- qpytorch-0.1/test/__init__.py +1 -0
- qpytorch-0.1/test/distributions/__init__.py +1 -0
- qpytorch-0.1/test/distributions/test_multitask_multivariate_qexponential.py +507 -0
- qpytorch-0.1/test/distributions/test_multivariate_qexponential.py +404 -0
- qpytorch-0.1/test/distributions/test_qexponential.py +54 -0
- qpytorch-0.1/test/examples/__init__.py +1 -0
- qpytorch-0.1/test/examples/old_variational_strategy_model.pth +0 -0
- qpytorch-0.1/test/examples/test_batch_decoupled_ppqepr_regression.py +94 -0
- qpytorch-0.1/test/examples/test_batch_multitask_qep_regression.py +193 -0
- qpytorch-0.1/test/examples/test_batch_qep_regression.py +239 -0
- qpytorch-0.1/test/examples/test_batch_svqep_qep_regression.py +178 -0
- qpytorch-0.1/test/examples/test_decoupled_svqep_regression.py +105 -0
- qpytorch-0.1/test/examples/test_derivative_qep_fantasy.py +67 -0
- qpytorch-0.1/test/examples/test_fixed_noise_fanatasy_updates.py +178 -0
- qpytorch-0.1/test/examples/test_grid_qep_regression.py +126 -0
- qpytorch-0.1/test/examples/test_hadamard_multitask_qep_regression.py +107 -0
- qpytorch-0.1/test/examples/test_keops_qep_regression.py +82 -0
- qpytorch-0.1/test/examples/test_kissqep_additive_classification.py +106 -0
- qpytorch-0.1/test/examples/test_kissqep_additive_regression.py +100 -0
- qpytorch-0.1/test/examples/test_kissqep_dkl_regression.py +153 -0
- qpytorch-0.1/test/examples/test_kissqep_kronecker_product_classification.py +101 -0
- qpytorch-0.1/test/examples/test_kissqep_kronecker_product_regression.py +106 -0
- qpytorch-0.1/test/examples/test_kissqep_multiplicative_regression.py +104 -0
- qpytorch-0.1/test/examples/test_kissqep_qep_classification.py +92 -0
- qpytorch-0.1/test/examples/test_kissqep_qep_regression.py +174 -0
- qpytorch-0.1/test/examples/test_kissqep_variational_regression.py +117 -0
- qpytorch-0.1/test/examples/test_kissqep_white_noise_regression.py +180 -0
- qpytorch-0.1/test/examples/test_kronecker_multitask_qep_regression.py +96 -0
- qpytorch-0.1/test/examples/test_kronecker_multitask_ski_qep_regression.py +107 -0
- qpytorch-0.1/test/examples/test_kronecker_multitask_sqepr_regression.py +89 -0
- qpytorch-0.1/test/examples/test_lcm_kernel_regression.py +108 -0
- qpytorch-0.1/test/examples/test_lmc_svqep_regression.py +200 -0
- qpytorch-0.1/test/examples/test_missing_data.py +247 -0
- qpytorch-0.1/test/examples/test_model_list_qep_regression.py +88 -0
- qpytorch-0.1/test/examples/test_rff_qep_regression.py +100 -0
- qpytorch-0.1/test/examples/test_simple_qep_classification.py +85 -0
- qpytorch-0.1/test/examples/test_simple_qep_regression.py +493 -0
- qpytorch-0.1/test/examples/test_spectral_mixture_qep_regression.py +109 -0
- qpytorch-0.1/test/examples/test_sqepr_regression.py +149 -0
- qpytorch-0.1/test/examples/test_svqep_qep_classification.py +97 -0
- qpytorch-0.1/test/examples/test_svqep_qep_regression.py +154 -0
- qpytorch-0.1/test/examples/test_uncorrelated_multitask_qep_regression.py +103 -0
- qpytorch-0.1/test/examples/test_unwhitened_svqep_regression.py +99 -0
- qpytorch-0.1/test/examples/test_white_noise_regression.py +169 -0
- qpytorch-0.1/test/kernels/__init__.py +1 -0
- qpytorch-0.1/test/kernels/test_matern52_kernel_grad.py +78 -0
- qpytorch-0.1/test/kernels/test_polynomial_kernel_grad.py +15 -0
- qpytorch-0.1/test/kernels/test_rbf_kernel_grad.py +78 -0
- qpytorch-0.1/test/kernels/test_rbf_kernel_gradgrad.py +194 -0
- qpytorch-0.1/test/likelihoods/__init__.py +1 -0
- qpytorch-0.1/test/likelihoods/test_general_multitask_qexponential_likelihood.py +99 -0
- qpytorch-0.1/test/likelihoods/test_multitask_qexponential_likelihood.py +96 -0
- qpytorch-0.1/test/likelihoods/test_qexponential_likelihood.py +245 -0
- qpytorch-0.1/test/mlls/__init__.py +1 -0
- qpytorch-0.1/test/mlls/test_exact_marginal_log_likelihood.py +135 -0
- qpytorch-0.1/test/mlls/test_inducing_point_kernel_added_loss_term.py +70 -0
- qpytorch-0.1/test/mlls/test_leave_one_out_pseudo_likelihood.py +110 -0
- qpytorch-0.1/test/models/__init__.py +1 -0
- qpytorch-0.1/test/models/test_exact_qep.py +269 -0
- qpytorch-0.1/test/models/test_model_list.py +69 -0
- qpytorch-0.1/test/models/test_variational_qep.py +74 -0
- qpytorch-0.1/test/priors/__init__.py +1 -0
- qpytorch-0.1/test/priors/test_multivariate_qexponential_prior.py +110 -0
- qpytorch-0.1/test/priors/test_qexponential_prior.py +98 -0
- qpytorch-0.1/test/variational/__init__.py +0 -0
- qpytorch-0.1/test/variational/test_batch_decoupled_variational_strategy.py +209 -0
- qpytorch-0.1/test/variational/test_ciq_variational_strategy.py +66 -0
- qpytorch-0.1/test/variational/test_grid_interpolation_variational_strategy.py +119 -0
- qpytorch-0.1/test/variational/test_independent_multitask_variational_strategy.py +229 -0
- qpytorch-0.1/test/variational/test_indunc_multitask_variational_strategy.py +239 -0
- qpytorch-0.1/test/variational/test_lmc_variational_strategy.py +289 -0
- qpytorch-0.1/test/variational/test_natural_variational_distribution.py +243 -0
- qpytorch-0.1/test/variational/test_nearest_neighbor_variational_strategy.py +245 -0
- qpytorch-0.1/test/variational/test_orthogonally_decoupled_variational_strategy.py +81 -0
- qpytorch-0.1/test/variational/test_uncorrelated_multitask_variational_strategy.py +229 -0
- qpytorch-0.1/test/variational/test_unwhitened_variational_strategy.py +103 -0
- qpytorch-0.1/test/variational/test_variational_strategy.py +118 -0
- qpytorch-0.1/venv_install.yaml +12 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{% set _version_match = load_file_regex(
|
|
2
|
+
load_file="qpytorch/version.py",
|
|
3
|
+
regex_pattern="__version__ = version = '(.+)'"
|
|
4
|
+
) %}
|
|
5
|
+
{% set version = _version_match[1] %}
|
|
6
|
+
|
|
7
|
+
package:
|
|
8
|
+
name: qpytorch
|
|
9
|
+
version: {{ version }}
|
|
10
|
+
|
|
11
|
+
source:
|
|
12
|
+
path: ../
|
|
13
|
+
|
|
14
|
+
build:
|
|
15
|
+
noarch: python
|
|
16
|
+
script: "$PYTHON ./setup.py install --single-version-externally-managed --record=record.txt"
|
|
17
|
+
|
|
18
|
+
requirements:
|
|
19
|
+
host:
|
|
20
|
+
- python>=3.10
|
|
21
|
+
|
|
22
|
+
run:
|
|
23
|
+
- python>=3.10
|
|
24
|
+
- jaxtyping
|
|
25
|
+
- linear_operator>=0.6
|
|
26
|
+
- mpmath>=0.19,<=1.3
|
|
27
|
+
- pytorch>=2.2
|
|
28
|
+
- scikit-learn
|
|
29
|
+
- gpytorch>=1.13
|
|
30
|
+
|
|
31
|
+
test:
|
|
32
|
+
imports:
|
|
33
|
+
- qpytorch
|
|
34
|
+
- qpytorch.distributions
|
|
35
|
+
- qpytorch.functions
|
|
36
|
+
- qpytorch.kernels
|
|
37
|
+
- qpytorch.lazy
|
|
38
|
+
- qpytorch.likelihoods
|
|
39
|
+
- qpytorch.means
|
|
40
|
+
- qpytorch.mlls
|
|
41
|
+
- qpytorch.models
|
|
42
|
+
- qpytorch.priors
|
|
43
|
+
- qpytorch.utils
|
|
44
|
+
- qpytorch.variational
|
|
45
|
+
|
|
46
|
+
about:
|
|
47
|
+
home: https://lanzithinking.github.io/QePyTorch/
|
|
48
|
+
license: MIT
|
|
49
|
+
license_file: LICENSE
|
|
50
|
+
summary: An implementation of Q-Exponential Processes in Pytorch built from GPyTorch
|
|
51
|
+
doc_url: https://qepytorch.readthedocs.io/en/latest/
|
|
52
|
+
dev_url: https://github.com/lanzithinking/qepytorch
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# This workflow will upload a Python Package using Twine when a release is created
|
|
2
|
+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
|
|
3
|
+
|
|
4
|
+
name: Upload Python Package to PyPI and Anaconda
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
release:
|
|
8
|
+
types: [created]
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
run_test_suite:
|
|
12
|
+
uses: ./.github/workflows/run_test_suite.yml
|
|
13
|
+
|
|
14
|
+
deploy_pypi:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
needs: run_test_suite
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v2
|
|
19
|
+
- name: Set up Python
|
|
20
|
+
uses: actions/setup-python@v2
|
|
21
|
+
with:
|
|
22
|
+
python-version: "3.10"
|
|
23
|
+
- name: Install dependencies
|
|
24
|
+
run: |
|
|
25
|
+
python -m pip install --upgrade pip
|
|
26
|
+
pip install setuptools_scm setuptools wheel twine
|
|
27
|
+
- name: Build and publish
|
|
28
|
+
env:
|
|
29
|
+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
|
|
30
|
+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
|
|
31
|
+
run: |
|
|
32
|
+
python -m setuptools_scm
|
|
33
|
+
python setup.py sdist bdist_wheel
|
|
34
|
+
twine upload dist/*
|
|
35
|
+
|
|
36
|
+
deploy_conda:
|
|
37
|
+
runs-on: ubuntu-latest
|
|
38
|
+
needs: run_test_suite
|
|
39
|
+
steps:
|
|
40
|
+
- uses: actions/checkout@v2
|
|
41
|
+
- uses: conda-incubator/setup-miniconda@v2
|
|
42
|
+
with:
|
|
43
|
+
auto-update-conda: false
|
|
44
|
+
python-version: "3.10"
|
|
45
|
+
- name: Install dependencies
|
|
46
|
+
run: |
|
|
47
|
+
conda install -y anaconda-client conda-build
|
|
48
|
+
conda install linear_operator gpytorch -c gpytorch
|
|
49
|
+
pip install setuptools_scm
|
|
50
|
+
- name: Build and publish
|
|
51
|
+
run: |
|
|
52
|
+
conda config --set anaconda_upload yes
|
|
53
|
+
conda config --append channels pytorch
|
|
54
|
+
conda config --append channels gpytorch
|
|
55
|
+
conda config --append channels conda-forge
|
|
56
|
+
/usr/share/miniconda/bin/anaconda login --username ${{ secrets.CONDA_USERNAME }} --password ${{ secrets.CONDA_PASSWORD }}
|
|
57
|
+
python -m setuptools_scm
|
|
58
|
+
conda build .conda
|
|
59
|
+
/usr/share/miniconda/bin/anaconda logout
|
|
@@ -0,0 +1,85 @@
|
|
|
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: Run Test Suite
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
push:
|
|
8
|
+
branches: [ main, develop ]
|
|
9
|
+
pull_request:
|
|
10
|
+
branches: [ main, develop ]
|
|
11
|
+
workflow_call:
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
# run_linter:
|
|
15
|
+
# runs-on: ubuntu-latest
|
|
16
|
+
# steps:
|
|
17
|
+
# - uses: actions/checkout@v2
|
|
18
|
+
# - name: Set up Python
|
|
19
|
+
# uses: actions/setup-python@v2
|
|
20
|
+
# with:
|
|
21
|
+
# python-version: "3.10"
|
|
22
|
+
# - name: Install dependencies
|
|
23
|
+
# run: |
|
|
24
|
+
# pip install flake8==4.0.1 flake8-print==4.0.0 pre-commit
|
|
25
|
+
# pre-commit install
|
|
26
|
+
# - name: Run linting
|
|
27
|
+
# run: |
|
|
28
|
+
# flake8
|
|
29
|
+
# - name: Run pre-commit checks
|
|
30
|
+
# # skipping flake8 here (run separatey above b/c pre-commit does not include flake8-print)
|
|
31
|
+
# run: |
|
|
32
|
+
# SKIP=flake8 pre-commit run --files test/**/*.py qpytorch/**/*.py
|
|
33
|
+
# - name: Upload coverage reports to Codecov
|
|
34
|
+
# uses: codecov/codecov-action@v3
|
|
35
|
+
|
|
36
|
+
run_unit_tests:
|
|
37
|
+
runs-on: ubuntu-latest
|
|
38
|
+
strategy:
|
|
39
|
+
matrix:
|
|
40
|
+
pytorch-version: ["main", "stable"]
|
|
41
|
+
extras: ["with-extras", "no-extras"]
|
|
42
|
+
steps:
|
|
43
|
+
- uses: actions/checkout@v2
|
|
44
|
+
- name: Set up Python
|
|
45
|
+
uses: actions/setup-python@v2
|
|
46
|
+
with:
|
|
47
|
+
python-version: "3.10"
|
|
48
|
+
- name: Install dependencies
|
|
49
|
+
run: |
|
|
50
|
+
if [[ ${{ matrix.pytorch-version }} = "main" ]]; then
|
|
51
|
+
pip install --pre torch -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html;
|
|
52
|
+
else
|
|
53
|
+
pip install "numpy<2" # Numpy 2.0 is not fully supported until PyTorch 2.2
|
|
54
|
+
pip install torch==2.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
|
|
55
|
+
fi
|
|
56
|
+
pip install -e .
|
|
57
|
+
if [[ ${{ matrix.extras }} == "with-extras" ]]; then
|
|
58
|
+
pip install "pyro-ppl>=1.8";
|
|
59
|
+
pip install pykeops;
|
|
60
|
+
pip install faiss-cpu; # Unofficial pip release: https://pypi.org/project/faiss-cpu/#history
|
|
61
|
+
fi
|
|
62
|
+
- name: Run unit tests
|
|
63
|
+
run: |
|
|
64
|
+
python -m unittest discover
|
|
65
|
+
|
|
66
|
+
run_examples:
|
|
67
|
+
runs-on: ubuntu-latest
|
|
68
|
+
steps:
|
|
69
|
+
- uses: actions/checkout@v2
|
|
70
|
+
- name: Set up Python
|
|
71
|
+
uses: actions/setup-python@v2
|
|
72
|
+
with:
|
|
73
|
+
python-version: "3.10"
|
|
74
|
+
- name: Install dependencies
|
|
75
|
+
run: |
|
|
76
|
+
pip install "numpy<2" # Numpy 2.0 is not fully supported until PyTorch 2.2
|
|
77
|
+
pip install torch==2.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
|
|
78
|
+
pip install pytest nbval jupyter tqdm matplotlib torchvision scipy
|
|
79
|
+
pip install -e .
|
|
80
|
+
pip install "pyro-ppl>=1.8";
|
|
81
|
+
pip install pykeops;
|
|
82
|
+
pip install faiss-cpu; # Unofficial pip release: https://pypi.org/project/faiss-cpu/#history
|
|
83
|
+
- name: Run example notebooks
|
|
84
|
+
run: |
|
|
85
|
+
grep -l smoke_test examples/**/*.ipynb | xargs grep -L 'smoke_test = False' | CI=true xargs pytest --nbval-lax --current-env
|
qpytorch-0.1/.gitignore
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py,cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
#Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# UV
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
#uv.lock
|
|
102
|
+
|
|
103
|
+
# poetry
|
|
104
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
105
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
106
|
+
# commonly ignored for libraries.
|
|
107
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
108
|
+
#poetry.lock
|
|
109
|
+
|
|
110
|
+
# pdm
|
|
111
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
112
|
+
#pdm.lock
|
|
113
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
114
|
+
# in version control.
|
|
115
|
+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
|
|
116
|
+
.pdm.toml
|
|
117
|
+
.pdm-python
|
|
118
|
+
.pdm-build/
|
|
119
|
+
|
|
120
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
121
|
+
__pypackages__/
|
|
122
|
+
|
|
123
|
+
# Celery stuff
|
|
124
|
+
celerybeat-schedule
|
|
125
|
+
celerybeat.pid
|
|
126
|
+
|
|
127
|
+
# SageMath parsed files
|
|
128
|
+
*.sage.py
|
|
129
|
+
|
|
130
|
+
# Environments
|
|
131
|
+
.env
|
|
132
|
+
.venv
|
|
133
|
+
env/
|
|
134
|
+
venv/
|
|
135
|
+
ENV/
|
|
136
|
+
env.bak/
|
|
137
|
+
venv.bak/
|
|
138
|
+
|
|
139
|
+
# Spyder project settings
|
|
140
|
+
.spyderproject
|
|
141
|
+
.spyproject
|
|
142
|
+
|
|
143
|
+
# Rope project settings
|
|
144
|
+
.ropeproject
|
|
145
|
+
|
|
146
|
+
# mkdocs documentation
|
|
147
|
+
/site
|
|
148
|
+
|
|
149
|
+
# mypy
|
|
150
|
+
.mypy_cache/
|
|
151
|
+
.dmypy.json
|
|
152
|
+
dmypy.json
|
|
153
|
+
|
|
154
|
+
# Pyre type checker
|
|
155
|
+
.pyre/
|
|
156
|
+
|
|
157
|
+
# pytype static type analyzer
|
|
158
|
+
.pytype/
|
|
159
|
+
|
|
160
|
+
# Cython debug symbols
|
|
161
|
+
cython_debug/
|
|
162
|
+
|
|
163
|
+
# PyCharm
|
|
164
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
165
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
166
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
167
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
168
|
+
#.idea/
|
|
169
|
+
|
|
170
|
+
# Abstra
|
|
171
|
+
# Abstra is an AI-powered process automation framework.
|
|
172
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
173
|
+
# Learn more at https://abstra.io/docs
|
|
174
|
+
.abstra/
|
|
175
|
+
|
|
176
|
+
# Visual Studio Code
|
|
177
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
|
178
|
+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
179
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
|
180
|
+
# you could uncomment the following to ignore the enitre vscode folder
|
|
181
|
+
# .vscode/
|
|
182
|
+
|
|
183
|
+
# Ruff stuff:
|
|
184
|
+
.ruff_cache/
|
|
185
|
+
|
|
186
|
+
# PyPI configuration file
|
|
187
|
+
.pypirc
|
|
188
|
+
|
|
189
|
+
# Cursor
|
|
190
|
+
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
|
|
191
|
+
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
|
|
192
|
+
# refer to https://docs.cursor.com/context/ignore-files
|
|
193
|
+
.cursorignore
|
|
194
|
+
.cursorindexingignore
|
|
195
|
+
|
|
196
|
+
.DS_Store
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# .readthedocs.yml
|
|
2
|
+
# Read the Docs configuration file
|
|
3
|
+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
|
|
4
|
+
|
|
5
|
+
# Required
|
|
6
|
+
version: 2
|
|
7
|
+
|
|
8
|
+
build:
|
|
9
|
+
os: "ubuntu-22.04"
|
|
10
|
+
tools:
|
|
11
|
+
python: "3.10"
|
|
12
|
+
jobs:
|
|
13
|
+
pre_install: # Lock version of torch at 2.0
|
|
14
|
+
- pip install "numpy<2" # Numpy 2.0 is not fully supported until PyTorch 2.2
|
|
15
|
+
- pip install torch==2.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
|
|
16
|
+
pre_build:
|
|
17
|
+
- python -m setuptools_scm # Get correct version number
|
|
18
|
+
|
|
19
|
+
# Build documentation in the docs/ directory with Sphinx
|
|
20
|
+
sphinx:
|
|
21
|
+
configuration: docs/source/conf.py
|
|
22
|
+
# fail_on_warning: true
|
|
23
|
+
|
|
24
|
+
# Optionally build your docs in additional formats such as PDF
|
|
25
|
+
#formats:
|
|
26
|
+
#- pdf
|
|
27
|
+
|
|
28
|
+
# Optionally set the version of Python and requirements required to build your docs
|
|
29
|
+
python:
|
|
30
|
+
install:
|
|
31
|
+
- method: pip
|
|
32
|
+
path: .
|
|
33
|
+
extra_requirements:
|
|
34
|
+
- docs
|
|
35
|
+
- pyro
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# Contributing to Q<sup style="font-size: 0.5em;">ⓔ</sup>PyTorch
|
|
2
|
+
|
|
3
|
+
Thanks for contributing!
|
|
4
|
+
|
|
5
|
+
## Development installation
|
|
6
|
+
|
|
7
|
+
To get the development installation with all the necessary dependencies for
|
|
8
|
+
linting, testing, and building the documentation, run the following:
|
|
9
|
+
```bash
|
|
10
|
+
git clone https://github.com/lanzithinking/qepytorch.git
|
|
11
|
+
cd qpytorch
|
|
12
|
+
pip install -e .[dev,docs,examples,keops,pyro,test] # keops and pyro are optional
|
|
13
|
+
pre-commit install
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## Our Development Process
|
|
18
|
+
|
|
19
|
+
### Formatting and Linting
|
|
20
|
+
|
|
21
|
+
Q<sup style="font-size: 0.5em;">ⓔ</sup>PyTorch uses [pre-commit](https://pre-commit.com) for code formatting
|
|
22
|
+
and [flake8](https://flake8.pycqa.org/en/latest/) for linting.
|
|
23
|
+
This enforces a common code style across the repository.
|
|
24
|
+
The [development installation instructions](#development-installation) should install both tools, and no additional configuration should be necessary.
|
|
25
|
+
|
|
26
|
+
`flake8` and `pre-commit` are both run every time you make a local commit.
|
|
27
|
+
To run both commands independent of making a commit:
|
|
28
|
+
```bash
|
|
29
|
+
SKIP=flake8 pre-commit run --files test/**/*.py qpytorch/**/*.py
|
|
30
|
+
flake8
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Docstrings
|
|
34
|
+
We use [standard sphinx docstrings](https://sphinx-rtd-tutorial.readthedocs.io/en/latest/docstrings.html) (not Google-style).
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
### Type Hints
|
|
38
|
+
|
|
39
|
+
Q<sup style="font-size: 0.5em;">ⓔ</sup>PyTorch aims to be fully typed using Python 3.8+
|
|
40
|
+
[type hints](https://www.python.org/dev/peps/pep-0484/).
|
|
41
|
+
|
|
42
|
+
We recognize that we have a long way to go towards fully typing the library,
|
|
43
|
+
but we expect all contributions to also use proper type annotations.
|
|
44
|
+
While we currently do not enforce full consistency of these in our continuous integration
|
|
45
|
+
test, you should strive to type check your code locally.
|
|
46
|
+
For this we recommend using [pyre](https://pyre-check.org/).
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
### Unit Tests
|
|
50
|
+
|
|
51
|
+
We use python's `unittest` to run unit tests:
|
|
52
|
+
```bash
|
|
53
|
+
python -m unittest
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
- To run tests within a specific directory, run (e.g.) `python -m unittest discover -s test/kernels`.
|
|
57
|
+
- To run a specific unit test, run (e.g.) `python -m unittest test.operators.test_rbf_kernel.TestRBFKernel.test_active_dims_range`.
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
### Documentation
|
|
61
|
+
|
|
62
|
+
Q<sup style="font-size: 0.5em;">ⓔ</sup>PyTorch uses sphinx to generate documentation, and ReadTheDocs to host documentation.
|
|
63
|
+
To build the documentation locally, ensure that sphinx and its plugins are properly installed (see the [development installation section](#development-installation) for instructions).
|
|
64
|
+
Then run:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
cd docs
|
|
68
|
+
SKIP_EXAMPLES=true make html
|
|
69
|
+
cd build/html
|
|
70
|
+
python -m http.server 8000
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
If you are making an update to one of the example notebooks, drop the `SKIP_EXAMPLES=true` environment variable:
|
|
74
|
+
(This takes longer to build.)
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
cd docs
|
|
78
|
+
make html
|
|
79
|
+
cd build/html
|
|
80
|
+
python -m http.server 8000
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
The documentation will be available at http://localhost:8000.
|
|
84
|
+
You will have to rerun the `make html` or `SKIP_EXAMPLES=true make html` command every time you wish to update the docs.
|
|
85
|
+
|
|
86
|
+
**Important**: Our CI requires that the documentation compiles *WITHOUT WARNINGS*.
|
|
87
|
+
Please ensure that you can build the documentation locally without producing any warnings.
|
|
88
|
+
|
|
89
|
+
## Pull Requests
|
|
90
|
+
We greatly appreciate PRs! To minimize back-and-forward communication, please ensure that your PR includes the following:
|
|
91
|
+
|
|
92
|
+
1. **Code changes.** (the bug fix/new feature/updated documentation/etc.)
|
|
93
|
+
1. **Unit tests.** If you are updating any code, you should add an appropraite unit test.
|
|
94
|
+
- If you are fixing a bug, make sure that there's a new unit test that catches the bug.
|
|
95
|
+
(I.e., there should be a new unit test that fails before your bug fix, but passes after your bug fix.
|
|
96
|
+
This ensures that we don't have any accidental regressions in the code base.)
|
|
97
|
+
- If you are adding a new feature, you should add unit tests for this new feature.
|
|
98
|
+
1. **Documentation.** Any new objects/methods should have [appropriate docstrings](#docstrings).
|
|
99
|
+
- If you are adding a new object, **please ensure that it appears in the documentation.**
|
|
100
|
+
You may have to add the object to the appropriate file in [docs/source](https://github.com/lanzithinking/qepytorch/tree/main/docs/source).
|
|
101
|
+
1. **Example notebooks.** Any major new functionality, tutorials, or examples should have an example jupyter notebook.
|
|
102
|
+
- If you are adding a new notebook, **please ensure that it appears in the documentation.**
|
|
103
|
+
You may have to add the object to the appropriate file in [docs/source](https://github.com/lanzithinking/qepytorch/tree/main/examples/).
|
|
104
|
+
|
|
105
|
+
Before submitting a PR, ensure the following:
|
|
106
|
+
1. **Code is proprerly formatted and linted.** Linting and formatting checking should happen automatically if you have followed the development installation instructions.
|
|
107
|
+
See [the formatting and linting](#formatting-and-linting) section for more info.
|
|
108
|
+
1. **Unit tests pass.** See [the unit tests section](#unit-tests) for more info.
|
|
109
|
+
1. **Documentation renders correctly without warnings.** [Build the documentation locally](#documentation) to ensure that your new class/docstrings are rendered correctly. Ensure that sphinx can build the documentation without warnings.
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
## Issues
|
|
113
|
+
|
|
114
|
+
We use GitHub issues to track public bugs. Please ensure your description is
|
|
115
|
+
clear and has sufficient instructions to be able to reproduce the issue.
|
|
116
|
+
|
|
117
|
+
We accept the following types of issues:
|
|
118
|
+
- Bug reports
|
|
119
|
+
- Requests for documentation/examples
|
|
120
|
+
- Feature requests
|
|
121
|
+
- Opportuntities to refactor code
|
|
122
|
+
- Performance issues (speed, memory, etc.)
|
|
123
|
+
|
|
124
|
+
Please refrain from using the issue tracker for questions or debugging personal code.
|
|
125
|
+
Instead please use the [Q<sup style="font-size: 0.5em;">ⓔ</sup>PyTorch discussions forum](https://github.com/lanzithinking/qepytorch/discussions).
|
|
126
|
+
|
|
127
|
+
## License
|
|
128
|
+
|
|
129
|
+
By contributing to Q<sup style="font-size: 0.5em;">ⓔ</sup>PyTorch, you agree that your contributions will be licensed
|
|
130
|
+
under the LICENSE file in the root directory of this source tree.
|
qpytorch-0.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Shiwei Lan
|
|
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.
|