diff --git a/README.md b/README.md index b9acc52f..95fa9d08 100644 --- a/README.md +++ b/README.md @@ -38,15 +38,13 @@ ## News +**December 10**: v0.9.95 includes a new tuple miner, [BatchEasyHardMiner](https://kevinmusgrave.github.io/pytorch-metric-learning/miners/#batcheasyhardminer). [Release notes](https://github.com/KevinMusgrave/pytorch-metric-learning/releases/tag/v0.9.95) + **November 6**: v0.9.94 has minor bug fixes and improvements. [Release notes](https://github.com/KevinMusgrave/pytorch-metric-learning/releases/tag/v0.9.94) **October 6**: v0.9.93 is a small update: - ```get_random_triplet_indices``` has been optimized, so if you were using DistanceWeightedMiner, or if you ever set the ```triplets_per_anchor``` argument to something other than ```"all"``` anywhere in your code, it should run a lot faster now. -**September 14**: v0.9.92 comes with new features ([release notes](https://github.com/KevinMusgrave/pytorch-metric-learning/releases/tag/v0.9.92)). The main highlights are: -* utils.distributed for multiprocessing. -* Improvements to CrossBatchMemory which make it usable in MoCo-style self-supervised training. Check out the [MoCo on CIFAR10](https://github.com/KevinMusgrave/pytorch-metric-learning/tree/master/examples#simple-examples) notebook to see how it works. - ## Documentation - [**View the documentation here**](https://kevinmusgrave.github.io/pytorch-metric-learning/) - [**View the installation instructions here**](https://github.com/KevinMusgrave/pytorch-metric-learning#installation) @@ -360,11 +358,12 @@ guide. Proceed to `pip install -e .[dev]` afterwards. Thanks to the contributors who made pull requests! #### Algorithm implementations + useful features -- [AlenUbuntu](https://github.com/AlenUbuntu) - - [CircleLoss](https://kevinmusgrave.github.io/pytorch-metric-learning/losses/#circleloss) - [marijnl](https://github.com/marijnl) + - [BatchEasyHardMiner](https://kevinmusgrave.github.io/pytorch-metric-learning/miners/#batcheasyhardminer) - [TwoStreamMetricLoss](https://kevinmusgrave.github.io/pytorch-metric-learning/trainers/#twostreammetricloss) - [GlobalTwoStreamEmbeddingSpaceTester](https://kevinmusgrave.github.io/pytorch-metric-learning/testers/#globaltwostreamembeddingspacetester) +- [AlenUbuntu](https://github.com/AlenUbuntu) + - [CircleLoss](https://kevinmusgrave.github.io/pytorch-metric-learning/losses/#circleloss) - [btseytlin](https://github.com/btseytlin) - ```get_nearest_neighbors``` in [InferenceModel](https://kevinmusgrave.github.io/pytorch-metric-learning/inference_models) - [JohnGiorgi](https://github.com/JohnGiorgi) @@ -381,6 +380,8 @@ Thanks to the contributors who made pull requests! #### General improvements and bug fixes - [wconnell](https://github.com/wconnell) - [marijnl](https://github.com/marijnl) +- [thinline72](https://github.com/thinline72) +- [tpanum](https://github.com/tpanum) - [fralik](https://github.com/fralik) - [JoOkuma](https://github.com/JoOkuma) diff --git a/setup.py b/setup.py index cd57fa40..8481a76c 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ setuptools.setup( name="pytorch-metric-learning", - version="0.9.95.dev2", + version="0.9.95", author="Kevin Musgrave", author_email="tkm45@cornell.edu", description="The easiest way to use deep metric learning in your application. Modular, flexible, and extensible. Written in PyTorch.", diff --git a/src/pytorch_metric_learning/__init__.py b/src/pytorch_metric_learning/__init__.py index 024942b1..84cdbada 100644 --- a/src/pytorch_metric_learning/__init__.py +++ b/src/pytorch_metric_learning/__init__.py @@ -1 +1 @@ -__version__ = "0.9.95.dev2" +__version__ = "0.9.95" diff --git a/src/pytorch_metric_learning/miners/batch_easy_hard_miner.py b/src/pytorch_metric_learning/miners/batch_easy_hard_miner.py index 13b58252..757acc28 100644 --- a/src/pytorch_metric_learning/miners/batch_easy_hard_miner.py +++ b/src/pytorch_metric_learning/miners/batch_easy_hard_miner.py @@ -194,4 +194,4 @@ def set_stats(self, positive_dists, negative_dists): def get_func_for_stats(self, min_if_inverted): if min_if_inverted: return torch.min if self.distance.is_inverted else torch.max - return torch.max if self.distance.is_inverted else torch.min \ No newline at end of file + return torch.max if self.distance.is_inverted else torch.min diff --git a/tests/miners/test_batch_easy_hard_miner.py b/tests/miners/test_batch_easy_hard_miner.py index 19603d72..2a1225fb 100644 --- a/tests/miners/test_batch_easy_hard_miner.py +++ b/tests/miners/test_batch_easy_hard_miner.py @@ -32,9 +32,7 @@ def setUpClass(self): "easiest_neg_pair": 3, "hardest_neg_pair": 2, "expected": { - "correct_a": torch.LongTensor([0, 7, 8]).to( - TEST_DEVICE - ), + "correct_a": torch.LongTensor([0, 7, 8]).to(TEST_DEVICE), "correct_p": [ torch.LongTensor([1, 6, 6]).to(TEST_DEVICE), torch.LongTensor([1, 8, 6]).to(TEST_DEVICE), @@ -58,12 +56,8 @@ def setUpClass(self): "easiest_neg_pair": 7, "hardest_neg_pair": 4, "expected": { - "correct_a": torch.LongTensor([0, 1, 6, 7, 8]).to( - TEST_DEVICE - ), - "correct_p": [ - torch.LongTensor([4, 4, 2, 2, 2]).to(TEST_DEVICE) - ], + "correct_a": torch.LongTensor([0, 1, 6, 7, 8]).to(TEST_DEVICE), + "correct_p": [torch.LongTensor([4, 4, 2, 2, 2]).to(TEST_DEVICE)], "correct_n": [ torch.LongTensor([5, 5, 1, 1, 1]).to(TEST_DEVICE), ], @@ -319,15 +313,11 @@ def test_strategy_assertion(self): ) self.assertRaises( ValueError, - lambda: BatchEasyHardMiner( - pos_strategy="all", neg_strategy="semihard" - ), + lambda: BatchEasyHardMiner(pos_strategy="all", neg_strategy="semihard"), ) self.assertRaises( ValueError, - lambda: BatchEasyHardMiner( - pos_strategy="semihard", neg_strategy="all" - ), + lambda: BatchEasyHardMiner(pos_strategy="semihard", neg_strategy="all"), ) def helper(self, a1, p, a2, n, gt): @@ -348,4 +338,4 @@ def tearDown(self): if __name__ == "__main__": - unittest.main() \ No newline at end of file + unittest.main() diff --git a/tests/miners/test_batch_hard_miner.py b/tests/miners/test_batch_hard_miner.py index 01b30156..920b0ea4 100644 --- a/tests/miners/test_batch_hard_miner.py +++ b/tests/miners/test_batch_hard_miner.py @@ -134,4 +134,4 @@ def test_empty_output(self): self.assertTrue(len(n) == 0) self.assertTrue(miner.hardest_pos_pair == 0) self.assertTrue(miner.hardest_neg_pair == 0) - self.assertTrue(miner.hardest_triplet == 0) \ No newline at end of file + self.assertTrue(miner.hardest_triplet == 0)