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 other torch.nn.Module code. The default VinecopBackend is generally faster on CPU for the same problem.

Constructing this class imports torch — the explicit opt-in signal that PyTorch is required. The default FitControlsTorchVinecop is 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

__init__

cdf

fit_vine

pdf

simulate

structure_of

with_local_random

with_num_threads

with_random_structure