Vandermode / TFPnP

Tuning-free Plug-and-Play Proximal Algorithm for Inverse Imaging Problems (ICML 2020 Award Paper & JMLR 2022)
https://arxiv.org/abs/2002.09611
88 stars 18 forks source link

How to calculate the number of parameters in the network #7

Closed syf0518 closed 1 year ago

syf0518 commented 1 year ago

Thanks for your contribution, it is wonderful.I wanted to use your code as a comparison algorithm for CT reconstruction, so I want to calculate the number of parameters in TFPnP.I tried to calculate it by trainer.parameters() but failed.So I want to know calculate the number of parameters in TFPnP.I would appreciate it if you could tell me.

Vandermode commented 1 year ago

Hello, TFPnP consists of two networks at inference, one is the denoising network used as prior, another is the policy network for scheduling the optimization parameters. So finding the UNet (denoiser) and the ResNet (policy network) in the codebase, and summing their parameters together should serve your purpose

syf0518 commented 1 year ago

Thank you for your reply.I calculated the number of parameters of UNet and ResNet respectively, and the total number of parameters was 22.95M.