Welcome to BCI Lib!

BCI Lib

Test status Test coverage Build status PyPI

Basic information

Implementation code for BCI models. The source code presented on the github.

All methods were implemented based on pytorch for simple parallelization by using cuda.

All information about this project can be found in the documentation.

Requirements and Installation

A simple instruction of installation using pip is provided near the source code.

More information about installation can be found in documentation installation page.

Example of use

A simple examples of module usage can be found in documentation example page.

Installation

Requirements

  • Python >= 3.8

  • pip >= 22.0

Installing by using PyPi

Install

python3 -m pip install bci-ml

Uninstall

python3 -m pip uninstall bci-ml

Installing from GitHub source

Install

git clone https://github.com/intsystems/bci-ml.git
cd bci-ml
python3 -m pip install ./src/

Uninstall

python3 -m pip uninstall bci-ml

Example

Requirements

It is recommended make virtualenv and install all next packages in this virtualenv.

bci-ml==0.0.1

Include packages.

TODO

Preparing the dataset

TODO

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

Indices and tables