Search code examples
matlabneural-networksimulationtraining-datadata-fitting

How to denormalize the output in a Neural Network (MATLAB)?


I'm a junior in neural networks and I have a NN that is trained to fit the input data with the target data and then simulate the NN on a new sample data to get a prediction output.

The problem is the output is normalized values that are between "zero" and "one" and I need to transform (denormalize) them to real values like "decimals".

Could you explain how to do this?

I've read that I have to use an activation function, but I didn't understand how to do this.


Solution

  • When the training set was created and you normalize the output values, you probably used min-max normalization (or mean-std normalization):

    z = (x - min) / (max - min)
    

    Where z is the normalized output. To get the unnormalized value, you just have to store the min and max values used for normalization, then invert the equation:

    x = (max - min) * z + min
    

    For other kinds of normalization, the same procedure is done. Just remember that the normalization factors have to be obtained from the original training set.