Skip to content

Releases: KevinMusgrave/pytorch-metric-learning

v0.9.84

18 Apr 04:26
7473ce1
Compare
Choose a tag to compare

Testers

  • BaseTester
    • Removed size_of_tsne and added visualizer and visualizer_hook to BaseTester. The visualizer needs to implement the fit and transform functions. (In the next version, I'll allow fit_transform as well.) For example:
# 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 to exclude.
    • Added the requires_knn method.
    • Added check_primary_metrics to AccuracyCalculator, which validates the metrics specified in include and exclude. By @wconnell
  • HookContainer
    • Check if primary_metric is in tester.AccuracyCalculator. By @wconnell
  • logging_presets
    • Added **kwargs to get_hook_container, so that, for example, you can do get_hook_container(record_keeper, primary_metric="AMI")

Other stuff

v0.9.83

13 Apr 22:46
Compare
Choose a tag to compare

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/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.

Other stuff

  • Added a test for convert_to_weights

v0.9.82

11 Apr 09:02
Compare
Choose a tag to compare

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.

Utils

  • HookContainer

    • Added skip_eval_if_already_done flag to run_tester_separately.
    • Made ignore_epoch a tuple.
    • Added save_custom_figures flag.
    • Made records get saved before models.
  • common_functions

    • Removed pass_data_to_model and autograd.Variable usage.

Other stuff

  • Fixed bug where __version__ was not accessible.
  • Added test for pair and triplet index computation