I was going through the book "Deep Learning with Python" and came across the following:
def smooth_curve(points, factor=0.9):
smoothed_points = []
for point in points:
if smoothed_points:
previous = smoothed_points[-1]
smoothed_points.append(previous * factor + point * (1 - factor))
else:
smoothed_points.append(point)
return smoothed_points
smooth_mae_history = smooth_curve(average_mae_history[10:])
I've never seen this notation before, the 4th line of code "if smoothed_points". Smoothed_points is a list. I don't understand how lists can evaluate to either true or false in some orderly way.