Skip to content

Unable to run the source code #1

Description

@JulianCCY

Hello, I am a master’s student and I was trying to run scDOT. First, I’d like to thank you for sharing this tool, but unfortunately, it does not function properly.

The documentation and comments in the source code are quite limited, which makes it difficult to follow. For example, it is not clearly stated where the scDOT class comes from, so users can’t easily identify or import the correct module.
model = scDOT(adata1, adata2)
optimizer = optim.Adam(model.parameters(), lr=1.0e-1)

In net.py there is a line: from transport import OptimalTransportLayer.
However, I found that OptimalTransportLayer is actually defined in ddn.py, not in transport.py. Could you please confirm where this class should properly reside and how to connect to the functions across files.


ValueError Traceback (most recent call last)
Cell In[62], line 9
6 import torch.optim as optim
7 from net import scDOT
----> 9 model = scDOT(adata1, ganier)
10 optimizer = optim.Adam(model.parameters(), lr=1.0e-1)
12 iters = 10

File ~/UQ/Research/app/scDOT-main/src/net.py:14, in scDOT.init(self, sc_adata, st_adata)
11 self.NNLS = NNLS(sc_adata, st_adata)
12 self.OT = OptimalTransportLayer(method='approx')
13 self.M = nn.Parameter(torch.from_numpy(
---> 14 ot.dist(st_adata.X, sc_adata.X, metric='cosine'))
15 )

File ~/miniforge3/envs/uqbiox/lib/python3.10/site-packages/ot/utils.py:334, in dist(x1, x2, metric, p, w)
332 return euclidean_distances(x1, x2, squared=False)
333 else:
--> 334 if not get_backend(x1, x2).name == "numpy":
335 raise NotImplementedError()
336 else:

File ~/miniforge3/envs/uqbiox/lib/python3.10/site-packages/ot/backend.py:229, in get_backend(*args)
226 if _check_args_backend(backend_impl, args):
227 return _get_backend_instance(backend_impl)
--> 229 raise ValueError("Unknown type of non implemented backend.")

ValueError: Unknown type of non implemented backend.

Could you make sure the repository is updated so that all required files and functions are in sync with the current version of the package? Right now, it feels like parts of the implementation are missing or inconsistent.

Thank you very much for your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions