This repository belongs to the guide I wrote on Medium
- Clone the project:
git clone https://github.com/StefanieStoppel/pytorch-mlflow-optuna.git
. - Open a terminal and cd into your project directory.
You can either use Python's venv or Conda:
- Create the virtual environment using Python >= 3.7:
python3 -m venv ./venv
. - Activate the virtual environment:
source venv/bin/activate
. - Install all requirements:
pip install -r requirements.txt
- Create the conda environment and install all dependencies:
conda env create --file environment.yml
. - Activate the conda environment:
conda activate pytorch-mlflow-optuna
.
All subsequent commands assume you're in the context of a virtual environment / conda environment.
- Start the MLflow UI in one terminal window by typing
mlflow ui
and visit http://localhost:5000/ in your browser to view it. - In a new terminal start the jupyter server:
jupyter notebook
and visit http://localhost:8888/ in your browser. - Open the notebook called
mlflow-optuna-pytorch.ipynb
. - Execute all cells and watch the network being trained.
- The best set of hyperparameters & the corresponding trial number will be printed once the 5 trials are completed.
- You can check out the different experiment runs, their hyperparameters and loss metric plots in the MLflow UI.