torchbp.ops.entropy module

torchbp.ops.entropy.entropy(img)[source]

Calculates entropy of:

-sum(y*log(y))

, where y = abs(x) / sum(abs(x)).

Uses less memory than pytorch implementation when used in optimization.

Parameters:

img (Tensor) – 2D radar image in [range, angle] format. Dimensions should match with grid_polar grid. [nbatch, range, angle] if interpolating multiple images at the same time.

Returns:

out – Interpolated radar image.

Return type:

Tensor