Base Models

The bci.base_models contains classes:

  • bci.base_models.BaseModel

  • bci.base_models.IdentityModel

class bci_ml.base_models.BaseModel[source]

Base class for the BCI models.

fit(input)[source]

Fit model for the given input data.

Parameters

input (FloatTensor.) – The tensor of the analyzed data.

forward(input)[source]

Returns model prediction for the given input data.

Parameters

input (FloatTensor.) – The tensor of the analyzed data.

Returns

Model answers for the given input data

Return type

FloatTensor

class bci_ml.base_models.IdentityModel[source]

A model which defines identity mapping. Mathematically define model \(\textbf{f}(\textbf{x}) = \textbf{x}\).

Warning

It’s just an example of BCI model, and cannot be used in real cases.

Example:

>>> _ = torch.random.manual_seed(42) # Set random seed for repeatability
>>>
>>> model = IdentityModel()
>>> X = torch.randn(2, 1) # Generate random tensor
>>> predict = model(X)
tensor([[0.3367],
    [0.1288]])
forward(input)[source]

Returns model prediction for the given input data.

Parameters

input (FloatTensor.) – The tensor of the analyzed data.

Returns

Return similar tensor to input data.

Return type

FloatTensor