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

Second Question #4

Closed linnabrown closed 4 years ago

linnabrown commented 4 years ago

https://github.com/cambridge-mlg/cnaps/blob/5a11dc0c450b0b0728de98eb64a0d1bc83035a2e/src/model.py#L108-L110

Why don't you utilize these params train_features and train_labels in your function _get_classifier_params ?

jfb54 commented 4 years ago

Thanks for pointing this out. At some point during development of the code, we refactored the functionality of _get_classifier_params(self, train_features, train_labels) into two methods (a combination of _build_class_reps(self, context_features, context_labels) and _get_classifier_params) and neglected to realize that _get_classifier_params no longer needed any arguments as if uses the class member variable self.class_representations instead. There is no bug here, just a bit of sloppy refactoring. Note that train_features is the same as context_features and train_labels is the same as context_labels. At some point we changed the names in the code to align with those in the paper and missed these.

linnabrown commented 4 years ago

Thank you so much for your quick and patient reply. This is very helpful!

jfb54 commented 4 years ago

The code to address the issue has now been pushed.