This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"_start": 2019, | |
"_end": 2021, | |
"_citation": null, | |
"_mdate": 1625056932.691998, | |
"_json": { | |
"abstract-citations-response": { | |
"h-index": "1", | |
"identifier-legend": { | |
"identifier": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Union | |
import numpy as np | |
import torch | |
from torch.utils.data import Dataset, DataLoader | |
from scipy.sparse import (random, | |
coo_matrix, | |
csr_matrix, | |
vstack) | |
from tqdm import tqdm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(ggplot2) | |
gg.mixEM <- function(EM) { | |
require(ggplot2) | |
x <- with(EM,seq(min(x)-1,max(x)+1,len=1000)) | |
pars <- with(EM,data.frame(comp=colnames(posterior), mu, sigma,lambda)) | |
em.df <- data.frame(x=rep(x,each=nrow(pars)),pars) | |
em.df$y <- with(em.df,lambda*dnorm(x,mean=mu,sd=sigma)) | |
ggplot(data.frame(x=EM$x),aes(x,y=..density..)) + | |
geom_histogram(fill=NA,color="black",bins=41)+ |