Skip to content

Instantly share code, notes, and snippets.

View stemangiola's full-sized avatar

Stefano Mangiola stemangiola

View GitHub Profile
@vals
vals / Exploratory analysis with scVI.ipynb
Last active April 13, 2024 18:23
Exploratory analysis with scVI
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
## from http://tr.im/hH5A
logsumexp <- function (x) {
y = max(x)
y + log(sum(exp(x - y)))
}
softmax <- function (x) {
exp(x - logsumexp(x))
}