Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Augmentor for Barlow Twins #229

Merged
merged 24 commits into from
Feb 1, 2022
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions api/TFSimilarity/augmenters/Augmenter.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ inheritance.

<h3 id="augment">augment</h3>

<a target="_blank" href="https://github.com/tensorflow/similarity/blob/main/tensorflow_similarity/augmenters/augmenter.py#L23-L26">View source</a>
<a target="_blank" href="https://github.com/tensorflow/similarity/blob/master/tensorflow_similarity/augmenters/augmenter.py#L23-L26">View source</a>

``<b>python
@abc.abstractmethod</b>``
Expand All @@ -37,7 +37,7 @@ augment(

<h3 id="__call__">__call__</h3>

<a target="_blank" href="https://github.com/tensorflow/similarity/blob/main/tensorflow_similarity/augmenters/augmenter.py#L28-L31">View source</a>
<a target="_blank" href="https://github.com/tensorflow/similarity/blob/master/tensorflow_similarity/augmenters/augmenter.py#L28-L31">View source</a>

```python
__call__(
Expand Down
14 changes: 7 additions & 7 deletions api/TFSimilarity/augmenters/AutoAugment.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ ValueError if <b>augmentation_name</b> is unsupported.

<h3 id="distort">distort</h3>

<a target="_blank" href="https://github.com/tensorflow/similarity/blob/main/tensorflow_similarity/augmenters/img_augments.py#L997-L1058">View source</a>
<a target="_blank" href="https://github.com/tensorflow/similarity/blob/master/tensorflow_similarity/augmenters/img_augments.py#L997-L1058">View source</a>

```python
distort(
Expand Down Expand Up @@ -146,7 +146,7 @@ based on the <b>policies</b> pass into the function.

<h3 id="policy_reduced_cifar10">policy_reduced_cifar10</h3>

<a target="_blank" href="https://github.com/tensorflow/similarity/blob/main/tensorflow_similarity/augmenters/img_augments.py#L1101-L1141">View source</a>
<a target="_blank" href="https://github.com/tensorflow/similarity/blob/master/tensorflow_similarity/augmenters/img_augments.py#L1101-L1141">View source</a>

``<b>python
@staticmethod</b>``
Expand Down Expand Up @@ -180,7 +180,7 @@ the policy.

<h3 id="policy_reduced_imagenet">policy_reduced_imagenet</h3>

<a target="_blank" href="https://github.com/tensorflow/similarity/blob/main/tensorflow_similarity/augmenters/img_augments.py#L1185-L1225">View source</a>
<a target="_blank" href="https://github.com/tensorflow/similarity/blob/master/tensorflow_similarity/augmenters/img_augments.py#L1185-L1225">View source</a>

``<b>python
@staticmethod</b>``
Expand Down Expand Up @@ -214,7 +214,7 @@ the policy.

<h3 id="policy_simple">policy_simple</h3>

<a target="_blank" href="https://github.com/tensorflow/similarity/blob/main/tensorflow_similarity/augmenters/img_augments.py#L1227-L1246">View source</a>
<a target="_blank" href="https://github.com/tensorflow/similarity/blob/master/tensorflow_similarity/augmenters/img_augments.py#L1227-L1246">View source</a>

``<b>python
@staticmethod</b>``
Expand All @@ -229,7 +229,7 @@ Same as <b>policy_v0</b>, except with custom ops removed.

<h3 id="policy_svhn">policy_svhn</h3>

<a target="_blank" href="https://github.com/tensorflow/similarity/blob/main/tensorflow_similarity/augmenters/img_augments.py#L1143-L1183">View source</a>
<a target="_blank" href="https://github.com/tensorflow/similarity/blob/master/tensorflow_similarity/augmenters/img_augments.py#L1143-L1183">View source</a>

``<b>python
@staticmethod</b>``
Expand Down Expand Up @@ -263,7 +263,7 @@ the policy.

<h3 id="policy_test">policy_test</h3>

<a target="_blank" href="https://github.com/tensorflow/similarity/blob/main/tensorflow_similarity/augmenters/img_augments.py#L1248-L1254">View source</a>
<a target="_blank" href="https://github.com/tensorflow/similarity/blob/master/tensorflow_similarity/augmenters/img_augments.py#L1248-L1254">View source</a>

``<b>python
@staticmethod</b>``
Expand All @@ -278,7 +278,7 @@ Autoaugment test policy for debugging.

<h3 id="policy_v0">policy_v0</h3>

<a target="_blank" href="https://github.com/tensorflow/similarity/blob/main/tensorflow_similarity/augmenters/img_augments.py#L1060-L1099">View source</a>
<a target="_blank" href="https://github.com/tensorflow/similarity/blob/master/tensorflow_similarity/augmenters/img_augments.py#L1060-L1099">View source</a>

``<b>python
@staticmethod</b>``
Expand Down
4 changes: 2 additions & 2 deletions api/TFSimilarity/augmenters/ContrastiveAugmenter.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ inheritance.

<h3 id="augment">augment</h3>

<a target="_blank" href="https://github.com/tensorflow/similarity/blob/main/tensorflow_similarity/augmenters/contrastive.py#L30-L40">View source</a>
<a target="_blank" href="https://github.com/tensorflow/similarity/blob/master/tensorflow_similarity/augmenters/contrastive.py#L30-L40">View source</a>

```python
augment(
Expand All @@ -44,7 +44,7 @@ augment(

<h3 id="__call__">__call__</h3>

<a target="_blank" href="https://github.com/tensorflow/similarity/blob/main/tensorflow_similarity/augmenters/augmenter.py#L28-L31">View source</a>
<a target="_blank" href="https://github.com/tensorflow/similarity/blob/master/tensorflow_similarity/augmenters/augmenter.py#L28-L31">View source</a>

```python
__call__(
Expand Down
4 changes: 2 additions & 2 deletions api/TFSimilarity/augmenters/MixupAndCutmix.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ num_classes (int, optional): Number of classes. Defaults to 1001.

<h3 id="distort">distort</h3>

<a target="_blank" href="https://github.com/tensorflow/similarity/blob/main/tensorflow_similarity/augmenters/img_augments.py#L1576-L1610">View source</a>
<a target="_blank" href="https://github.com/tensorflow/similarity/blob/master/tensorflow_similarity/augmenters/img_augments.py#L1576-L1610">View source</a>

```python
distort(
Expand Down Expand Up @@ -106,7 +106,7 @@ Tuple[tf.Tensor, tf.Tensor]: The augmented version of <b>image</b> and

<h3 id="__call__">__call__</h3>

<a target="_blank" href="https://github.com/tensorflow/similarity/blob/main/tensorflow_similarity/augmenters/img_augments.py#L1571-L1574">View source</a>
<a target="_blank" href="https://github.com/tensorflow/similarity/blob/master/tensorflow_similarity/augmenters/img_augments.py#L1571-L1574">View source</a>

```python
__call__(
Expand Down
2 changes: 1 addition & 1 deletion api/TFSimilarity/augmenters/RandAugment.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ exclude selected operations.

<h3 id="distort">distort</h3>

<a target="_blank" href="https://github.com/tensorflow/similarity/blob/main/tensorflow_similarity/augmenters/img_augments.py#L1321-L1386">View source</a>
<a target="_blank" href="https://github.com/tensorflow/similarity/blob/master/tensorflow_similarity/augmenters/img_augments.py#L1321-L1386">View source</a>

```python
distort(
Expand Down
2 changes: 1 addition & 1 deletion api/TFSimilarity/augmenters/RandomErasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ trials (int, optional): Maximum number of trials to randomly sample a

<h3 id="distort">distort</h3>

<a target="_blank" href="https://github.com/tensorflow/similarity/blob/main/tensorflow_similarity/augmenters/img_augments.py#L1437-L1449">View source</a>
<a target="_blank" href="https://github.com/tensorflow/similarity/blob/master/tensorflow_similarity/augmenters/img_augments.py#L1437-L1449">View source</a>

```python
distort(
Expand Down
4 changes: 2 additions & 2 deletions api/TFSimilarity/augmenters/SimCLRAugmenter.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ code adapted from [orignal github](https://github.com/google-research/simclr/tre

<h3 id="augment">augment</h3>

<a target="_blank" href="https://github.com/tensorflow/similarity/blob/main/tensorflow_similarity/augmenters/simclr.py#L648-L664">View source</a>
<a target="_blank" href="https://github.com/tensorflow/similarity/blob/master/tensorflow_similarity/augmenters/simclr.py#L648-L664">View source</a>

``<b>python
@tf.function</b>``
Expand All @@ -57,7 +57,7 @@ augment(

<h3 id="__call__">__call__</h3>

<a target="_blank" href="https://github.com/tensorflow/similarity/blob/main/tensorflow_similarity/augmenters/augmenter.py#L28-L31">View source</a>
<a target="_blank" href="https://github.com/tensorflow/similarity/blob/master/tensorflow_similarity/augmenters/augmenter.py#L28-L31">View source</a>

```python
__call__(
Expand Down
8 changes: 4 additions & 4 deletions api/TFSimilarity/callbacks/ClassificationMatch.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ threshold.

<h3 id="compile">compile</h3>

<a target="_blank" href="https://github.com/tensorflow/similarity/blob/main/tensorflow_similarity/matchers/classification_match.py#L60-L73">View source</a>
<a target="_blank" href="https://github.com/tensorflow/similarity/blob/master/tensorflow_similarity/matchers/classification_match.py#L60-L73">View source</a>

```python
compile(
Expand Down Expand Up @@ -147,7 +147,7 @@ is passed.

<h3 id="compute_count">compute_count</h3>

<a target="_blank" href="https://github.com/tensorflow/similarity/blob/main/tensorflow_similarity/matchers/classification_match.py#L162-L201">View source</a>
<a target="_blank" href="https://github.com/tensorflow/similarity/blob/master/tensorflow_similarity/matchers/classification_match.py#L162-L201">View source</a>

```python
compute_count(
Expand Down Expand Up @@ -216,7 +216,7 @@ between the jth query and the set of k neighbors.

<h3 id="derive_match">derive_match</h3>

<a target="_blank" href="https://github.com/tensorflow/similarity/blob/main/tensorflow_similarity/matchers/classification_match.py#L75-L101">View source</a>
<a target="_blank" href="https://github.com/tensorflow/similarity/blob/master/tensorflow_similarity/matchers/classification_match.py#L75-L101">View source</a>

```python
derive_match(
Expand Down Expand Up @@ -284,7 +284,7 @@ associated with the jth derived label.

<h3 id="get_config">get_config</h3>

<a target="_blank" href="https://github.com/tensorflow/similarity/blob/main/tensorflow_similarity/matchers/classification_match.py#L53-L58">View source</a>
<a target="_blank" href="https://github.com/tensorflow/similarity/blob/master/tensorflow_similarity/matchers/classification_match.py#L53-L58">View source</a>

```python
get_config()
Expand Down
4 changes: 2 additions & 2 deletions api/TFSimilarity/callbacks/ClassificationMetric.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ where each value represents the counts at a specific distance threshold.

<h3 id="compute">compute</h3>

<a target="_blank" href="https://github.com/tensorflow/similarity/blob/main/tensorflow_similarity/classification_metrics/classification_metric.py#L65-L91">View source</a>
<a target="_blank" href="https://github.com/tensorflow/similarity/blob/master/tensorflow_similarity/classification_metrics/classification_metric.py#L65-L91">View source</a>

```python
compute(
Expand Down Expand Up @@ -154,7 +154,7 @@ A 1D FloatTensor containing the metric at each distance threshold.

<h3 id="get_config">get_config</h3>

<a target="_blank" href="https://github.com/tensorflow/similarity/blob/main/tensorflow_similarity/classification_metrics/classification_metric.py#L58-L63">View source</a>
<a target="_blank" href="https://github.com/tensorflow/similarity/blob/master/tensorflow_similarity/classification_metrics/classification_metric.py#L58-L63">View source</a>

```python
get_config()
Expand Down
6 changes: 3 additions & 3 deletions api/TFSimilarity/callbacks/Evaluator.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ a remote database.

<h3 id="calibrate">calibrate</h3>

<a target="_blank" href="https://github.com/tensorflow/similarity/blob/main/tensorflow_similarity/evaluators/evaluator.py#L108-L153">View source</a>
<a target="_blank" href="https://github.com/tensorflow/similarity/blob/master/tensorflow_similarity/evaluators/evaluator.py#L108-L153">View source</a>

```python
calibrate(
Expand Down Expand Up @@ -141,7 +141,7 @@ CalibrationResults containing the thresholds and cutpoints Dicts.

<h3 id="evaluate_classification">evaluate_classification</h3>

<a target="_blank" href="https://github.com/tensorflow/similarity/blob/main/tensorflow_similarity/evaluators/evaluator.py#L62-L106">View source</a>
<a target="_blank" href="https://github.com/tensorflow/similarity/blob/master/tensorflow_similarity/evaluators/evaluator.py#L62-L106">View source</a>

```python
evaluate_classification(
Expand Down Expand Up @@ -259,7 +259,7 @@ distance threshold.

<h3 id="evaluate_retrieval">evaluate_retrieval</h3>

<a target="_blank" href="https://github.com/tensorflow/similarity/blob/main/tensorflow_similarity/evaluators/evaluator.py#L36-L60">View source</a>
<a target="_blank" href="https://github.com/tensorflow/similarity/blob/master/tensorflow_similarity/evaluators/evaluator.py#L36-L60">View source</a>

```python
evaluate_retrieval(
Expand Down
6 changes: 3 additions & 3 deletions api/TFSimilarity/callbacks/MemoryEvaluator.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Inherits From: [`Evaluator`](../../TFSimilarity/callbacks/Evaluator.md), [`ABC`]

<h3 id="calibrate">calibrate</h3>

<a target="_blank" href="https://github.com/tensorflow/similarity/blob/main/tensorflow_similarity/evaluators/memory_evaluator.py#L176-L366">View source</a>
<a target="_blank" href="https://github.com/tensorflow/similarity/blob/master/tensorflow_similarity/evaluators/memory_evaluator.py#L176-L366">View source</a>

```python
calibrate(
Expand Down Expand Up @@ -154,7 +154,7 @@ lookupds must not be empty.

<h3 id="evaluate_classification">evaluate_classification</h3>

<a target="_blank" href="https://github.com/tensorflow/similarity/blob/main/tensorflow_similarity/evaluators/memory_evaluator.py#L98-L174">View source</a>
<a target="_blank" href="https://github.com/tensorflow/similarity/blob/master/tensorflow_similarity/evaluators/memory_evaluator.py#L98-L174">View source</a>

```python
evaluate_classification(
Expand Down Expand Up @@ -272,7 +272,7 @@ distance threshold.

<h3 id="evaluate_retrieval">evaluate_retrieval</h3>

<a target="_blank" href="https://github.com/tensorflow/similarity/blob/main/tensorflow_similarity/evaluators/memory_evaluator.py#L39-L96">View source</a>
<a target="_blank" href="https://github.com/tensorflow/similarity/blob/master/tensorflow_similarity/evaluators/memory_evaluator.py#L39-L96">View source</a>

```python
evaluate_retrieval(
Expand Down
30 changes: 15 additions & 15 deletions api/TFSimilarity/callbacks/SimilarityModel.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ core features.

<h3 id="calibrate">calibrate</h3>

<a target="_blank" href="https://github.com/tensorflow/similarity/blob/main/tensorflow_similarity/models/similarity_model.py#L440-L509">View source</a>
<a target="_blank" href="https://github.com/tensorflow/similarity/blob/master/tensorflow_similarity/models/similarity_model.py#L440-L509">View source</a>

```python
calibrate(
Expand Down Expand Up @@ -152,7 +152,7 @@ CalibrationResults containing the thresholds and cutpoints Dicts.

<h3 id="create_index">create_index</h3>

<a target="_blank" href="https://github.com/tensorflow/similarity/blob/main/tensorflow_similarity/models/similarity_model.py#L244-L314">View source</a>
<a target="_blank" href="https://github.com/tensorflow/similarity/blob/master/tensorflow_similarity/models/similarity_model.py#L244-L314">View source</a>

```python
create_index(
Expand Down Expand Up @@ -258,7 +258,7 @@ Invalid search framework or key value store.

<h3 id="evaluate_classification">evaluate_classification</h3>

<a target="_blank" href="https://github.com/tensorflow/similarity/blob/main/tensorflow_similarity/models/similarity_model.py#L631-L735">View source</a>
<a target="_blank" href="https://github.com/tensorflow/similarity/blob/master/tensorflow_similarity/models/similarity_model.py#L631-L735">View source</a>

```python
evaluate_classification(
Expand Down Expand Up @@ -373,7 +373,7 @@ Uncalibrated model: run model.calibration()")

<h3 id="evaluate_retrieval">evaluate_retrieval</h3>

<a target="_blank" href="https://github.com/tensorflow/similarity/blob/main/tensorflow_similarity/models/similarity_model.py#L577-L629">View source</a>
<a target="_blank" href="https://github.com/tensorflow/similarity/blob/master/tensorflow_similarity/models/similarity_model.py#L577-L629">View source</a>

```python
evaluate_retrieval(
Expand Down Expand Up @@ -460,7 +460,7 @@ Index must contain embeddings but is currently empty.

<h3 id="index">index</h3>

<a target="_blank" href="https://github.com/tensorflow/similarity/blob/main/tensorflow_similarity/models/similarity_model.py#L316-L358">View source</a>
<a target="_blank" href="https://github.com/tensorflow/similarity/blob/master/tensorflow_similarity/models/similarity_model.py#L316-L358">View source</a>

```python
index(
Expand Down Expand Up @@ -530,7 +530,7 @@ Output indexing progress info. Defaults to 1.

<h3 id="index_single">index_single</h3>

<a target="_blank" href="https://github.com/tensorflow/similarity/blob/main/tensorflow_similarity/models/similarity_model.py#L360-L397">View source</a>
<a target="_blank" href="https://github.com/tensorflow/similarity/blob/master/tensorflow_similarity/models/similarity_model.py#L360-L397">View source</a>

```python
index_single(
Expand Down Expand Up @@ -600,7 +600,7 @@ Output indexing progress info. Defaults to 1.

<h3 id="index_size">index_size</h3>

<a target="_blank" href="https://github.com/tensorflow/similarity/blob/main/tensorflow_similarity/models/similarity_model.py#L741-L743">View source</a>
<a target="_blank" href="https://github.com/tensorflow/similarity/blob/master/tensorflow_similarity/models/similarity_model.py#L741-L743">View source</a>

```python
index_size() -> int
Expand All @@ -612,7 +612,7 @@ Return the index size

<h3 id="index_summary">index_summary</h3>

<a target="_blank" href="https://github.com/tensorflow/similarity/blob/main/tensorflow_similarity/models/similarity_model.py#L436-L438">View source</a>
<a target="_blank" href="https://github.com/tensorflow/similarity/blob/master/tensorflow_similarity/models/similarity_model.py#L436-L438">View source</a>

```python
index_summary()
Expand All @@ -624,7 +624,7 @@ Display index info summary.

<h3 id="load_index">load_index</h3>

<a target="_blank" href="https://github.com/tensorflow/similarity/blob/main/tensorflow_similarity/models/similarity_model.py#L745-L755">View source</a>
<a target="_blank" href="https://github.com/tensorflow/similarity/blob/master/tensorflow_similarity/models/similarity_model.py#L745-L755">View source</a>

```python
load_index(
Expand Down Expand Up @@ -662,7 +662,7 @@ Be verbose. Defaults to 1.

<h3 id="lookup">lookup</h3>

<a target="_blank" href="https://github.com/tensorflow/similarity/blob/main/tensorflow_similarity/models/similarity_model.py#L399-L418">View source</a>
<a target="_blank" href="https://github.com/tensorflow/similarity/blob/master/tensorflow_similarity/models/similarity_model.py#L399-L418">View source</a>

```python
lookup(
Expand Down Expand Up @@ -713,7 +713,7 @@ Returns

<h3 id="match">match</h3>

<a target="_blank" href="https://github.com/tensorflow/similarity/blob/main/tensorflow_similarity/models/similarity_model.py#L511-L575">View source</a>
<a target="_blank" href="https://github.com/tensorflow/similarity/blob/master/tensorflow_similarity/models/similarity_model.py#L511-L575">View source</a>

```python
match(
Expand Down Expand Up @@ -812,7 +812,7 @@ evaluation in a single go.

<h3 id="reset_index">reset_index</h3>

<a target="_blank" href="https://github.com/tensorflow/similarity/blob/main/tensorflow_similarity/models/similarity_model.py#L737-L739">View source</a>
<a target="_blank" href="https://github.com/tensorflow/similarity/blob/master/tensorflow_similarity/models/similarity_model.py#L737-L739">View source</a>

```python
reset_index()
Expand All @@ -824,7 +824,7 @@ Reinitialize the index

<h3 id="save_index">save_index</h3>

<a target="_blank" href="https://github.com/tensorflow/similarity/blob/main/tensorflow_similarity/models/similarity_model.py#L757-L765">View source</a>
<a target="_blank" href="https://github.com/tensorflow/similarity/blob/master/tensorflow_similarity/models/similarity_model.py#L757-L765">View source</a>

```python
save_index(
Expand Down Expand Up @@ -862,7 +862,7 @@ Store index data compressed. Defaults to True.

<h3 id="single_lookup">single_lookup</h3>

<a target="_blank" href="https://github.com/tensorflow/similarity/blob/main/tensorflow_similarity/models/similarity_model.py#L420-L434">View source</a>
<a target="_blank" href="https://github.com/tensorflow/similarity/blob/master/tensorflow_similarity/models/similarity_model.py#L420-L434">View source</a>

```python
single_lookup(
Expand Down Expand Up @@ -906,7 +906,7 @@ Returns

<h3 id="to_data_frame">to_data_frame</h3>

<a target="_blank" href="https://github.com/tensorflow/similarity/blob/main/tensorflow_similarity/models/similarity_model.py#L825-L835">View source</a>
<a target="_blank" href="https://github.com/tensorflow/similarity/blob/master/tensorflow_similarity/models/similarity_model.py#L825-L835">View source</a>

```python
to_data_frame(
Expand Down
Loading