Skip to content

Commit

Permalink
v0.9.95
Browse files Browse the repository at this point in the history
  • Loading branch information
TakeshiMusgrave committed Dec 11, 2020
1 parent cdf3e72 commit f14a850
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 26 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

setuptools.setup(
name="pytorch-metric-learning",
version="0.9.95.dev2",
version="0.9.95",
author="Kevin Musgrave",
author_email="[email protected]",
description="The easiest way to use deep metric learning in your application. Modular, flexible, and extensible. Written in PyTorch.",
Expand Down
2 changes: 1 addition & 1 deletion src/pytorch_metric_learning/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.9.95.dev2"
__version__ = "0.9.95"
Original file line number Diff line number Diff line change
Expand Up @@ -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
return torch.max if self.distance.is_inverted else torch.min
22 changes: 6 additions & 16 deletions tests/miners/test_batch_easy_hard_miner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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),
],
Expand Down Expand Up @@ -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):
Expand All @@ -348,4 +338,4 @@ def tearDown(self):


if __name__ == "__main__":
unittest.main()
unittest.main()
2 changes: 1 addition & 1 deletion tests/miners/test_batch_hard_miner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
self.assertTrue(miner.hardest_triplet == 0)

0 comments on commit f14a850

Please sign in to comment.