Conversation
poetry -> uv bicop.BiCop vinecop.VineCop examples/*cop.ipynb ================== TODO: bicop: fastkde.pdf vinecop: rosenblatt examples: app jupyterNB Co-Authored-By: Thibault Vatter <thibault.vatter@gmail.com>
uv for cuda user: uv sync --extra cu126 -U
* `pdf_at_points()` is potentially slow relative to `pdf()` cuz it does not take advantage of the inverse FFT for transforming from Fourier space to data space; * num_step_grid has to be a power of 2; * padding/trimming incurred;
util.kdeCDFPPF1D: a small class, fit at init time; stored inside VineCop.marginals
apply marginal cdf if user is giving obs (conditional simulation)
if top lv then marginal cdf, else nothing happen (quantile regression for experienced users)
experiments: randomsearch, more data/alpha/repeats/pipelineparaspace
examples/vinecop monotonic tests; examples/bicop range tests; examples/num_hfunc fig; minor tidying.
drop QR scripts
commit a9f6811f44fbbcebd908e5595241e4f0258c4365 Merge: 4688a0d 5ac1502 Author: Tuoyuan Cheng <tuoyuan.cheng@gatech.edu> Date: Tue May 20 13:31:31 2025 +0800 Merge branch 'pr/34' into dev_ian commit 4688a0d Author: Tuoyuan Cheng <tuoyuan.cheng@gatech.edu> Date: Mon Apr 28 10:05:55 2025 +0800 WIP poetry -> uv many parametric bicops: parameter as torch.Tensor commit 5ac1502 Author: gagrawal009 <g.agrawal009@gmail.com> Date: Sat Jan 11 14:32:29 2025 +0530 par changed to torch.tensor commit c7bfedc Author: gagrawal009 <g.agrawal009@gmail.com> Date: Sat Jan 11 14:03:00 2025 +0530 par changed to torch.tensor commit 1dddbfb Author: Tuoyuan Cheng <tycheng@nus.edu.sg> Date: Tue Jan 7 14:02:19 2025 +0800 Dev ian (#33) * par changed to torch.tensor --------- Co-authored-by: gagrawal009 <g.agrawal009@gmail.com> commit ef95b6f Author: gagrawal009 <g.agrawal009@gmail.com> Date: Sat Jan 4 21:58:52 2025 +0530 par changed to torch.tensor commit 311d196 Author: gagrawal009 <g.agrawal009@gmail.com> Date: Fri Jan 3 23:56:10 2025 +0530 par changed to torch.tensor commit 976e040 Author: gagrawal009 <g.agrawal009@gmail.com> Date: Fri Jan 3 23:47:11 2025 +0530 par changed to torch.tensor commit 7ee503a Author: gagrawal009 <g.agrawal009@gmail.com> Date: Fri Jan 3 16:46:26 2025 +0530 par changed to torch.tensor commit f5a8d0e Author: Tuoyuan Cheng <tycheng@nus.edu.sg> Date: Wed Jan 1 13:55:33 2025 +0800 main branch only: publish-package and static commit 814be0b Author: Tuoyuan Cheng <tycheng@nus.edu.sg> Date: Wed Jan 1 13:04:04 2025 +0800 rm in-place ops commit 81301d2 Author: Tuoyuan Cheng <tycheng@nus.edu.sg> Date: Sun Dec 22 18:25:50 2024 +0800 ruff commit 4d059ff Merge: bf0d8a1 a7b356f Author: Tuoyuan Cheng <tycheng@nus.edu.sg> Date: Sun Dec 22 18:23:11 2024 +0800 Merge branch 'main' into dev_ian commit bf0d8a1 Author: ian <tycheng@nus.edu.sg> Date: Thu Dec 5 13:53:25 2024 +0800 _EPS: abc, bb1678 commit c4fad3d Author: ian <tycheng@nus.edu.sg> Date: Mon Dec 2 23:57:37 2024 +0800 tawn1,2; bb1678 par2tau commit bb89a0b Author: ian <tycheng@nus.edu.sg> Date: Tue Nov 26 21:18:32 2024 +0800 BiCopExtremeValue (bb5); BiCopArchimedean (bb1,6,7,8); solve_ITP_vectorize for hinv1_0 commit 5b8ab4c Author: ian <tycheng@nus.edu.sg> Date: Thu Nov 7 22:28:08 2024 +0800 archimedean: par2tau_0, numint by Simpson's rule commit a98436e Author: ian <tycheng@nus.edu.sg> Date: Tue Nov 5 17:37:50 2024 +0800 bb1: hinv newton, tau2par quasi mle TODO: test refactoring, abc hinv1_num invert_f commit 5f8149e Author: ian <tycheng@nus.edu.sg> Date: Mon Nov 4 23:21:49 2024 +0800 solve_ITP; bb1: cdf, pdf, l_pdf, hfun1 TODO: hinv1, tau2par, par2tau commit 0b64f8e Merge: 8346878 7fa729b Author: ian <tycheng@nus.edu.sg> Date: Mon Nov 4 17:30:53 2024 +0800 Merge remote-tracking branch 'forked_repo/feature/bb1' into dev_ian commit 7fa729b Author: Sai Kiran Reddy Poreddy <saikiranreddy.saikiran@gmail.com> Date: Mon Nov 4 17:23:04 2024 +0800 Bb1 Test resolution commit 8346878 Merge: 7aa9508 c3a4776 Author: ian <tycheng@nus.edu.sg> Date: Mon Nov 4 16:39:20 2024 +0800 Merge branch 'main' into dev_ian commit 7aa9508 Merge: 67457bb aff8a9d Author: ian <tycheng@nus.edu.sg> Date: Wed Oct 23 09:57:13 2024 +0800 Merge remote-tracking branch 'origin/benchmark_tvc_pvc' into dev_ian commit aff8a9d Author: Thibault Vatter <thibault.vatter@gmail.com> Date: Tue Oct 22 16:50:24 2024 +0200 Proper simulation study commit 8a788fa Author: Thibault Vatter <thibault.vatter@gmail.com> Date: Tue Oct 22 15:21:08 2024 +0200 benchmarking notebook commit 67457bb Merge: aaf91f2 41bacc9 Author: ian <tycheng@nus.edu.sg> Date: Thu Oct 17 00:20:12 2024 +0800 Merge branch 'main' into dev_ian commit a2972d6 Author: Sai Kiran Reddy Poreddy <saikiranreddy.saikiran@gmail.com> Date: Wed Oct 16 23:25:31 2024 +0800 Support bb1 bicop commit aaf91f2 Author: ian <tycheng@nus.edu.sg> Date: Wed Oct 16 21:05:33 2024 +0800 gh-pages branch for docs (Sai); Dvine one set empty commit 9385803 Merge: d5121e0 1532674 Author: ian <tycheng@nus.edu.sg> Date: Wed Oct 16 19:35:32 2024 +0800 Merge remote-tracking branch 'forked_repo/main' into dev_ian commit 1532674 Author: Sai Kiran Reddy Poreddy <saikiranreddy.saikiran@gmail.com> Date: Wed Oct 16 15:09:10 2024 +0800 Remove html files commit 18aad45 Author: Sai Kiran Reddy Poreddy <saikiranreddy.saikiran@gmail.com> Date: Wed Oct 16 15:07:27 2024 +0800 Ignore html files commit 6902e6f Author: Sai Kiran Reddy Poreddy <saikiranreddy.saikiran@gmail.com> Date: Wed Oct 16 15:06:57 2024 +0800 Add clean option commit 034c4ab Author: Sai Kiran Reddy Poreddy <saikiranreddy.saikiran@gmail.com> Date: Wed Oct 16 15:06:28 2024 +0800 Use sphinx_pyproject for config commit dd9b534 Author: Sai Kiran Reddy Poreddy <saikiranreddy.saikiran@gmail.com> Date: Wed Oct 16 15:05:05 2024 +0800 commit to gh-pages commit d5121e0 Merge: c451e67 ad544de Author: ian <tycheng@nus.edu.sg> Date: Tue Oct 8 11:52:19 2024 +0800 Merge branch 'main' into dev_ian commit c451e67 Author: ian <tycheng@nus.edu.sg> Date: Tue Oct 8 11:17:54 2024 +0800 dvine: s_first can be in the middle! sim: sobol seq dvine: TSP with precedence constraints or clustered TSP cvine/rvine: min heap DataBiCop.sim: is_sobol DataVineCop.sim: is_sobol commit 11566f1 Merge: 9c26242 687c4bb Author: TYCheng <cty120120@gmail.com> Date: Wed Sep 25 20:17:00 2024 +0800 Merge branch 'main' into dev_ian commit 9c26242 Author: TYCheng <cty120120@gmail.com> Date: Wed Sep 25 20:14:05 2024 +0800 update source files commit db1fd00 Author: TYCheng <cty120120@gmail.com> Date: Wed Sep 25 20:13:09 2024 +0800 Squashed commit of the following: commit 687c4bb Author: Tuoyuan Cheng <tycheng@nus.edu.sg> Date: Fri Aug 23 18:03:40 2024 +0800 sampling order (tpl_sim) and vcp_from_sim (#25) * Update python-package.yml util.__init__ : ref_count_hfunc() to greedily find tpl_sim with min hfunc calls vinecop._data_vcp : one visit() for both hfunc and hinv in sim vinecop._factory_vcp: code refactoring to include the above * pyproject.toml, stdtr/stdtrit, README drop torch dependency for user customization * Update .yml pytest ./tests matrix.os * README, test_vinecop * sampling order, simplified commit 7a713c2 Author: TYCheng <cty120120@gmail.com> Date: Wed Sep 25 20:10:33 2024 +0800 _data_vcp: sim, is_antithetic commit a587c0a Author: TYCheng <cty120120@gmail.com> Date: Wed Sep 25 20:04:51 2024 +0800 Squashed commit of the following: commit 687c4bb Author: Tuoyuan Cheng <tycheng@nus.edu.sg> Date: Fri Aug 23 18:03:40 2024 +0800 sampling order (tpl_sim) and vcp_from_sim (#25) * Update python-package.yml util.__init__ : ref_count_hfunc() to greedily find tpl_sim with min hfunc calls vinecop._data_vcp : one visit() for both hfunc and hinv in sim vinecop._factory_vcp: code refactoring to include the above * pyproject.toml, stdtr/stdtrit, README drop torch dependency for user customization * Update .yml pytest ./tests matrix.os * README, test_vinecop * sampling order, simplified commit b62dfa4 Author: ian <tycheng@nus.edu.sg> Date: Thu Aug 29 10:20:08 2024 +0800 _data_vcp: sim, antithetic variates commit 8acf040 Author: ian <tycheng@nus.edu.sg> Date: Fri Aug 23 17:48:18 2024 +0800 sampling order, simplified commit 25646ba Merge: ea8f5c1 ac42d78 Author: ian <tycheng@nus.edu.sg> Date: Fri Aug 23 17:46:32 2024 +0800 Merge branch 'main' into dev_ian commit ea8f5c1 Merge: c9559cf f932d88 Author: ian <tycheng@nus.edu.sg> Date: Wed Jul 17 23:03:29 2024 +0800 Merge branch 'main' into dev_ian commit c9559cf Author: ian <tycheng@nus.edu.sg> Date: Wed Jul 17 23:03:23 2024 +0800 README, test_vinecop commit 64ec149 Author: ian <tycheng@nus.edu.sg> Date: Tue Jul 16 11:30:55 2024 +0800 Update .yml pytest ./tests matrix.os commit 203dd87 Merge: 2576acc a8de187 Author: ian <tycheng@nus.edu.sg> Date: Tue Jul 16 11:30:38 2024 +0800 Merge branch 'main' into dev_ian commit 2576acc Author: ian <tycheng@nus.edu.sg> Date: Tue Jul 16 11:08:36 2024 +0800 pyproject.toml, stdtr/stdtrit, README drop torch dependency for user customization commit acfc50e Merge: 33022c0 20dece8 Author: ian <tycheng@nus.edu.sg> Date: Tue Jul 2 21:43:48 2024 +0800 Merge branch 'main' into dev_ian commit 33022c0 Author: ian <tycheng@nus.edu.sg> Date: Tue Jul 2 21:15:36 2024 +0800 v2024.7.0 util.__init__ : ref_count_hfunc() to greedily find tpl_sim with min hfunc calls vinecop._data_vcp : one visit() for both hfunc and hinv in sim vinecop._factory_vcp: code refactoring to include the above commit d203c34 Merge: 1d367d7 72a37a3 Author: ian <tycheng@nus.edu.sg> Date: Mon Jun 24 19:55:55 2024 +0800 Merge branch 'main' into dev_ian commit 1d367d7 Merge: b943dc0 057d3ef Author: ian <tycheng@nus.edu.sg> Date: Mon Jun 24 14:49:51 2024 +0800 Merge branch 'main' into dev_ian commit b943dc0 Author: Tuoyuan Cheng <tycheng@nus.edu.sg> Date: Mon Jun 24 14:42:01 2024 +0800 Update python-package.yml commit 48b0aab Author: Tuoyuan Cheng <tycheng@nus.edu.sg> Date: Mon Jun 24 14:39:30 2024 +0800 Update python-package.yml commit 4e87861 Author: ian <tycheng@nus.edu.sg> Date: Mon Jun 24 14:31:09 2024 +0800 Update python-package.yml
Co-Authored-By: Gaurav Agrawal <63945607+gagrawal009@users.noreply.github.com>
Co-authored-by: Thibault Vatter <thibault.vatter@gmail.com>
There was a problem hiding this comment.
Pull Request Overview
This PR adds non‐parametric bivariate copula functionality (tll, fastKDE) and multiple new usage examples, updates configuration, CI workflows, and documentation to support these features.
- Introduce a new MNIST VAE experiment (
examples/vcae_mnist) with seed control and logging - Add prediction‐interval examples (
examples/pred_intvl) using vine copulas, ensembles, MC dropout, and BNNs - Revise docs, README, and GitHub Actions to integrate new dependencies (
fastkde,uv) and deployment steps
Reviewed Changes
Copilot reviewed 55 out of 55 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| examples/vcae_mnist/vcae_mnist/experiment.py | New experiment runner for VAE + vine copula on MNIST |
| examples/vcae_mnist/vcae_mnist/config.py | Configuration dataclass and device settings |
| examples/vcae_mnist/run_seeds.sh | Bash script to launch experiments over seed ranges |
| examples/vcae_mnist/run_seeds.py | Python script orchestrating seed‐based experiments |
| examples/pred_intvl/vine_wrapper.py | Wrapper functions for vine copula training and sampling |
| examples/pred_intvl/models.py | Regression models and prediction‐interval methods |
| examples/pred_intvl/*.py/** | Orchestration, data loading, and logging utilities |
| docs/* | Documentation updates (index, conf.py) |
| README.md | Dependency list updates and installation instructions |
| .github/workflows/*.yml | CI/CD workflow revisions for linting, docs, and release |
Comments suppressed due to low confidence (1)
examples/pred_intvl/vine_wrapper.py:34
- [nitpick] Using
_as both the loop variable and a placeholder can be confusing; rename the loop variable to something likedim_idxfor clarity.
dct_v_s_obs = {(_,): Z_test[:, [_]] for _ in range(Z_test.shape[1])}
| np.random.seed(seed) | ||
| torch.manual_seed(seed) | ||
| torch.cuda.manual_seed_all(seed) | ||
| torch.backends.cudnn.benchmark = True |
There was a problem hiding this comment.
Enabling both cudnn.benchmark = True and cudnn.deterministic = True can lead to nondeterministic behavior; consider disabling benchmark for strict reproducibility.
| torch.backends.cudnn.benchmark = True | |
| torch.backends.cudnn.benchmark = False |
| end=$((i + 10)) | ||
| name="seeds_${i}_${end}" | ||
| echo "Launching $name" | ||
| nohup "$PYTHON_BIN" run_seeds.py $i $end > logs/$name.log 2>&1 & |
There was a problem hiding this comment.
The logs/ directory may not exist before redirection, causing failures; add mkdir -p logs before the loop to ensure the directory is created.
| branches: ["main"] | ||
|
|
||
| # Allows you to run this workflow manually from the Actions tab | ||
| # ALso allow manual dispatch |
There was a problem hiding this comment.
Typo in comment: ALso should be Also.
| # ALso allow manual dispatch | |
| # Also allow manual dispatch |
| self.encoder = nn.Sequential( | ||
| nn.Linear(input_dim, hidden_dim1), | ||
| nn.BatchNorm1d(hidden_dim1), | ||
| nn.LeakyReLU(0.1, inplace=True), | ||
| nn.Dropout(p_drop), | ||
| # | ||
| nn.Linear(hidden_dim1, hidden_dim2), | ||
| nn.BatchNorm1d(hidden_dim2), | ||
| nn.LeakyReLU(0.1, inplace=True), | ||
| nn.Dropout(p_drop), | ||
| # | ||
| nn.Linear(hidden_dim2, latent_dim), | ||
| nn.BatchNorm1d(latent_dim), | ||
| nn.LeakyReLU(0.1, inplace=True), | ||
| nn.Dropout(p_drop), | ||
| # | ||
| nn.Linear(latent_dim, hidden_dim3), | ||
| nn.BatchNorm1d(hidden_dim3), | ||
| nn.LeakyReLU(0.1, inplace=True), | ||
| nn.Dropout(p_drop), | ||
| # | ||
| nn.Linear(hidden_dim3, hidden_dim4), | ||
| nn.BatchNorm1d(hidden_dim4), | ||
| nn.LeakyReLU(0.1, inplace=True), | ||
| nn.Dropout(p_drop), | ||
| # | ||
| nn.Linear(hidden_dim4, hidden_dim5), | ||
| nn.BatchNorm1d(hidden_dim5), | ||
| nn.LeakyReLU(0.1, inplace=True), | ||
| nn.Dropout(p_drop), | ||
| # | ||
| nn.Linear(hidden_dim5, latent_dim), | ||
| nn.BatchNorm1d(latent_dim), | ||
| nn.Tanh(), # keeps latent coords in [–1,1] | ||
| ) |
There was a problem hiding this comment.
[nitpick] The encoder consists of repeated blocks of Linear➔BatchNorm➔LeakyReLU➔Dropout; consider generating these layers via a loop or helper to reduce duplication and ease future modifications.
| self.encoder = nn.Sequential( | |
| nn.Linear(input_dim, hidden_dim1), | |
| nn.BatchNorm1d(hidden_dim1), | |
| nn.LeakyReLU(0.1, inplace=True), | |
| nn.Dropout(p_drop), | |
| # | |
| nn.Linear(hidden_dim1, hidden_dim2), | |
| nn.BatchNorm1d(hidden_dim2), | |
| nn.LeakyReLU(0.1, inplace=True), | |
| nn.Dropout(p_drop), | |
| # | |
| nn.Linear(hidden_dim2, latent_dim), | |
| nn.BatchNorm1d(latent_dim), | |
| nn.LeakyReLU(0.1, inplace=True), | |
| nn.Dropout(p_drop), | |
| # | |
| nn.Linear(latent_dim, hidden_dim3), | |
| nn.BatchNorm1d(hidden_dim3), | |
| nn.LeakyReLU(0.1, inplace=True), | |
| nn.Dropout(p_drop), | |
| # | |
| nn.Linear(hidden_dim3, hidden_dim4), | |
| nn.BatchNorm1d(hidden_dim4), | |
| nn.LeakyReLU(0.1, inplace=True), | |
| nn.Dropout(p_drop), | |
| # | |
| nn.Linear(hidden_dim4, hidden_dim5), | |
| nn.BatchNorm1d(hidden_dim5), | |
| nn.LeakyReLU(0.1, inplace=True), | |
| nn.Dropout(p_drop), | |
| # | |
| nn.Linear(hidden_dim5, latent_dim), | |
| nn.BatchNorm1d(latent_dim), | |
| nn.Tanh(), # keeps latent coords in [–1,1] | |
| ) | |
| def _make_block(in_dim, out_dim, p_drop): | |
| return [ | |
| nn.Linear(in_dim, out_dim), | |
| nn.BatchNorm1d(out_dim), | |
| nn.LeakyReLU(0.1, inplace=True), | |
| nn.Dropout(p_drop), | |
| ] | |
| encoder_layers = [] | |
| layer_dims = [ | |
| (input_dim, hidden_dim1), | |
| (hidden_dim1, hidden_dim2), | |
| (hidden_dim2, latent_dim), | |
| (latent_dim, hidden_dim3), | |
| (hidden_dim3, hidden_dim4), | |
| (hidden_dim4, hidden_dim5), | |
| (hidden_dim5, latent_dim), | |
| ] | |
| for in_dim, out_dim in layer_dims: | |
| encoder_layers.extend(_make_block(in_dim, out_dim, p_drop)) | |
| # Add final Tanh layer | |
| encoder_layers.append(nn.Tanh()) # keeps latent coords in [–1,1] | |
| self.encoder = nn.Sequential(*encoder_layers) |
uv run docformatter --in-place torchvinecopulib uvx ruff format ./**/*.py ./**/*.ipynb uv run flake8 ./torchvinecopulib --exclude .venv --count --select=E9,F63,F7,F82 --show-source --statistics uv run flake8 ./torchvinecopulib --count --exit-zero --max-complexity=10 --max-line-length=127 --ignore=E203,W503,E501,C901 --statistics Whitespace before ':' (E203) Line break occurred before a binary operator (W503) Line too long (82 > 79 characters) (E501) Function is too complex (C901)
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesFootnotes
|
No description provided.