Skip to main content

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

Metadata

Release files for microml 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for microml 0.1.2
File Size Uploaded Provenance Actions
microml-0.1.2.tar.gz 27.8 kB Without provenance Details for microml-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for microml 0.1.2
File Interpreter ABI Platform Actions
microml-0.1.2-py3-none-any.whl Python 3 none any Details for microml-0.1.2-py3-none-any.whl

Total release size: 54.3 kB

Release files / microml-0.1.2.tar.gz

Download URL microml-0.1.2.tar.gz
Size 27.8 kB
Tags Source
SHA-256 checksum
How to use checksums
3ff875d8e33634329fec5c2f993bfca7a3873eca5b6fbef87388d589b44b57e4
BLAKE2b-256 checksum
How to use checksums
977e7801ff486ff04d62168a0d9c3a55c3b9437317b87a14605299965731c290
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / microml-0.1.2-py3-none-any.whl

Download URL microml-0.1.2-py3-none-any.whl
Size 26.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a7381fe1f6e91f90bb6803291a0c485ea27b294c6bc0fc42878ceb65356ad723
BLAKE2b-256 checksum
How to use checksums
83caf5b7d9d5e332d6d98ff657d533323929eb06fba274e18b1cc191e144ad40
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Security for microml 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page