ast_toolbox.utils.exp_utils module

ast_toolbox.utils.exp_utils.log_mean_exp(x, dim)[source]

Compute the log(mean(exp(x), dim)) in a numerically stable manner

ast_toolbox.utils.exp_utils.log_sum_exp(x, dim)[source]

Compute the log(sum(exp(x), dim)) in a numerically stable manner

ast_toolbox.utils.exp_utils.softmax(x, dim)[source]

Compute softmax values for each sets of scores in x along dim