SoftTeacher icon indicating copy to clipboard operation
SoftTeacher copied to clipboard

Query regarding the code

Open purbayankar opened this issue 4 years ago • 5 comments

Can you please tell me where in the code teacher model is being updated by the EMA of the student model?

purbayankar avatar Dec 14 '21 05:12 purbayankar

See here https://github.com/microsoft/SoftTeacher/blob/bef9a256e5c920723280146fc66b82629b3ee9d4/ssod/utils/hooks/mean_teacher.py#L60

MendelXu avatar Dec 14 '21 05:12 MendelXu

@MendelXu thank you very much for the prompt reply. I had another question. Can you please tell me where in the code should I make changes to apply strong augmentation to the labelled data and pass it through the student model?

purbayankar avatar Dec 14 '21 06:12 purbayankar

You don't have to change to code, just change the config file. Changing the pipeline for labeled data and wrapping it with MultiBranch, in which one branch is a weak augmentation pipeline and another one is a strong augmentation pipeline. (Similar to the pipeline of unlabeled data and make sure that assign the same tag sup to both branch with ExtraAttrs.

MendelXu avatar Dec 14 '21 08:12 MendelXu

Do I need to apply any transformation matrix on the output of the student model to keep the output aligned with the strong augmented input data? What part of the code should I need to change then?

purbayankar avatar Dec 14 '21 09:12 purbayankar

If I understand your situation correctly, you just want to compute loss on labeled data which is augmented with both weak and strong augmentation, right? Then you don't have to change anything in the model as the ground truth of an augmented image is always aligned with its prediction ( The alignment has been done in the augmentation pipeline).

MendelXu avatar Dec 14 '21 09:12 MendelXu