ys-zong / const Goto Github PK
View Code? Open in Web Editor NEWconST: an interpretable multi-modal contrastive learning framework for spatial transcriptomics
License: MIT License
conST: an interpretable multi-modal contrastive learning framework for spatial transcriptomics
License: MIT License
Hi Author!
I met some errors when running conST, which reported the error "did not define the function contrastive_loss". I didn't find the code of contrastive_loss in the model.py or in the training.py. Could you help me solve it?
Thanks!
Hello, can you confirm that the torchvision version is indeed 0.9.2?
Hey,
I was trying to run your code on my local but leidenalg keeps giving this error:
BaseException: Could not construct partition: Weight vector not the same size as the number of edges.
I have tried using every version of leidenalg from 0.7.0 to 0.9.0.
Do you happen to know any work around.
Complete Error Message:
`BaseException Traceback (most recent call last)
/tmp/ipykernel_58748/2566975975.py in
35 sc.pp.neighbors(adata_conST, n_neighbors=params.eval_graph_n)
36
---> 37 eval_resolution = res_search_fixed_clus(adata_conST, n_clusters)
38 print(eval_resolution)
39 cluster_key = "conST_leiden"
/media/nikhilmehta/New Volume/01IITK/Sem 7/CS690/conST/src/utils_func.py in res_search_fixed_clus(adata, fixed_clus_count, increment)
36 '''
37 for res in sorted(list(np.arange(0.01, 2.5, increment)), reverse=True):
---> 38 sc.tl.leiden(adata, random_state=0, resolution=res)
39 count_unique_leiden = len(pd.DataFrame(adata.obs['leiden']).leiden.unique())
40 if count_unique_leiden == fixed_clus_count:
~/anaconda3/envs/cs690/lib/python3.7/site-packages/scanpy/tools/_leiden.py in leiden(adata, resolution, restrict_to, random_state, key_added, adjacency, directed, use_weights, n_iterations, partition_type, neighbors_key, obsp, copy, **partition_kwargs)
142 partition_kwargs['resolution_parameter'] = resolution
143 # clustering proper
--> 144 part = leidenalg.find_partition(g, partition_type, **partition_kwargs)
145 # store output into adata.obs
146 groups = np.array(part.membership)
~/anaconda3/envs/cs690/lib/python3.7/site-packages/leidenalg/functions.py in find_partition(graph, partition_type, initial_membership, weights, n_iterations, max_comm_size, seed, **kwargs)
81 kwargs['weights'] = weights
...
--> 856 singleton partition.
857
858 weights : list of double, or edge attribute
BaseException: Could not construct partition: Weight vector not the same size as the number of edges.`
Could you please add a licence to your code. It is unclear if the tool is open source.
Thank you very much for your time.
Greetings, Currently, I have been assigned the task of replicating your conST method; however, I am unable to locate any others such as conST_151674.pth. Could you kindly guide me on where to find them? Thank you sincerely for your assistance.
Hello,
I noticed that several layers had wrong input dimensions when I turned use_img to True, and I have corrected them in my repo forked from yours: frickyinn/conST.
But with MAE image features, the ARI result were little lower than merely using gene expression. I think that maybe I was using the wrong hyper-parameters when I tried to change the dimensions. So could you help me solve this?
Thank you!
Hello,
I was trying to run your model following the provided notebook conST_cluster.ipynb.
For the Histology feature extraction part, following your steps, I am facing an error from the run_mae_extract_feature.py file
Creating model: pretrain_mae_base_patch16_224
Traceback (most recent call last):
File "run_mae_extract_feature.py", line 97, in <module>
main(opts)
File "run_mae_extract_feature.py", line 58, in main
model = get_model(args)
File "run_mae_extract_feature.py", line 42, in get_model
model = create_model(
File "/usr/local/lib/python3.8/dist-packages/timm/models/factory.py", line 78, in create_model
raise RuntimeError('Unknown model (%s)' % model_name)
RuntimeError: Unknown model (pretrain_mae_base_patch16_224)
My timm version is timm-0.6.12
. Exploring the rwightman/pytorch-image-models repo, I am led to believe I need to install this model on timm (similar issue on the repo huggingface/pytorch-image-models#158 ).
Could you provide me with the necessary files for the pretrain_mae_base_patch16_224
model?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.