fchollet / deep-learning-with-python-notebooks

Jupyter notebooks for the code samples of the book "Deep Learning with Python"
MIT License
18.17k stars 8.53k forks source link

3.7 question about Exponential Moving Average #121

Closed myhott163com closed 5 years ago

myhott163com commented 5 years ago

in chapter 3.7, it mentioned that use Exponential Moving Average to to obtain a smooth curve, and the code of this is: smoothed_points.append(previous factor + point (1 - factor))

However, it seems that the formula of Exponential Moving Average is: EMAtoday=α Pricetoday + ( 1 - α ) EMAyesterday

So, if this formula is correct, the code of computing Exponential Moving Average shoule be: point factor + (1 - factor) previous

Thus, is the code in the book correct or not? And why is the factor = 0.9? Please give me some help.