Open nianniandoushabao opened 1 year ago
Hi!
get_model_passt
is an alias for the get_model
function in passt_hear21 see here.
So in general there should not be a difference between the two functions, they will both return the transformer model. The passt_hear21 repo contains only the models code (including the preprocessing) without the dependecies of saced and PyTorch Lightning.
if num_classes
is different then that of the pre-trained models, then the last MLP layer is initilizaed to random (according to the new num_classes`) and the model is ready to be fine-tuned on the new task, that is done in timm here
so both ways are the same. Off-course you can use all the other arguments here.
hear21passt.base.get_basic_model
will return a wrapper module that contains both the transformer and the preprocessing mel-spectrograms see here
Oh, thank you, thank you very much.
I'm sorry to bother you. I want to ask the difference between the two ways to get pre-training models. I don't know if I understand correctly The first is in the ''Getting a pre-trained model for fine tuning'' part. The code is
The second is in the ''Pre-trained models'' part.
I have two questions. Is it the first way to obtain the pre-trained model and only fine-tune the layers in transformer blocks related to num_classes? The other layers' weights will not changed? And Is it the second way to obtain the pre-trained model will load weights of all layers and train them again ? Or are the two ways the same?