Skip to content

Latest commit

 

History

History
53 lines (41 loc) · 1.71 KB

File metadata and controls

53 lines (41 loc) · 1.71 KB

Pytorch-Lightning Metric Learning

PyTorch Lightning Config: Hydra

In this repository, we implemented metric learning for cifar-10 classification by using hydra+pytorch-lightning.

cifar-10 classification with ResNet+ArcFace

configs

You can manage hyparams for deep learning thanks to hydra!
You need to change "data_dir", which is a directory for downloaded cifar-10 dataset, if this directory contains nothing, dataset will automatically be downloaded there.

data_module

Here, you can change dataset and data loader behaviour.
Normally, you don't need to change anything here.

model

lit_MetricTrainer is the most important part of the implementation as it defines each step of train,val, and test.

How to run the code

First, you need to create the virtural environment.

python -m venv pl-metric

And then, activate the virtural environment.
(for Windows)

./pl-metric/Scripts/activate

(for Mac or Linux)

source pl-metric/bin/activate

Second, you need to install libraries to execute the code.

pip -r install requirements.txt

Finally, you are ready to run the code!

python lit_main.py