Skip to content

Commit

Permalink
Merge pull request #1083 from carlosgmartin:linear_assignment_problem
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 683631390
  • Loading branch information
OptaxDev committed Oct 8, 2024
2 parents f9e7772 + 2c41bad commit 06ce57a
Show file tree
Hide file tree
Showing 9 changed files with 864 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/api/assignment.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Assignment problem
==================

.. currentmodule:: optax.assignment

.. autosummary::
hungarian_algorithm


Hungarian algorithm
~~~~~~~~~~~~~~~~~~~
.. autofunction:: hungarian_algorithm
21 changes: 21 additions & 0 deletions docs/gallery.rst
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,27 @@
</div>


.. raw:: html

<div class="sphx-glr-thumbcontainer" tooltip="Solving the linear assignment problem.">

.. only:: html

.. image:: /images/examples/linear_assignment_problem.png
:alt:

:doc:`_collections/examples/linear_assignment_problem`

.. raw:: html

<div class="sphx-glr-thumbnail-title">Solving the linear assignment problem.</div>
</div>

.. raw:: html

</div>


Contrib Examples
----------------

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ for instructions on installing JAX.
:caption: 📖 Reference
:maxdepth: 2

api/assignment
api/optimizers
api/transformations
api/combining_optimizers
Expand Down
329 changes: 329 additions & 0 deletions examples/linear_assignment_problem.ipynb

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions optax/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# pylint: disable=wrong-import-position
# pylint: disable=g-importing-member

from optax import assignment
from optax import contrib
from optax import losses
from optax import monte_carlo
Expand Down Expand Up @@ -307,6 +308,7 @@
"apply_updates",
"ApplyEvery",
"ApplyIfFiniteState",
"assignment",
"centralize",
"chain",
"clip_by_block_rms",
Expand Down
19 changes: 19 additions & 0 deletions optax/assignment/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2024 DeepMind Technologies Limited. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# 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.
# ==============================================================================
"""The assignment sub-package."""

# pylint:disable=g-importing-member

from optax.assignment._hungarian_algorithm import hungarian_algorithm
Loading

0 comments on commit 06ce57a

Please sign in to comment.