Skip to content

Commit

Permalink
0.14 (#172)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
owenvallis and ebursztein committed Oct 9, 2021
1 parent 1591d56 commit 9803dc3
Show file tree
Hide file tree
Showing 25 changed files with 6,876 additions and 724 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ To learn more about the benefits of using similarity training, you can check out

## What's new

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

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

Expand Down
1 change: 1 addition & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
| ------ | :-----: | ---------- |
| [Hello World](./supervised_hello_world.ipynb) | Supervised | Train and use an image similarity model to find similar looking MNIST digits |
| [visualization](./supervised_visualization.ipynb) | Supervised | Train an image similarity model on the Stanford Dogs dataset using Evaluation Callbacks and the interactive visualizer |
| [Sampler IO Cookbook](./sampler_io_cookbook.ipynb) | Utils | Examples demonstrating how to use the various in memory batch samplers.
2,705 changes: 2,705 additions & 0 deletions examples/kaggle.ipynb

Large diffs are not rendered by default.

1,209 changes: 1,209 additions & 0 deletions examples/sampler_io_cookbook.ipynb

Large diffs are not rendered by default.

325 changes: 167 additions & 158 deletions examples/supervised_hello_world.ipynb

Large diffs are not rendered by default.

15 changes: 8 additions & 7 deletions tensorflow_similarity/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,25 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
__version__ = '0.13.45'
__version__ = '0.14'


from . import algebra # noqa
from . import architectures # noqa
from . import callbacks # noqa
from . import classification_metrics # noqa
from . import distances # noqa
from . import evaluators # noqa
from . import layers # noqa
from . import losses # noqa
from . import indexer # noqa
from . import matchers # noqa
from . import models # noqa
from . import retrieval_metrics # noqa
from . import samplers # noqa
from . import search # noqa
from . import stores # noqa
from . import training_metrics # noqa
from . import visualization # noqa
from . import algebra # noqa
from . import callbacks # noqa
from . import distances # noqa
from . import indexer # noqa
from . import layers # noqa
from . import types # noqa
from . import utils # noqa
from . import visualization # noqa

0 comments on commit 9803dc3

Please sign in to comment.