scme's Issues
Problem when I want to get the latent space representation after training
I want to integrate my paired RNA data and Protein data as the tutorial described, but encountered an error when I'm going to get the latent space representation after training. The message is
RuntimeError Traceback (most recent call last)
Cell In[15], line 7
5 rnatorch,proteintorch=rnatorch.to(model.device),proteintorch.to(model.device)
6 model.eval()
----> 7 zm=model.inference(rnatorch, proteintorch)
File ~/Workspace/Multiomics/benchmark/script/./scME/pyroMethod.py:653, in ScMESVI_2.inference(self, rna, protein)
650 self.eval()
651 # zr_loc,zr_scale,l_loc,l_scale=self.zr_encoder((rna,yr))
652 # zp_loc,zp_scale,c_loc,c_scale,pi=self.zp_encoder((protein,yp))
--> 653 zr_loc,zr_scale,l_loc,l_scale=self.zr_encoder(rna)
654 zp_loc,zp_scale,c_loc,c_scale,pi=self.zp_encoder(protein)
655 zm_loc,zm_scale=self.zm_encoder((zr_loc,zp_loc))
RuntimeError: mat1 and mat2 must have the same dtype
The rnatorch.shape is torch.Size([16204, 2000]) and I get model.zr_encoder like
MLP(
(sequential_mlp): Sequential(
(0): ConcatModule()
(1): DataParallel(
(module): Linear(in_features=2000, out_features=1000, bias=True)
)
(2): BatchNorm1d(1000, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(3): ReLU()
(4): DataParallel(
(module): Linear(in_features=1000, out_features=256, bias=True)
)
(5): BatchNorm1d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(6): ReLU()
(7): DataParallel(
(module): Linear(in_features=256, out_features=64, bias=True)
)
(8): BatchNorm1d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(9): ReLU()
(10): ListOutModule(
(0): Sequential(
(0): Linear(in_features=64, out_features=24, bias=True)
)
(1): Sequential(
(0): Linear(in_features=64, out_features=24, bias=True)
(1): Softplus(beta=1, threshold=20)
)
(2): Sequential(
(0): Linear(in_features=64, out_features=1, bias=True)
)
(3): Sequential(
(0): Linear(in_features=64, out_features=1, bias=True)
(1): Softplus(beta=1, threshold=20)
)
)
)
)
I consider the shapes of rnatorch and the MLP are matched, so I don't know where the problem is. What could I do to fix it? I'd appreciate it if you could consider my issue!
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.