Esempio n. 1
0
def main(wd):
    corpus_fn = sys.argv[2]

    exp = Exp(corpus_fn, wd)

    pool = Pool(processes=8)
    #bits = [6]
    #bits = [6, 7, 8, 9, 10, 11, 12, 14, 16]
    #bits = [11,12,14,16]
    #levels = [2**i for i in (3,4,5,6,7,8,9,10,11,12)]
    #levels = [2**i for i in range(3, 13)]
    levels = range(16, 65) + [2**i for i in range(7, 13)]
    #levels = range(16, 65)
    #levels = [4096]
    #levels = [2**10, 2**12]
    #levels = [16]
    cutoffs = [-20]
    distances = ["kullback"]
    emissions = ["c"]
    type_ = ['sze_{0}'.format(sys.argv[3])]
    state_bits = ["u"]
    #state_bits = ["e"]
    options = list(generate_options(levels, cutoffs, distances, emissions, type_, state_bits))
    res = pool.map(run_exp, [(exp,) + o for o in options])
    for r in res:
        r = [("{0:4.5}".format(_) if type(_) == float else str(_)) for _ in r]
        print "\t".join(r)
Esempio n. 2
0
def main(wd):
    corpus_fn = "../data/lemma_count.tab"

    exp = Exp(corpus_fn, wd)

    pool = Pool(processes=1)
    levels = [14] + [2**b for b in [6, 7, 8, 9, 10, 11, 12, 14, 16]]
    levels = [14]
    cutoffs = [-20]
    distances = ["kullback"]
    emissions = ["c", "m"]
    emissions = ["c"]
    type_ = ["l", "3", ["hogy"], "a"]
    type_ = ["l"]
    type_ = ["3"]
    state_bits = ["u", "e"]
    state_bits = ["u"]
    options = list(generate_options(levels, cutoffs, distances, emissions, type_,
                                    state_bits))
    res = pool.map(run_exp, [(exp,) + o for o in options])
    for r in res:
        r = [("{0:4.5}".format(_) if type(_) == float else str(_)) for _ in r]
        print "\t".join(r)