cambridge-mlg / cnaps

Code for: "Fast and Flexible Multi-Task Classification Using Conditional Neural Adaptive Processes" and "TaskNorm: Rethinking Batch Normalization for Meta-Learning"
MIT License
159 stars 22 forks source link

Number of parameters in the adaptation module #6

Closed dvornikita closed 4 years ago

dvornikita commented 4 years ago

Dear authors,

First, I would like to thank you for such great work and clean implementation.

I am now working on a related project and I would like to compare our method to yours (CNAPS with AR) in terms of the total number of parameters used to perform adaptation. Precisely, I want to know the ratio between all adaptation parameters and all parameters of ResNet18. Do you have this number by any chance?

Thank you, Nikita

jfb54 commented 4 years ago

Nikita - Thanks for your kind words about CNAPs.

I just did the following calculation for the AR version of the model.

Total model parameters: 25355141 Total trainable parameters (i.e. the adaptation networks and set encoder, the feature extractor parameters are not trainable): 14183237 ResNet18 parameters = 25355141 - 14183237 = 11171904‬

Hope this helps.

dvornikita commented 4 years ago

That is exactly what I needed. Thank you very much!

All the best, Nikita