TorchVinecopBackend
- class TorchVinecopBackend(*, controls=None, structure=None)
PyTorch backend. Wraps
pyvinecopulib.torch.TorchVinecop.Pick this backend for GPU placement (
.to("cuda")), autograd through the vine cascade, or composition with othertorch.nn.Modulecode. The defaultVinecopBackendis generally faster on CPU for the same problem.Constructing this class imports torch — the explicit opt-in signal that PyTorch is required. The default
FitControlsTorchVinecopis materialised lazily at fit time.- Parameters:
- controlsFitControlsTorchVinecop, or None, optional
Cascade / placement / precision knobs plus the native (pure-torch) structure-selection knobs (
tree_algorithm/seeds/trunc_lvl/tree_criterion/threshold). None resolves to defaults at fit time.- structureRVineStructure, or None, optional
A pre-specified vine structure; when provided, fit_vine skips structure selection.
Methods
cdf
fit_vine
pdf
simulate
with_num_threads
Notes
with_num_threads is a no-op on this backend; for CPU intraop parallelism call
torch.set_num_threads(N)globally before evaluating. The sklearn forest’s outer parallelism (via joblib) still applies independently.Methods