Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 9803dc3

Browse files
0.14 (#172)
* Better sampler (#160) * working verison ish * faster sampler * Remove quickdraw notebooks. Co-authored-by: Owen Vallis <ovallis@google.com> * * Add get_slice to SingleShotMemorySampler * Make get_examples() -> _get_examples() * Update doc strings to refer to classes_per_batch and examples_per_class_per_batch * Update notebook to also use examples_per_class * Update Return types of _get_examples() and generate_batch() to use FloatTensor and IntTensor * Set version to 0.14 * Run workflow on push for master only and on pull_request for all branches. * Add create_index method to enable setting an index outside of the compile call. (#164) fix #163 * * Add sampler_io_cookbook notebook * Fix get_slice in tfds sampler * other small sampler fixes * Remove randomflip from mnist augmentation in sampler cookbook. * Add link to sampler notebook in examples readme. * * Remove tf.gather from memory_samplers._get_examples(). Replace with faster for loop over lists and convert to np.array * Improve docstring coverage * Basic formatting using yamf * Reorder top level imports in __init__ * Update batch info when initializing sampler to better reflect the initial batch size and number of augmenters. * kaggle first * Raise errors if users try to evaluate over an empty index or pass an … (#169) * Raise errors if users try to evaluate over an empty index or pass an empty set of lookupd to the evaluators. * Add hints to index Exceptions. * Make batch size msg clearer. * MultiSampler now samples without replacement unless the class size is < num_examples_per_class. In that case, we warn the user and then sample with replacement. The warning will only be printed once per class. Also fixed a mypy error in the img_augments.py module. * Update SimilarityModel.compile() arg order to be consistent with the Keras Model.compile(). * Enforce that class_mapping is map by calling .get() and move the class_label code into it's own function. * Update hello world to remove class_mapping from viz_neighbors_imgs as we can just use the class ids. * Ensure class mapping in nn_viz requires a dict (#170) * Enforce that class_mapping is map by calling .get() and move the class_label code into it's own function. * Update hello world to remove class_mapping from viz_neighbors_imgs as we can just use the class ids. * Add support for passing distance thresholds and matcher in callbacks. * Update new for 0.14 in README Co-authored-by: Elie Bursztein <github@elie.net>
1 parent 1591d56 commit 9803dc3

25 files changed

+6876
-724
lines changed

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,8 @@ To learn more about the benefits of using similarity training, you can check out
2020

2121
## What's new
2222

23-
- [Aug 21]: Interactive embedding `projector()` added. See this [notebook](examples/supervised_visualization.ipynb)
24-
- [Aug 21]: [`CircleLoss()`](api/TFSimilarity/losses/CircleLoss.md) added
25-
- [Aug 21]: [`PNLoss()`](api/TFSimilarity/losses/PNLoss.md) added.
26-
- [Aug 21]: [`MultiSimilarityLoss()`](api/TFSimilarity/losses/MultiSimilarityLoss.md) added.
23+
- [Oct 8]: Added `Samplers.*` IO [notebook](examples/sampler_io_cookbook.ipynb) detailing how to efficently sample your data for succesful training.
24+
- [Oct 8]: 0.14 is out which includes various speed improvements and post initial release bug fixes.
2725

2826
For previous changes - see [the release changelog](./releases.md)
2927

examples/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
| ------ | :-----: | ---------- |
66
| [Hello World](./supervised_hello_world.ipynb) | Supervised | Train and use an image similarity model to find similar looking MNIST digits |
77
| [visualization](./supervised_visualization.ipynb) | Supervised | Train an image similarity model on the Stanford Dogs dataset using Evaluation Callbacks and the interactive visualizer |
8+
| [Sampler IO Cookbook](./sampler_io_cookbook.ipynb) | Utils | Examples demonstrating how to use the various in memory batch samplers.

examples/kaggle.ipynb

Lines changed: 2705 additions & 0 deletions
Large diffs are not rendered by default.

examples/sampler_io_cookbook.ipynb

Lines changed: 1209 additions & 0 deletions
Large diffs are not rendered by default.

examples/supervised_hello_world.ipynb

Lines changed: 167 additions & 158 deletions
Large diffs are not rendered by default.

tensorflow_similarity/__init__.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,25 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
__version__ = '0.13.45'
14+
__version__ = '0.14'
1515

16+
17+
from . import algebra # noqa
1618
from . import architectures # noqa
19+
from . import callbacks # noqa
1720
from . import classification_metrics # noqa
21+
from . import distances # noqa
1822
from . import evaluators # noqa
23+
from . import layers # noqa
1924
from . import losses # noqa
25+
from . import indexer # noqa
2026
from . import matchers # noqa
2127
from . import models # noqa
2228
from . import retrieval_metrics # noqa
2329
from . import samplers # noqa
2430
from . import search # noqa
2531
from . import stores # noqa
2632
from . import training_metrics # noqa
27-
from . import visualization # noqa
28-
from . import algebra # noqa
29-
from . import callbacks # noqa
30-
from . import distances # noqa
31-
from . import indexer # noqa
32-
from . import layers # noqa
3333
from . import types # noqa
3434
from . import utils # noqa
35+
from . import visualization # noqa

0 commit comments

Comments
 (0)