<commit_before>"""
PGM for the general problem using daft (http://daft-pgm.org/)
"""

from matplotlib import rc
rc("font", family="serif", size=12)
rc("text", usetex=True)

import daft

pgm = daft.PGM([5., 4.], origin=[-2.5, -1.5])

# Create the nodes
pgm.add_node(daft.Node('alpha', r'$\alpha$', 0., 2.))
pgm.add_node(daft.Node('x', r'$\mathbf{x}_i$', 0., 0.))
pgm.add_node(daft.Node('data', r'$\mathcal{D}$', 2., 0., observed=True))
pgm.add_node(daft.Node('N', r'$N$', -2., 0.))
pgm.add_node(daft.Node('hidden', r'', -1., 0., scale=0, plot_params={'alpha':0}))

# Add the edges
pgm.add_edge('alpha', 'x')
pgm.add_edge('x', 'data')
pgm.add_edge('N', 'hidden')

# Add the plates
pgm.add_plate(daft.Plate([-1., -1., 2., 2.], label=r'Objects $i=1, ..., N$'))

pgm.render()
pgm.figure.savefig("pgm.eps")
pgm.figure.savefig("pgm.pdf")

<commit_msg>Bold alpha<commit_after>"""
PGM for the general problem using daft (http://daft-pgm.org/)
"""

import matplotlib
from matplotlib import rc
rc("font", family="serif", size=12)
rc("text", usetex=True)
matplotlib.rcParams['text.latex.preamble']=[r"\usepackage{amsmath}"]

import daft

pgm = daft.PGM([5., 4.], origin=[-2.5, -1.5])

# Create the nodes
pgm.add_node(daft.Node('alpha', r'$\boldsymbol{\alpha}$', 0., 2.))
pgm.add_node(daft.Node('x', r'$\mathbf{x}_i$', 0., 0.))
pgm.add_node(daft.Node('data', r'$\mathcal{D}$', 2., 0., observed=True))
pgm.add_node(daft.Node('N', r'$N$', -2., 0.))
pgm.add_node(daft.Node('hidden', r'', -1., 0., scale=0, plot_params={'alpha':0}))

# Add the edges
pgm.add_edge('alpha', 'x')
pgm.add_edge('x', 'data')
pgm.add_edge('N', 'hidden')

# Add the plates
pgm.add_plate(daft.Plate([-1., -1., 2., 2.], label=r'Objects $i=1, ..., N$'))

pgm.render()
pgm.figure.savefig("pgm.eps")
pgm.figure.savefig("pgm.pdf")


{'fraction_non_alphanumeric': 0.26442577030812325, 'fraction_numerical': 0.028011204481792718, 'mean_word_length': 4.953333333333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3180855', 'n_tokens_mistral': 823, 'n_tokens_neox': 791, 'n_words': 150}