Skip to content

masashi-hatano/pl-metric-learning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Releases

No releases published

Packages

No packages published

Languages