ica#

diffsptk.ICA#

alias of IndependentComponentAnalysis

class diffsptk.IndependentComponentAnalysis(order: int, n_comp: int, *, func: str = 'logcosh', n_iter: int = 100, eps: float = 0.0001, batch_size: int | None = None, seed: int | None = None, verbose: bool = False)[source]#

Independent component analysis module. Note that the forward method is not differentiable.

Parameters:
orderint >= 0

The order of the vector, \(M\).

n_compint >= 1

The number of components, \(K\).

func[‘logcosh’, ‘gauss’]

The nonquadratic function used in the approximation of negentropy.

n_iterint >= 1

The number of iterations.

epsfloat >= 0

The convergence threshold.

batch_sizeint >= 1 or None

The batch size.

seedint or None

The random seed.

verbosebool

If True, shows progress bars.

References

[1]

A. Hyvarinen and E. Oja, “Independent component analysis: algorithms and applications,” Neural Networks, vol. 13, pp. 411-430, 2000.

forward(x: Tensor) Tensor[source]#

Perform independent component analysis.

Parameters:
xTensor [shape=(T, M+1)] or DataLoader

The input vectors or a DataLoader that yields the input vectors.

Returns:
WTensor [shape=(K, K)]

The separating matrix.

transform(x: Tensor) Tensor[source]#

Separate the input vectors into independent components.

Parameters:
xTensor [shape=(…, M+1)]

The input vectors.

Returns:
outTensor [shape=(…, K)]

The estimated independent components.

See also

pca