# divide-and-conquer **Repository Path**: zgpio/divide-and-conquer ## Basic Information - **Project Name**: divide-and-conquer - **Description**: No description available - **Primary Language**: Unknown - **License**: LGPL-3.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2019-12-02 - **Last Updated**: 2020-12-21 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Deep Metric Learning ## Requirements - Python >= 3.6.6 - SciPy = 1.2 - scikit-learn = 0.20 - PyTorch ([pytorch.org](http://pytorch.org)) = 1.0 - Faiss with GPU support ([Faiss](https://github.com/facebookresearch/faiss)) = 1.5 - Datasets - [CUB-200-2011](http://www.vision.caltech.edu/visipedia/CUB-200.html) - [In-Shop Clothes](http://mmlab.ie.cuhk.edu.hk/projects/DeepFashion/InShopRetrieval.html) - [Stanford Online Products](http://cvgl.stanford.edu/projects/lifted_struct/) - [Cars196](https://ai.stanford.edu/~jkrause/cars/car_dataset.html) ## Usage You can see how to set up the experiment through `python experiment.py --help`. ### choose dataset You can use the option `--dataset={dataset}` for the datasets. It should be `inshop`/`sop`/`cub`/`car`. ### example The following command will train the model with Margin loss on the In-Shop Clothes dataset for `200` epochs and a batch size of `100` while splitting the embedding layer with `8` clusters and finetuning the model from epoch `190` on. ```sh CUDA_VISIBLE_DEVICES=0,1,2,3 python experiment.py --dataset=inshop \ --dir=dev --exp=0 --random-seed=0 --nb-clusters=8 --nb-epochs=200 \ --sz-batch=100 --backend=faiss-gpu --embedding-lr=1e-5 --embedding-wd=1e-4 \ --backbone-lr=1e-5 --backbone-wd=1e-4 --finetune-epoch=190 --loss margin ``` ### browse result The model checkpoints and log files are saved in the selected log-directory specified by `--dir` option. You can print a summary of the results with `python browse_results `. ## License [LGPL](LICENSE) ## Reference - [Divide and Conquer the Embedding Space](https://github.com/CompVis/metric-learning-divide-and-conquer.git) - [Deep Metric Learning Baselines](https://github.com/Confusezius/Deep-Metric-Learning-Baselines)