Git Product home page Git Product logo

fugw's People

Contributors

6ulm avatar alexisthual avatar antoinecollas avatar bthirion avatar dimitripapadopoulos avatar pbarbarant avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fugw's Issues

Make functions in `solvers/utils.py` private.

          I agree, most functions in `solvers/utils.py` are not meant to be public (because they are called through `fugw.mappings` instances, which themselves call `fugw.solvers` instances).

I added a docstring, and suggest we hide all non-public functions in a follow-up PR.

Originally posted by @alexisthual in #29 (comment)

There is NaN in coupling

    from fugw.solvers import FUGWSolver
    
    torch.manual_seed(1)
    torch.backends.cudnn.benchmark = True

    nits_bcd = 100
    eval_bcd = 2        
    Ds_normalized = Ds / Ds.max()
    Dt_normalized = Dt / Dt.max()
    F_normalized = c_z / c_z.max()

    fugw = FUGWSolver(
        nits_bcd=nits_bcd,
        nits_uot=1000,
        tol_bcd=1e-7,
        tol_uot=1e-7,
        tol_loss=1e-5,
        eval_bcd=eval_bcd,
        eval_uot=10,
        ibpp_eps_base=1e5,
    )

    divergence="kl"
    
    reg_mode="independent"
    
    solver="sinkhorn"
    
    res = fugw.solve(
        alpha=alpha,
        rho_s=rho_s,
        rho_t=rho_t,
        eps=eps,
        reg_mode=reg_mode,
        divergence=divergence,
        F=F_normalized,
        Ds=Ds_normalized,
        Dt=Dt_normalized,
        init_plan=None,
        solver=solver,
        callback_bcd=None,
        verbose=False,
    )
    
    Why would I get coupling having nan?  In what cases would this happen easily?

Fix the case alpha = 0

When running the dense/sparse solvers with alpha = 0, the following error occurs:

  File "/data/parietal/store3/work/pbarbara/fugw/src/fugw/solvers/dense.py", line 425, in solve
    current_loss = compute_fugw_loss(pi, gamma)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/parietal/store3/work/pbarbara/fugw/src/fugw/solvers/dense.py", line 166, in fugw_loss
    "gromov_wasserstein": loss_gromov_wasserstein.item(),
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'item'

[BUG] Remove res["pi"].detach().cpu()

In fugw.mapping :

# Store variables of interest in model
self.pi = res["pi"].detach().cpu()

Causes problems when dealing with barycenters as the transport plans get detached before the next barycenter iteration. Discovered with @antoinecollas.

intsall instructions incomplete ?

pip install -e . fails on my box

bertrandthirion@ptb-11107357:~/mygit/fugw$ pip install -e .
Defaulting to user installation because normal site-packages is not writeable
Obtaining file:///home/bertrandthirion/mygit/fugw
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
ERROR: Project file:///home/bertrandthirion/mygit/fugw has a 'pyproject.toml' and its build backend is missing the 'build_editable' hook. Since it does not have a 'setup.py' nor a 'setup.cfg', it cannot be installed in editable mode. Consider using a build backend that supports PEP 660.

RuntimeError: sparse tensors do not have strides

Hi, I tried using the sparse version with the code in test_sparse_transformer.py. At the fugw.transform() step I get the following error.

transformed_data = fugw.transform(source_features_test)
File "...fugw-main\src\fugw\sparse.py", line 213, in transform
torch.sparse.mm(self.pi.T, source_features_torch.T).to_dense()
RuntimeError: sparse tensors do not have strides

I'm using Windows, conda, python 3.6, don't have a CUDA video card so using torch with cpu only.

undo parameters concatenation

          I agree, this concatenation of parameters is difficult to understand. It is somewhat consistent across solvers, but I think we should flatten these variables. Once again, I think this would fit more naturally in a follow-up PR.

Originally posted by @alexisthual in #29 (comment)

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.