Skip to main content

Friendly Environment for Neural Networks – a simple framework that automates the boring side of ML.

Project description

fenn: Friendly Environment for Neural Networks

fenn logo

GitHub stars GitHub forks Codacy Badge PyPI version License PyPI Downloads Discord Server

Stop writing boilerplate. Start training.

fenn 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 fenn?

  • 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 fenn

Quickstart

Initialize a Project

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

fenn init

Configuration

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

The structure of the fenn.yaml file is:

# ---------------------------------------
# Fenn 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. fenn 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 fenn import FENN

app = FENN()

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

    # Your logic here...

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

By default, fenn will look for a configuration file named fenn.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 fenn to the path of your file. You must assign the filename before calling run().

app = FENN()
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.

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

fenn-0.0.6.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

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

fenn-0.0.6-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

Details for the file fenn-0.0.6.tar.gz.

File metadata

  • Download URL: fenn-0.0.6.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for fenn-0.0.6.tar.gz
Algorithm Hash digest
SHA256 c347cfce62de6bc1b042a1483941361b6a9335efda7b22ddb9d02f9e39ae465a
MD5 34e75482bb74aad8f1b43553fa924b3e
BLAKE2b-256 34a1c50816d744e56e543db924a6b569350d3981c69169a230c557d61deb4e49

See more details on using hashes here.

File details

Details for the file fenn-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: fenn-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 18.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for fenn-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 b8c8db367edbe2d44f861461816da1f4bc9ae9638b2ae6ec7691268bbc0ec4ab
MD5 dd2bace8c8c6ed3f528ee7c77cc24d95
BLAKE2b-256 e62e054dbdfa568b17731bedaaaf6ca83556929e439aadf35d7b64aaae6343ea

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