资源算法DarkRank

DarkRank

2019-09-19 | |  41 |   0 |   0

Introduction

This is the repo for our AAAI-18 paper "DarkRank: Accelerating Deep Metric Learning via Cross Sample Similarities" If you found this useful, please cite our paper.

Preparing MXNet

  1. make a working directory

mkdir darkrank
  1. clone the lastest stable mxnet

git clone --recursive https://github.com/apache/incubator-mxnet.git mxnet-darkrank
  1. clone LSoftmax from luoyetx

git clone https://github.com/luoyetx/mx-lsoftmax.git lsoftmax
  1. copy LSoftmax to mxnet

cp lsoftmax/operator/lsoftmax-inl.h lsoftmax/operator/lsoftmax.cc lsoftmax/operator/lsoftmax.cu mxnet-darkrank/src/operator/
  1. install dependency and make mxnet

sudo apt-get update
sudo apt-get install -y build-essential git
sudo apt-get install -y libopenblas-dev liblapack-dev
sudo apt-get install -y libopencv-dev
cd mxnet-darkrank
make -j $(nproc) USE_OPENCV=1 USE_BLAS=openblas USE_CUDA=1 USE_CUDA_PATH=/usr/local/cuda USE_CUDNN=1
  1. install mxnet

pip install -e mxnet-darkrank/python
  1. clone darkrank

Preparing Data

  1. Download Market-1501-v15.09.15.zip from http://www.liangzheng.org/Project/project_reid.html

  2. unzip Market-1501-v15.09.15.zip into data directory

  3. run generate_rec.sh

Training

  1. download imagenet pretrain

wget http://data.dmlc.ml/models/imagenet/inception-bn/Inception-BN-0126.params -O models/inception-bn-0126.params
wget http://data.dmlc.ml/models/imagenet/nin/nin-0000.params -O models/nin-0000.params
  1. teacher baseline

python reid.py --mode inception-cls-LMNN-Market1501 --even-iter --data-dir data/Market-list --num-examples 13314 --num-id 751 --lr 0.01 --num-epochs 100 --train-file train --student-network inception-bn --student-params-prefix inception-bn --student-params-epoch 126 --gpus 0
  1. student baseline

python reid.py --mode nin-cls-LMNN-Market1501 --even-iter --data-dir data/Market-list --num-examples 13314 --num-id 751 --lr 0.01 --num-epochs 100 --train-file train --student-network nin-head-bn --student-params-prefix nin --student-params-epoch 0 --gpus 0
  1. darkrank

python reid.py --mode distill-listnet-Market1501 --even-iter --data-dir data/Market-list --num-examples 13314 --num-id 751 --num-epochs 100 --train-file train --student-network nin-head-bn --student-params-prefix nin --student-params-epoch 0 --teacher-network inception-bn --teacher-params-prefix inception-cls-LMNN-Market1501-1524036667 --teacher-params-epoch 100 --lr 5e-4 --score-power 2.0 --embedding-l2-norm 3.5 --list-length 4 --loss-weight-listnet 16.0 --gpus 0

Testing

extract 1024d l2_norm_output and do standard test


上一篇:ko_en_NMT

下一篇:siamese

用户评价
全部评价

热门资源

  • seetafaceJNI

    项目介绍 基于中科院seetaface2进行封装的JAVA...

  • spark-corenlp

    This package wraps Stanford CoreNLP annotators ...

  • Keras-ResNeXt

    Keras ResNeXt Implementation of ResNeXt models...

  • capsnet-with-caps...

    CapsNet with capsule-wise convolution Project ...

  • inferno-boilerplate

    This is a very basic boilerplate example for pe...