tlda.SecondOrderCumulant

class tlda.SecondOrderCumulant(n_eigenvec, alpha_0, batch_size)[source]

Class to compute the third order cumulant

Methods

fit(X)

Method to fit the entire data to get the projection weights (singular vectors) and whitening weights (scaled explained variance) of a centered input dataset X.

partial_fit(X_batch)

Fit a batch of data and update the projection weights (singular vectors) and whitening weights (scaled explained variance) accordingly using a centered batch of the input dataset X.

reverse_transform(X)

Unwhiten some whitened tensor X using the fitted PCA model.

transform(X)

Whiten some centered tensor X using the fitted PCA model.

fit(X)[source]

Method to fit the entire data to get the projection weights (singular vectors) and whitening weights (scaled explained variance) of a centered input dataset X.

Parameters:
Xtensor of shape (n_samples, vocabulary_size)

Tensor containing all input documents

partial_fit(X_batch)[source]

Fit a batch of data and update the projection weights (singular vectors) and whitening weights (scaled explained variance) accordingly using a centered batch of the input dataset X.

Parameters:
X_batchtensor of shape (batch_size, vocabulary_size)

Tensor containing a batch of input documents

transform(X)[source]

Whiten some centered tensor X using the fitted PCA model.

Parameters:
Xtensor of shape (batch_size, vocabulary_size)

Batch of centered samples

Returns:
whitened_Xtensor of shape (batch_size, self.n_eigenvec)

Whitened samples

reverse_transform(X)[source]

Unwhiten some whitened tensor X using the fitted PCA model.

Parameters:
Xtensor of shape (batch_size, self.n_eigenvec)

whitened input tensor

Returns:
unwhitened_Xtensor of shape (batch_size, vocabulary_size)

Batch of unwhitened centered samples