Traingenerator — Code Generator for Machine Learning
The perfect tool to jumpstart your next machine learning project!
Traingenerator is a web app to generate template code for machine learning
To generate custom template code for PyTorch & sklearn, using a simple web UI built with streamlit. traingenerator offers multiple options for preprocessing, model setup, training, and visualization (using Tensorboard or comet.ml). It exports to .py, Jupyter Notebook, or Google Colab.
Jumpstart your machine learning code:
- Specify model in the sidebar (click on > if closed)
- Training code will be generated below
- Download and do magic! ✨
Adding new templates
You can add your own template in 4 easy steps (see below), without changing any code in the app itself. Your new template will be automatically discovered by traingenerator and shown in the sidebar.
Some ideas for new templates: Keras/Tensorflow, Pytorch Lightning, object detection, segmentation, text classification, …
- Create a folder under
./templates
. The folder name should be the task that your template solves (e.g.Image classification
). Optionally, you can add a framework name (e.g.Image classification_PyTorch
). Both names are automatically shown in the first two dropdowns in the sidebar (see image). ✨ Tip: Copy the example template to get started more quickly. - Add a file
sidebar.py
to the folder (see example). It needs to contain a methodshow()
, which displays all template-specific streamlit components in the sidebar (i.e. everything below Task) and returns a dictionary of user inputs. - Add a file
code-template.py.jinja
to the folder (see example). This Jinja2 template is used to generate the code. You can write normal…