Skip to content

cdb342/IJCAI-2022-ZLA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zero-Shot Logit Adjustment

arXiv Pytorch 1.8.1 License: MIT

This project contains the pytorch implemention for Zero-Shot Logit Adjustment.

Dependencies

  • Python 3.7
  • Pytorch = 1.0.1

Prerequisites

  • Dataset: please download the dataset, and change --dataroot to your local path.
  • Semantic: The semantics for AWA2, SUN, and APY are available in the dataset. please download the 1024-D CUB semantic and save it to the data path.

Train and Test

Please run the following commands to test on different datasets:

  • python ./WGAN+ZLAP.py --dataset AWA2 --attSize 85 --nz 85 --syn_num 10 --ratio 1000
  • python ./WGAN+ZLAP.py --dataset SUN --attSize 102 --nz 102 --syn_num 10 --ratio 60
  • python ./WGAN+ZLAP.py --dataset APY --attSize 64 --nz 64 --syn_num 10 --ratio 300
  • python ./WGAN+ZLAP.py --dataset CUB --attSize 1024 --nz 1024 --syn_num 10 --ratio 30 --class_embedding sent

The meaning of these args is

  • --dataset: datasets, e.g: SUN.
  • --attSize: size of semantic descriptors.
  • --nz: size of the Gaussian noise.
  • --syn_num: synthetic number for each unseen class.
  • --reatio: hyperparameter to control the seen-unseen prior (see Sec. 4.4 of the paper)

Results

We test our method in WGAN and CE-GZSL, and here are the results.

Method AWA2 CUB SUN APY
AS AU AH AS AU AH AS AU AH AS AU AH
f-CLSWGAN 57.7 71.0 63.7 59.4 63.3 61.3 46.2 35.2 40.0 32.5 57.2 41.5
ZLAPWGAN 65.4 82.2 72.8 73.0 64.8 68.7 50.1 38.0 43.2 40.2 53.8 46.0
CE-GZSL 65.3 75.0 69.9 66.9 65.9 66.4 52.4 34.3 41.5 28.3 65.8 39.6
ZLAP+CE-GZSL 64.8 80.9 72.0 71.2 66.2 68.6 50.9 35.7 42.0 38.3 60.9 47.0

Citation

If you recognize our work, please cite:

@inproceedings{ijcai2022-114,
    title     = {Zero-Shot Logit Adjustment},
    author    = {Chen, Dubing and Shen, Yuming and Zhang, Haofeng and Torr, Philip H.S.},
    booktitle = {Proceedings of the Thirty-First International Joint Conference on Artificial Intelligence, {IJCAI-22}},
    publisher = {International Joint Conferences on Artificial Intelligence Organization},
    editor    = {Lud De Raedt},
    pages     = {813--819},
    year      = {2022},
    month     = {7},
    note      = {Main Track}
    doi       = {10.24963/ijcai.2022/114},
    url       = {https://doi.org/10.24963/ijcai.2022/114},
    }

Acknowledgment

We acknowledge the prior works f-CLSWGAN and CE-GZSL for their contributions to our work.

About

Codes for IJCAI'2022 Paper: Zero-Shot Logit Adjustment

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages