Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: d49c45b58a
Fetching contributors…

Cannot retrieve contributors at this time

26 lines (19 sloc) 0.466 kb
import numpy as NP
import sys
import os, os.path
basefn = sys.argv[1]
T = int(sys.argv[2])
vocab = [line.strip() for line in open('%s.vocab' % basefn)]
W = len(vocab)
alpha = float(50) / T
alphaf = open('%s.alpha' % basefn, 'w')
for ti in range(T):
alphaf.write('%f ' % alpha)
alphaf.close()
beta = 0.01
betaf = open('%s.beta' % basefn, 'w')
for ti in range(T):
for wi in range(W):
betaf.write('%f ' % beta)
betaf.write('\n')
betaf.close()
Jump to Line
Something went wrong with that request. Please try again.