You can use the Exponential Moving Average method. This method is used in tensorbaord as a way to smoothen a loss curve plot.
The algorithm is as follow:
However there is a small problem doing it this way. As you can see S_t is initialized with the starting value, which makes the starting curve inaccurate.
The green curve is the ideal curve for the ...