Coder Social home page Coder Social logo

dsdh_pytorch's Introduction

Deep Supervised Discrete Hashing

REQUIREMENTS

pip install -r requirements.txt

  1. pytorch
  2. loguru

DATASETS

  1. CIFAR-10
  2. NUS-WIDE Password: uhr3
  3. Imagenet100 Password: ynwf

USAGE

usage: run.py [-h] [--dataset DATASET] [--root ROOT] [--batch-size BATCH_SIZE]
              [--arch ARCH] [--lr LR] [--code-length CODE_LENGTH]
              [--max-iter MAX_ITER] [--num-query NUM_QUERY]
              [--num-train NUM_TRAIN] [--num-workers NUM_WORKERS]
              [--topk TOPK] [--gpu GPU] [--mu MU] [--nu NU] [--eta ETA]
              [--evaluate-interval EVALUATE_INTERVAL]

DSDH_PyTorch

optional arguments:
  -h, --help            show this help message and exit
  --dataset DATASET     Dataset name.
  --root ROOT           Path of dataset
  --batch-size BATCH_SIZE
                        Batch size.(default: 128)
  --arch ARCH           CNN model name.(default: alexnet)
  --lr LR               Learning rate.(default: 1e-5)
  --code-length CODE_LENGTH
                        Binary hash code length.(default: 12,24,32,48)
  --max-iter MAX_ITER   Number of iterations.(default: 150)
  --num-query NUM_QUERY
                        Number of query data points.(default: 1000)
  --num-train NUM_TRAIN
                        Number of training data points.(default: 5000)
  --num-workers NUM_WORKERS
                        Number of loading data threads.(default: 6)
  --topk TOPK           Calculate map of top k.(default: all)
  --gpu GPU             Using gpu.(default: False)
  --mu MU               Hyper-parameter.(default: 1e-2)
  --nu NU               Hyper-parameter.(default: 1)
  --eta ETA             Hyper-parameter.(default: 1e-2)
  --evaluate-interval EVALUATE_INTERVAL
                        Evaluation interval.(default: 10)

EXPERIMENTS

CNN model: Alexnet. Compute mean average precision(MAP).

cifar10: 1000 query images, 5000 training images.

nus-wide-tc21: 21 classes, 2100 query images, 10500 training images.

Imagenet-tc100: 100 classes, 5000 query images, 10000 training images. mu=5, nu=5, eta=2.

bits 12 16 24 32 48 64 128
cifar10@ALL 0.6994 0.7052 0.7204 0.7267 0.7345 0.7466 0.7493
nus-wide-tc21@5000 0.8052 0.8155 0.8317 0.8332 0.8437 0.8478 0.8544
imagenet-tc100@1000 0.1622 0.1793 0.2356 0.2808 0.3350 0.3753 0.4274

dsdh_pytorch's People

Contributors

treezzz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dsdh_pytorch's Issues

关于nuswide数据集的小问题~

打扰一下,新手对于数据集的使用还不大懂~ 请问nuswide数据集下载了之后是里面5个4g的文件都要用到吗?还是只用到了那个1.86G的zip,解压用这个就好呢?您分享的nus-wide-21是论文里常用的,只包含21类的nus-wide的子数据集吗?

Do you have the trained models available?

Hi! I'd like to try the models as is on a dataset, do you have the pretrained Pytorch models available? I'd love to try it without having to train my own on ImageNet. Thanks!

RMSprop

树哥你好,我把网络换了resnet50,发现还真的只有RMSprop的结果能正常一点点,Adam和SGD好像没法正常更新。Any insight on this?仅是讨论哈哈,不是Issue。

multi gpus training

Environment: pytorch==1.1.0 torchvision==0.3.0 cudatoolkit=9.0
Problem:
I added two lines:
model = nn.DataParalle(model)
model.to(device) after model = AlexNet(code_length) in alexnet.py, but I found it can not speed up the training, can you help me?

NUSWIDE数据集问题

请问下NUSWIDE数据集下,这两行的写法是不是有误?正确的写法应该是:

query_index = perm_index[:num_query]
train_index = perm_index[num_query:num_query+num_train]

query_index = perm_index[:num_query]
train_index = perm_index[:num_train]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.