Skip to main content

pySMLE: Simplify Machine Learning Environments

GitHub stars GitHub forks Codacy Badge

PyPI version License PyPI Downloads

Discord Server

Stop writing boilerplate. Start training.

pySMLE (you can simply call it SMILE) is a lightweight Python framework that automates the "boring stuff" in Machine Learning projects. It handles configuration parsing, logging setup, and experiment tracking so you can focus on the model.

Why pySMLE?

  • Auto-Configuration: yaml files are automatically parsed and injected into your entrypoint. No more hardcoded hyperparameters.
  • Instant Logging: All print statements and configs are automatically captured to local logs and remote trackers.
  • Remote Monitoring: Native integration with Weights & Biases (WandB) to monitor experiments from anywhere.

Installation

pip install smle

Quickstart

Initialize a Project

Run the CLI tool to generate a template and config file:

smle init

Configuration

pySMLE relies on a simple YAML structure to define hyperparameters, paths, logging options, and integrations. You can configure the smle.yaml file with the hyperparameters and options for your project.

The structure of the smle.yaml file is:

# ---------------------------------------
# pySMLE Configuration (Modify Carefully)
# ---------------------------------------

project: project_name

# ---------------------------
# Logging & Tracking
# ---------------------------

logger:
  dir: logger

wandb:
  entity: your_wandb_account

# ---------------------------------------
# Example of User Section
# ---------------------------------------

seed: seed
device: 'cpu'/'cuda'

training:
    epochs: n_epochs
    lr: lr
    weight_decay: wd
    batch: batch_size

testing:
    batch: batch_size

Note. pySMLE expects your Weights and Biases API key to be in the environment variable WANDB_API_KEY. You can put it in the .env file, but ensure .env is in your .gitignore.

Write Your Code

Use the @app.entrypoint decorator. Your configuration variables are automatically passed via args.

from smle import SMLE()

app = SMLE()

@app.entrypoint
def main(args):
    # 'args' contains your pysmle.yaml configurations
    print(f"Training with learning rate: {args['training']['lr']}")

    # Your logic here...

if __name__ == "__main__":
    app.run()

By default, pySMLE will look for a configuration file named smle.yaml in the current directory. If you would like to use a different name, a different location, or have multiple configuration files for different configurations, you can set the config_file property of pySMLE to the path of your file. You must assign the filename before calling run().

app = SMLE()
app.config_file = "my_file.yaml"
...
app.run()

Run It

python main.py

Contributing

Contributions are welcome!

If you’re interested in helping, please feel free to join our discord server or the dedicated discussion page and ping there your availability.

We can then discuss a possible contribution together, answer any questions, and help you get started!

Please, before opening a pull request, consult our CONTRIBUTING.md

Thank you for your support!

Roadmap

High Priority

  • Documentation: Write comprehensive documentation and examples.

Planned Features

  • ML Templates: Automated creation of standard project structures.
  • Model Tools: Utilities for Neural Network creation, training, and testing.
  • Notifications: Email notification system for completed training runs.
  • Data Tools: Data exploration and visualization helpers.
  • Analysis: Result analysis tools (diagrams, confusion matrices, etc.).
  • Integrations: Support for TensorBoard and similar tracking tools.
  • Testing: Comprehensive unit and integration tests for the framework.

Release files for pyfenn 0.0.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 pyfenn 0.0.2
File Size Uploaded
pyfenn-0.0.2.tar.gz 13.1 kB Details

Built distribution (wheel)

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

Total release size: 31.0 kB

Release files / pyfenn-0.0.2.tar.gz

Download URL pyfenn-0.0.2.tar.gz
Size 13.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6d4f3e494694dd60024afb7634b3ff19a41ab46df09be7eb70209821a32f06dc
BLAKE2b-256 checksum
How to use checksums
3d27952b4b40e78f46be89d11074b945af36be47f4ef6b9946a7b9ae21d9c1b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.14

Release files / pyfenn-0.0.2-py3-none-any.whl

Download URL pyfenn-0.0.2-py3-none-any.whl
Size 17.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
01ebd54781f3f19a0809df610cc4ffa031f77d0285f235a0a7ce2116376f4513
BLAKE2b-256 checksum
How to use checksums
4afe037b9a94d3bf4ea864dc131a1d908cd10a494ecd0ef4b5b0678c48dc0b57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.14

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

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