Giter Site home page Giter Site logo

Comments (4)

marcocuturi avatar marcocuturi commented on June 14, 2024

Thanks Dominik for the great comment.

I think this is possible using the most recent API, as illustrated in this colab:

https://colab.research.google.com/drive/1YWKKjSWnpbhpeMae2tlkHKLLZXP97Cij?usp=sharing

You need to instantiate manually a QuadraticProblem, use a GromovWasserstein solver on it, and specify in GromovWasserstein the linear_ot_solver (this is common for all WassersteinSolver.
Namely, the linear solver inside the GW solver can be provided explicitly, with all parameters you might want, which is what happens in that call in the colab

GWsolver= gw.GromovWasserstein(
    linear_ot_solver=sinkhorn.Sinkhorn(
      min_iterations=1, 
      max_iterations=30,
      threshold=1e-1),
    min_iterations=1,
    max_iterations=7,
    epsilon=100.0,
    )

and then simply make the call

quad_p = qp.QuadraticProblem(geom_xx, geom_yy, scale_cost=True)
out = GWsolver(quad_p)

In the colab you can see how the .errors field of the output of GW shows the right size, showing how max_iterations are properly handled.

Using such classes, it is easy to have access to detailed granularity on the components that make up an OT problem. I think it's also a lot more viable than overloading the signature of gromov_wasserstein with sinkhorn_kwargs or sinkhorn_lr__kwargs etc... This is also why @michalk8 wants to get rid of make functions #131

from ott.

MUCDK avatar MUCDK commented on June 14, 2024

Thanks Marco!
I like the idea with sinkhorn_kwargs but the current approach is also nice!
Just want to make sure you are not about to refactor this?

from ott.

marcocuturi avatar marcocuturi commented on June 14, 2024

yes, the example I provided is clearly te way Michal and I want to go. We'll still maintain the sinkhorn and gromov_wasserstein wrappers for a little while, but I think we'll deprecate them at some point!

from ott.

MUCDK avatar MUCDK commented on June 14, 2024

Amazing, thank you!

from ott.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.