microsoft / nni

An open source AutoML toolkit for automate machine learning lifecycle, including feature engineering, neural architecture search, model compression and hyper-parameter tuning.
https://nni.readthedocs.io
MIT License
13.95k stars 1.81k forks source link

Can model compression be used for GAN? #4048

Closed yy2016417 closed 2 years ago

yy2016417 commented 3 years ago

Thank you for a really great job! For GAN there are generator and discriminator.I would like to ask if it is possible to use NNI for model compression for this group of networks

xiaowu0162 commented 3 years ago

Hi @yy2016417 , Yes. Since most generative adversarial networks use Linear and Conv2d as their basic building blocks, you can apply NNI pruning and quantization tools to compress them. You can refer to here for examples of how to specify a config_list and use the tools provided by NNI. Although we don't have an example for compressing GANs, the general process should be very similar. As a side remark, I think only compressing the generator should be enough for most cases.

yy2016417 commented 3 years ago

Hi @yy2016417 , Yes. Since most generative adversarial networks use Linear and Conv2d as their basic building blocks, you can apply NNI pruning and quantization tools to compress them. You can refer to here for examples of how to specify a config_list and use the tools provided by NNI. Although we don't have an example for compressing GANs, the general process should be very similar. As a side remark, I think only compressing the generator should be enough for most cases.

Thanks for your help !