Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Create examples #8

Merged
merged 7 commits into from
Jan 19, 2022
Merged

[WIP] Create examples #8

merged 7 commits into from
Jan 19, 2022

Conversation

monatis
Copy link
Contributor

@monatis monatis commented Jan 16, 2022

We can also create some basic documentation based on these examples. It has some bugs now --I'll check it out.

@monatis
Copy link
Contributor Author

monatis commented Jan 16, 2022

ArcFace loss has a learnable parameter, but it needs to know labels to calculate the loss. So I implemented it as a subclass of GroupLoss, and it should be used with EmptyHead as in train_cifar100.py.

Comment on lines +30 to +31
self.mean = [0.4914, 0.4822, 0.4465]
self.std = [0.2023, 0.1994, 0.2010]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add a link to the source of this numbers?

@generall
Copy link
Member

That is a good example for demonstrating ArcFaceLoss, but definitely not the first example a new user should see.

First of all, if I understood right, it is not a fine-tuning, but training of the model from scratch, right?
Secondly, it does not show anything related to model management - saving checkpoints, monitoring metrics, e.t.c.

I guess it is Ok to keep it as is for ArcFace example - in my mind each example should demonstrate only a single feature on top of minimal functionality. But we would need to have another example with very basic dataset and loss, but with proper model management.

@monatis
Copy link
Contributor Author

monatis commented Jan 18, 2022

definitely not the first example a new user should see.

Agree. An example with Contrastive Loss or Triplet Loss (not implemented yet) would work better as a starter.

but training of the model from scratch, right?

It's fine-tuning of a pretrained model from torchvision, but ArcFace can also be used for cold starts (i.e. pretraining from scratch).

But we would need to have another example with very basic dataset and loss, but with proper model management.

Yes I'll look into a proper dataset for it. And this example was also for me, well, to better understand the inner working of the library :)

I'll also write a short and step-by-step guide for readme like the following, with each item proceeded by a short code snippet:

  1. Subclass quaterion_models.encoder.Encoder, and implement this and that.
  2. Subclass quaterion.TrainableModel, and implement this hook and the other.
  3. ...

@monatis monatis merged commit 91d89d8 into master Jan 19, 2022
@monatis monatis mentioned this pull request Jan 19, 2022
@generall generall deleted the examples branch June 10, 2022 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants