archetypes.torch.BiAA#

class archetypes.torch.BiAA(k, m, n, device='cpu')#

Biarchetype analysis implemented in PyTorch.

Parameters:
k: tuple

The number of archetypes to use for each dimension.

m: int

The number of observations in the first dimension.

n: int

The number of observations in the second dimension.

device: str

The device to use for training the model. Defaults to “cpu”.

Attributes:
A

A coefficients matrix.

B

B coefficients matrix.

C

C coefficients matrix.

D

D coefficients matrix.

Z

The archetypes matrix.

Methods

train(data, n_epochs[, learning_rate])

Train the model.

property A#

A coefficients matrix.

Returns:
torch.Tensor
property B#

B coefficients matrix.

Returns:
torch.Tensor
property C#

C coefficients matrix.

Returns:
torch.Tensor
property D#

D coefficients matrix.

Returns:
torch.Tensor
property Z#

The archetypes matrix.

Returns:
torch.Tensor
train(data, n_epochs, learning_rate=0.01)#

Train the model.

Parameters:
data: torch.Tensor

The data to be used for training.

n_epochs: int

The number of epochs to train the model for.

learning_rate: float

The learning rate to use for training.