Skip to content

Commit

Permalink
Fix unused variables in tests, lexer and badge
Browse files Browse the repository at this point in the history
  • Loading branch information
michalk8 committed Aug 3, 2022
1 parent be01ced commit 7485da3
Show file tree
Hide file tree
Showing 11 changed files with 60 additions and 35 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<img src="https://raw.githubusercontent.com/ott-jax/ott/main/docs/_static/logoOTT.png" width="10%" alt="logo">
<img src="https://raw.githubusercontent.com/ott-jax/ott/main/docs/_static/images/logoOTT.png" width="10%" alt="logo">

# Optimal Transport Tools (OTT).

Expand Down
1 change: 1 addition & 0 deletions docs/_static/images/colab-badge.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes
6 changes: 3 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@
# a list of builtin themes.

html_theme = 'sphinx_book_theme'
html_logo = '_static/logoOTT.png'
html_favicon = '_static/logoOTT.ico'
html_logo = '_static/images/logoOTT.png'
html_favicon = '_static/images/logoOTT.ico'

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
Expand All @@ -110,7 +110,7 @@
<div class="docutils container">
<a class="reference external"
href="https://colab.research.google.com/github/ott-jax/ott/blob/main/{{ docname|e }}">
<img alt="Colab badge" src="https://colab.research.google.com/assets/colab-badge.svg" width="125px">
<img alt="Open in Colab" src="../_static/images/colab-badge.svg" width="125px">
</a>
</div>
"""
15 changes: 12 additions & 3 deletions docs/notebooks/One_Sinkhorn.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -32,7 +32,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {
"id": "CRSA3KsJtlpF"
},
Expand Down Expand Up @@ -1134,7 +1134,16 @@
"name": "python3"
},
"language_info": {
"name": "python"
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.12"
}
},
"nbformat": 4,
Expand Down
13 changes: 11 additions & 2 deletions docs/notebooks/fairness.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -592,7 +592,16 @@
"name": "python3"
},
"language_info": {
"name": "python"
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.7"
}
},
"nbformat": 4,
Expand Down
33 changes: 14 additions & 19 deletions docs/notebooks/gromov_wasserstein.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,8 @@
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "yoauHUVPTyAl",
"outputId": "d8bc8507-972f-4ac9-e997-e733edc218be"
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Requirement already satisfied: ott-jax in /usr/local/lib/python3.7/dist-packages (0.2.2)\n"
]
}
],
"metadata": {},
"outputs": [],
"source": [
"import sys\n",
"\n",
Expand Down Expand Up @@ -9154,12 +9140,21 @@
"provenance": []
},
"kernelspec": {
"display_name": "Python 3",
"display_name": "ott",
"language": "python",
"name": "python3"
"name": "ott"
},
"language_info": {
"name": "python"
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.12"
}
},
"nbformat": 4,
Expand Down
15 changes: 12 additions & 3 deletions docs/notebooks/soft_sort.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -23,7 +23,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {
"id": "CRSA3KsJtlpF"
},
Expand Down Expand Up @@ -765,7 +765,16 @@
"name": "python3"
},
"language_info": {
"name": "python"
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.12"
}
},
"nbformat": 4,
Expand Down
8 changes: 5 additions & 3 deletions tests/core/continuous_barycenter_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def test_bures_barycenter(
b1 = b2 = jnp.ones(num_components) / num_components

y = jnp.concatenate((y1, y2))
jnp.concatenate((b1, b2))
b = jnp.concatenate((b1, b2))

gmm_generator = gaussian_mixture.GaussianMixture.from_random(
rng, n_components=bar_size, n_dimensions=dimension
Expand All @@ -213,7 +213,8 @@ def test_bures_barycenter(
x_init = means_and_covs_to_x(x_init_means, x_init_covs, dimension)

seg_y, seg_b = segment.segment_point_cloud(
y,
x=y,
a=b,
num_segments=num_measures,
max_measure_size=num_components,
num_per_segment=(num_components, num_components),
Expand Down Expand Up @@ -279,6 +280,7 @@ def test_bures_barycenter_different_number_of_components(
n_components = jnp.array([3, 4]) # the number of components of the GMMs
num_measures = n_components.size
bar_size = 5 # the size of the barycenter
max_measure_size = int(jnp.max(n_components))

# Create an instance of the Bures cost class.
b_cost = costs.Bures(dimension=dim)
Expand Down Expand Up @@ -345,7 +347,7 @@ def test_bures_barycenter_different_number_of_components(
cost_fn=b_cost,
epsilon=epsilon,
num_segments=num_measures,
max_measure_size=4,
max_measure_size=max_measure_size,
segment_ids=seg_ids,
)
assert bar_p.max_measure_size == 4
Expand Down
2 changes: 1 addition & 1 deletion tests/tools/sinkhorn_divergence_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def test_segment_sinkhorn_different_segment_sizes(self):
segmented_divergences = sink_div(
jnp.concatenate((x1, x2)),
jnp.concatenate((y1, y2)),
# these 2 arguments are not necessary for jitting
# these 2 arguments are not necessary for jitting:
# num_segments=2,
# max_measure_size=15,
num_per_segment_x=(10, 12),
Expand Down

0 comments on commit 7485da3

Please sign in to comment.