Skip to main content

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 model
  • examples/image_classifier.py -- Define a CNN for image classification
  • examples/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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

microml-0.1.0.tar.gz (28.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

microml-0.1.0-py3-none-any.whl (26.5 kB view details)

Uploaded Python 3

File details

Details for the file microml-0.1.0.tar.gz.

File metadata

  • Download URL: microml-0.1.0.tar.gz
  • Upload date:
  • Size: 28.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for microml-0.1.0.tar.gz
Algorithm Hash digest
SHA256 daf43ba4654045b0e6457b25d3e206cffb717709b922bc21004fbae9fcc629be
MD5 7316fbf4976e195c249665a92014c070
BLAKE2b-256 1358cfa97d9af4e0b470c9f5567c81a1a22240544aa47f4fb08c1270c9f2adae

See more details on using hashes here.

File details

Details for the file microml-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: microml-0.1.0-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

Hashes for microml-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a190482a0f161ee9c8a931c6d52a7635334c4b7d78e76511dd00119f6f70791e
MD5 6d5a587575ea63a3c8fd12529fb3bbb2
BLAKE2b-256 72e1ba088f54770ddf0d1cc9c08c050163c33a07d8d416c911eca1efda799939

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page