Closed yjyoo3312 closed 1 year ago
Hi,
Your understanding is correct (only the autoencoder part is trained). However, the two code versions are actually equivalent. This is because the BERT backbone parameters are frozen (requires_grad
set to False as shown below) and will not be updated by the optimizer anyways.
Thanks, Yu
Ah, I missed the line 59-60. Thank you for the fast reply!
https://github.com/yumeng5/TopClus/blob/01e22fb73262bc45d361ec9165bdadbd929ac9a5/src/trainer.py#L79
Thank you for sharing the code. As far as I understand, this stage only trains autoencoder parameters, so It seems that
''' Adam(filter(lambda p: p.requires_grad, model.parameters()), lr=self.args.lr) ''' should be converted to
''' Adam(filter(lambda p: p.requires_grad, model.ae.parameters()), lr=self.args.lr). '''
If it is not, please let me know.