Metadata-Version: 2.4
Name: microml
Version: 0.1.2
Summary: The easy, open source, and lightweight ML library for beginners.
Author: The Axiom Project
License-Expression: MIT
Project-URL: Homepage, https://github.com/StrawberCar/MicroML
Keywords: machine learning,deep learning,pytorch,beginner,education
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Education
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: torch>=2.0.0
Requires-Dist: numpy>=1.24.0
Requires-Dist: tqdm>=4.65.0
Provides-Extra: image
Requires-Dist: Pillow>=9.0.0; extra == "image"
Provides-Extra: audio
Requires-Dist: soundfile>=0.12.0; extra == "audio"
Requires-Dist: librosa>=0.10.0; extra == "audio"
Provides-Extra: video
Requires-Dist: opencv-python>=4.8.0; extra == "video"
Provides-Extra: all
Requires-Dist: Pillow>=9.0.0; extra == "all"
Requires-Dist: soundfile>=0.12.0; extra == "all"
Requires-Dist: librosa>=0.10.0; extra == "all"
Requires-Dist: opencv-python>=4.8.0; extra == "all"
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Dynamic: license-file

# microML

The easy, open source, and lightweight ML library for beginners.

## Quick Start

```python
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

```bash
pip install torch numpy tqdm
pip install -e .
```

For optional features:

```bash
# 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/`](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

```bash
pytest tests/
```

## Documentation

See [Docs.md](Docs.md) for the full API reference and beginner-friendly machine learning explanations.

## License

MIT
