camlab-bioml/astir

Question about loss values

Closed this issue · 2 comments

Hello,

I was going through the getting_started notebook with our IMC data. When calling the fit_type() function for fitting cell types and plotting the loss values, with the test data provided in the notebook I get positive loss values decreasing in a linear fashion:

However, with our data, I'm getting negative loss values in the order of -100k:

By looking at the implementation, it seems the model is taking the negative of ELBO in the loss function, so I believe it makes sense for the loss value to be negative. But I was wondering if this behavior is expected based on your experience with other datasets? I performed arcsinh transformation and winsorization to the data as suggested by the documentation as preprocessing.

Thank you for creating this framework and making the code available!

Kinds regards,
Nathalia

Hi @nathalia-kim

The losses in the tutorial aren't representative since the model hasn't finished training, yours looks much better! The actual value of the loss/elbo depends on lots of things (# cells, # markers, # cell types) so I wouldn't worry. Much more important to critique the cell type assignments (do they overexpress the markers they're supposed to?). Sometimes playing with the cofactor can help too.

Let us know if any more questions,

Thanks

Thanks so much for your quick reply, @kieranrcampbell! I'm closing this issue.