The easy, open source, and lightweight ML library for beginners.
Project description
microML
The easy, open source, and lightweight ML library for beginners.
Quick Start
from microml import LoadDS, SplitDataset, Tokenize, DefModel, Train, Infer, SaveChkp, LoadModel
# 1. Load data
data = LoadDS("dataset.txt")
train_data, val_data = SplitDataset(data, 0.8)
# 2. Tokenize
tokenized = Tokenize(train_data, "Text")
val_tokens = Tokenize(val_data, "Text")
# 3. Define model
model = DefModel("generative", "tiny", "Text", learning_rate=1e-3, batch_size=4)
model.summary()
# 4. Train
model, history = Train(
model, steps=50, epochs=2, tokens=tokenized, device="CPU",
validation_data=val_tokens, print_every=25
)
# 5. Inference
result = Infer(model, "Hello", temp=0.8, max_length=20, tokenizer=tokenized["tokenizer"])
print(result["response"])
# 6. Save
SaveChkp("my_model.mml")
Installation
pip install torch numpy tqdm
pip install -e .
For optional features:
# Image support
pip install -e ".[image]"
# Audio support
pip install -e ".[audio]"
# Video support
pip install -e ".[video]"
# Everything
pip install -e ".[all]"
# Development (tests, etc.)
pip install -e ".[dev]"
What Can microML Do?
microML makes it simple to train small models for many tasks:
- Text Generation -- Write a prompt, get generated text
- Chat Models -- Train conversational AI
- Image Classification -- Classify images with a CNN
- Image Autoencoders -- Compress and reconstruct images
- Audio Generation -- Generate audio waveforms
- Video Classification -- Classify video clips
- Time Series Prediction -- Predict future values from sequences
- Regression -- Predict continuous numbers
- Classification -- Predict categories from text or numbers
Examples
See the examples/ folder for ready-to-run scripts:
examples/text_generation.py-- Train a tiny language modelexamples/image_classifier.py-- Define a CNN for image classificationexamples/time_series_prediction.py-- Predict sine wave values with an LSTM
Running Tests
pytest tests/
Documentation
See Docs.md for the full API reference and beginner-friendly machine learning explanations.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file microml-0.1.2.tar.gz.
File metadata
- Download URL: microml-0.1.2.tar.gz
- Upload date:
- Size: 27.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ff875d8e33634329fec5c2f993bfca7a3873eca5b6fbef87388d589b44b57e4
|
|
| MD5 |
85973474ceb550eaec83254082711b8d
|
|
| BLAKE2b-256 |
977e7801ff486ff04d62168a0d9c3a55c3b9437317b87a14605299965731c290
|
File details
Details for the file microml-0.1.2-py3-none-any.whl.
File metadata
- Download URL: microml-0.1.2-py3-none-any.whl
- Upload date:
- Size: 26.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7381fe1f6e91f90bb6803291a0c485ea27b294c6bc0fc42878ceb65356ad723
|
|
| MD5 |
8908a7f76eb30f14255f5f6c629cde13
|
|
| BLAKE2b-256 |
83caf5b7d9d5e332d6d98ff657d533323929eb06fba274e18b1cc191e144ad40
|