combinatorial_probabilistic_compression
Bases: combinatorial_compression
A combinatorial probabilistic compression class for dimensionality reduction.
This class extends combinatorial_compression
by enabling probabilistic sampling
of feature combinations based on a defined metric or distribution function.
Notes
Based on the combinatorial compression function, a corresponding multivariate distribution can also be applied to compute the log-likelihood of the tuples: $$ \begin{equation} \kappa(\mathbf{x}) = \log P\left( {\kappa(\mathbf{x} | k) \choose d} | \boldsymbol{\theta} \right) \in {R}^d, \end{equation} $$ which reduce the output dimension to be \(\sum_{i=1}^d k \times 1\).
Methods:
Name | Description |
---|---|
__init__ |
Initializes the combinatorial probabilistic compression instance. |
Source code in tinybig/compression/combinatorial_compression.py
__init__(name='combinatorial_probabilistic_compression', d=1, k=1, metric=None, with_replacement=False, require_normalization=True, *args, **kwargs)
Initializes the combinatorial probabilistic compression instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Name of the transformation. Defaults to 'combinatorial_probabilistic_compression'. |
'combinatorial_probabilistic_compression'
|
d
|
int
|
Maximum order of combinations to generate. Defaults to 1. |
1
|
k
|
int
|
Number of combinations to retain per order. Defaults to 1. |
1
|
metric
|
Callable
|
Metric function to apply to the input tensor before sampling. Defaults to None. |
None
|
with_replacement
|
bool
|
If True, allows combinations to be generated with replacement. Defaults to False. |
False
|
require_normalization
|
bool
|
If True, normalizes the input tensor before sampling. Defaults to True. |
True
|
*args
|
tuple
|
Additional positional arguments for the parent |
()
|
**kwargs
|
dict
|
Additional keyword arguments for the parent |
{}
|