예제 #1
0
def compute_perplexities(vals, test_data, smoothing):
    return [np.exp(-log_likelihood(test_data, wordprobs(test_data, val))
            / test_data.sum()) for val in vals]
예제 #2
0
def compute_perplexities(vals, test_data, smoothing):
    return [
        np.exp(-log_likelihood(test_data, wordprobs(test_data, val)) /
               test_data.sum()) for val in vals
    ]
예제 #3
0
def compute_loglikes(vals, train_data, smoothing):
    return [log_likelihood(train_data, wordprobs(train_data, val))
            for val in vals]
예제 #4
0
def compute_loglikes(vals, train_data, smoothing):
    return [
        log_likelihood(train_data, wordprobs(train_data, val)) for val in vals
    ]