zhusuan.utils

log_mean_exp(x, dim=None, keepdims=False)[source]

Numerically stable log mean of exps across the dim. :param x: A Tensor. :param dim: An int or list or tuple. The dimensions to reduce.

If None (the default), reduces all dimensions.

Parameters

keepdims – Bool. If true, retains reduced dimensions with length 1. Default to be False.

Returns

A Tensor after the computation of log mean exp along given axes of x.