Code Monkey home page Code Monkey logo

tbh's Introduction

Auto-Encoding Twin-Bottleneck Hashing

This is the main repository for our CVPR2020 work:

which is an unsupervised deep hashing work.

We as well provide the code of our supervised deep hashing work on ICCV2019 Workshops here:

Requirements

python=3.6
tensorflow>=2.0 (tested with tf2.1)
scipy
sklearn

From this time on, I move to tensorflow2, though it is shitty and inhumane compared with tf1.
Note that this is a re-implemented repository of our original work. If you find any difficulty in reproducing the result, please refer to the old, uncleaned and ugly version.

Data

This work supports tf.data.TFRecordDataset as the data feed. I provide the following data as training examples:

If one needs to run experiments on other datasets, please refer to util/data/make_data.py to build TFRecords.

Please organize the data folder as follows:

data
  |-cifar10 (or other dataset names)
    |-train.tfrecords
    |-test.tfrecords

Train Auto-Encoding Twin-Bottleneck Hashing

fig

Simply run

python ./run_tbh.py

to train the model.

The resulting checkpoints will be placed in ./result/set_name/model/date_of_today with tensorboard events in ./result/set_name/log/date_of_today.

The mAP results shown on tensorboard are just for illustration (the actual score would be slightly higher than the ones on tensorboard), since I do not update all dataset codes upon testing. Please kindly evaluate the results by saving the proceeded codes after training.

Train Embarrassingly Simple Binary Representation Learning

Simply run

python ./run_jmlh.py

to train the model.

The resulting checkpoints will be placed in ./result/set_name_JMLH/model/date_of_today with tensorboard events in ./result/set_name_JMLH/log/date_of_today.

The mAP results shown on tensorboard are just for illustration (the actual score would be slightly higher than the ones on tensorboard), since I do not update all dataset codes upon testing. Please kindly evaluate the results by saving the proceeded codes after training.

tbh's People

Contributors

ymcidence 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  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  avatar  avatar

tbh's Issues

Cifar-10 dataset

Hi,

Thanks a lot for sharing the nice code.

I am trying to reproduce the results. I notice that the provided Cifar-10 data has 4096 dimensions for each image, however the original Cifar-10 dataset downloaded here contains 3072 (32 * 32 * 3) dimensions per image. So I am wondering is there some additional steps applied on the original dataset in order to have 4096 dimensions? Is it possible to share such steps or maybe the ideas of such conversion?

Best wishes!

twin_bottleneck.py

hello,Thank you for your excellent work!
return tf.pow(1 - normalized_dist, 1.4)
Excuse me, why should the formula for calculating the adjacency matrix be calculated this way? Does 1.4 have a special meaning? Thank you very much.

Regarding dataset and labels

Since this approach is unsupervised I was a bit confused as to why do we need labels to make tfrecords file in make_data.py.
set_processor.py - line 7, 12, 19

I have an unlabelled dataset that I want to train on this model and I don't think it would be possible without labels

About WAE Adversarial Block Layer

The model layers are shown in the following:

    self.encoder = encodec.Encoder(middle_dim, bbn_dim, cbn_dim)
    self.decoder = encodec.Decoder(middle_dim, self.feat_dim)
    self.tbn = twin_bottleneck.TwinBottleneck(bbn_dim, cbn_dim)
    self.dis_1 = tf.keras.layers.Dense(1, activation='sigmoid')
    self.dis_2 = tf.keras.layers.Dense(1, activation='sigmoid')

The WAE Adversarial Block Layer: cbn->1024->1 & bbn->1024->1
Maybe you lack a FC layer with 1024 nodes in tbh.py?

dataset read

the file'dataset.py' in util.data, in the main function, data = Dataset(set_name='cifar10', batch_size=256) it = iter(data.test_data) print(it) x = next(it) print(x) , it can error, the error is 'UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd5 in position 103: invalid continuation byte', can you provide the origin file 'cifar10_fc7_train.mat' and 'cifar10_fc7_test.mat'

Preprocessing program

Hi!
Thanks for your excellent works!

I just wonder that could you provide the preprocessing program? Since I cannot re-implement the MAP score at MSCOCO and NUS-WIDE.

Thanks a lot!

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.