Search code examples
tensorflowneural-networkkerasbatch-normalization

How do you de-normalise?


Once you do normalisation of your data so the values are between 0-1, how do you de-normalise it so you can interpret the result?

So when you normalise your data, and feed it to your network and get an output which is normalised data. How do you reverse normalisation to get the original data?


Solution

  • If you have some data d that you normalize to 0-1 by doing (something like)

    min_d = np.min(d)
    max_d = np.max(d)
    normalized_d = (d - min_d) / (max_d - min_d)
    

    you can de-normalize this by inverting the normalization. In this case

    denormalized_d = normalized_d * (max_d - min_d) + min_d