TMU is a comprehensive repository that encompasses several Tsetlin Machine implementations. Offering a rich set of features and extensions, it serves as a central resource for enthusiasts and researchers alike.
-
Core Implementations:
- Tsetlin Machine
- Coalesced Tsetlin Machine
- Convolutional Tsetlin Machine
- Regression Tsetlin Machine
- Weighted Tsetlin Machine
- Autoencoder
- Multi-task Classifier (Upcoming)
- One-vs-one Multi-class Classifier (Upcoming)
- Relational Tsetlin Machine (In Progress)
-
Extended Features:
- Support for Continuous Features
- Drop Clause
- Literal Budget
- Focused Negative Sampling
- Type III Feedback
- Incremental Clause Evaluation (Upcoming)
- Sparse Computation with Absorbing Actions
- TMComposites: Plug-and-Play Collaboration Between Specialized Tsetlin Machines (In Progress)
-
Wrappers for C and CUDA-based clause evaluation and updates to enable high-performance computation.
Before installing TMU on Windows, ensure you have the MSVC build tools. Follow these steps:
- Download MSVC build tools
- Install the
Workloads → Desktop development with C++
package. (Note: The package size is about 6-7GB.)
Ubuntu: sudo apt install libffi-dev
To get started with TMU, run the following command:
# Installing Stable Branch
pip install git+https://github.com/cair/tmu.git
# Installing Development Branch
pip install git+https://github.com/cair/tmu.git@dev
You will have to have CUDA version 12.4 or higher installed on your system.
Build the docker environment with (replace THREADS
with the number of threads you want to use):
docker build -f docker/ubuntu.Dockerfile --build-arg THREADS=8 -t tmu-kd:ubuntu .
Then, run the image with
docker run -it --gpus=all --name tmu-kd -v $(pwd):$(pwd) -w $(pwd) tmu-kd:ubuntu /bin/bash
This is built for CUDA. If for some reason you can't use CUDA, use the `docker/alpine.Dockerfile image.
This will enter you into the container. If you exit, you can reenter (while it's still running) with
docker exec -it tmu-kd /bin/bash
I created a script to run our baseline:
./baseline.sh
This will run
- MNIST
- FashionMNIST
- CIFAR-10 with different configurations.
If you're looking to contribute or experiment with the codebase, follow these steps:
-
Clone the Repository:
git clone -b dev git@github.com:ckinateder/tmu-kd.git && cd tmu
-
Set Up Development Environment: Navigate to the project directory and compile the C library:
# Install TMU pip install . # (Alternative): Install TMU in Development Mode pip install -e . # Install TMU-Composite pip install .[composite] # Install TMU-Composite in Development Mode pip install -e .[composite]
-
Starting a New Project: For your projects, simply create a new branch and then within the 'examples' folder, create a new project and initiate your development.