Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

feat: options for miner and optimizer #517

Merged
merged 4 commits into from
Aug 30, 2022

Conversation

guenthermi
Copy link
Member

@guenthermi guenthermi commented Aug 30, 2022

Adds support for miner and optimizer options and documentation about optimizers and miners.

Addresses #299 and #300


  • This PR references an open issue
  • I have added a line about this change to CHANGELOG

@guenthermi guenthermi requested review from jupyterjazz, gmastrapas and bwanglzu and removed request for jupyterjazz August 30, 2022 07:20
@guenthermi guenthermi changed the title Feat options for miner and optimizer feat: options for miner and optimizer Aug 30, 2022
@@ -59,6 +62,7 @@ run = finetuner.fit(
model_options={}, # additional options to pass to the model constructor
loss='TripletMarginLoss', # Use CLIPLoss for CLIP fine-tuning.
miner='TripletMarginMiner',
miner_options={'margin': 0.2}, # additional options for the miner constructor
Copy link
Member

Choose a reason for hiding this comment

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

can you add optimizer options to here?

To filter the instances in a batch that are used to calculate the loss, you can use miners.
Finetuner allows you to use miners provided by the [Pytorch Metric Learning](https://kevinmusgrave.github.io/pytorch-metric-learning) framework.
To select a specific miner, you can pass its name to the fit function, e.g., `AngularMiner`, `TripletMarginMiner`, ...
Copy link
Member

Choose a reason for hiding this comment

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

you can list all miners to the developer reference field, all documented in docstring

Copy link
Member Author

Choose a reason for hiding this comment

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

First I had this, but it looked ugly, because the names are so long and therefore, the list is very long.

Copy link
Member

@bwanglzu bwanglzu left a comment

Choose a reason for hiding this comment

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

LGTM!

@github-actions
Copy link

📝 Docs are deployed on https://ft-feat-options-for-miner-and-optimizer--jina-docs.netlify.app 🎉

Copy link
Member

@gmastrapas gmastrapas left a comment

Choose a reason for hiding this comment

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

Looks good!

@guenthermi guenthermi merged commit ae3dae8 into main Aug 30, 2022
@guenthermi guenthermi deleted the feat-options-for-miner-and-optimizer branch August 30, 2022 09:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants