Releases: KevinMusgrave/pytorch-metric-learning
Releases · KevinMusgrave/pytorch-metric-learning
v0.9.84
Testers
- BaseTester
- Removed
size_of_tsne
and addedvisualizer
andvisualizer_hook
to BaseTester. The visualizer needs to implement thefit
andtransform
functions. (In the next version, I'll allow fit_transform as well.) For example:
- Removed
# UMAP is the dimensionality reducer we will pass in as the visualizer
import umap
import umap.plot
# For plotting the embeddings
def visualizer_hook(umapper, umap_embeddings, labels, split_name, keyname):
logging.info("UMAP plot for the {} split and label set {}".format(split_name, keyname))
umap.plot.points(umapper, labels=labels, show_legend=False)
plt.show()
GlobalEmbeddingSpaceTester(visualizer=umap.UMAP(), visualizer_hook=visualizer_hook)
Utils
- AccuracyCalculator
- Added
include
to the init arguments. - Renamed
exclude_metrics
toexclude
. - Added the
requires_knn
method. - Added
check_primary_metrics
to AccuracyCalculator, which validates the metrics specified ininclude
andexclude
. By @wconnell
- Added
- HookContainer
- Check if
primary_metric
is intester.AccuracyCalculator
. By @wconnell
- Check if
- logging_presets
- Added
**kwargs
toget_hook_container
, so that, for example, you can doget_hook_container(record_keeper, primary_metric="AMI")
- Added
Other stuff
- Added an example Google Colab notebook which goes through the entire training/testing workflow.
v0.9.83
Losses
- Added CircleLoss, implemented by @AlenUbuntu
- Changes to ProxyAnchorLoss:
- Fixed bug that caused it to break when
normalize_embeddings=False
- Made it extend WeightRegularizerMixin
- Fixed bug that caused it to break when
- Fixed/improved application of
miner_weights
in ProxyAnchorLoss, NCALoss, and FastAPLoss
Utils
- Added AccuracyCalculator
- Changes to loss_and_miner_utils
- Made
convert_to_weights
return values between 0 and 1, where 1 represents the most frequently occuring sample. Before, it was scaling the probability by size of batch.
- Made
Other stuff
- Added a test for
convert_to_weights
v0.9.82
Losses
- Added ProxyAnchorLoss
Trainers
- BaseTrainer
- Made
iterations_per_epoch
optional. See the new documentation - Changed keys for
lr_schedulers
to allow for end of iteration, end of epoch, and plateau schedulers to all be used at the same time. - Fixed a key verification bug in BaseTrainer.
- Made
Utils
-
HookContainer
- Added
skip_eval_if_already_done
flag torun_tester_separately
. - Made
ignore_epoch
a tuple. - Added
save_custom_figures
flag. - Made records get saved before models.
- Added
-
common_functions
- Removed
pass_data_to_model
andautograd.Variable
usage.
- Removed
Other stuff
- Fixed bug where
__version__
was not accessible. - Added test for pair and triplet index computation