Question 5/13 fast.ai v3 lecture 9


The LogSumExp trick above relies on properties of logarithms. We can subtract a number from our xs and add it at the front without affecting the result. What are the benefits of the LogSumExp?

Answer

It helps us address numerical stability by allowing us to operate on much smaller floating point numbers

Relevant part of lecture

supplementary material

A good way of leveraging the LogSumExp trick is to set a to the max of all xs.