This file contains hidden or 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 time import time | |
import logging | |
import numpy as np | |
from sklearn.datasets import fetch_20newsgroups | |
from sklearn.feature_extraction.text import CountVectorizer | |
from sklearn.decomposition import LatentDirichletAllocation | |
from gensim.matutils import Sparse2Corpus | |
#from gensim.models.ldamodel import LdaModel | |
from gensim.models.ldamulticore import LdaMulticore |
This file contains hidden or 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
''' | |
Gibbs sampler for function: | |
f(x,y) = x x^2 \exp(-xy^2 - y^2 + 2y - 4x) | |
using conditional distributions: | |
x|y \sim Gamma(3, y^2 +4) | |
y|x \sim Normal(\frac{1}{1+x}, \frac{1}{2(1+x)}) | |
''' |