Skip to content

Commit b5c905c

Browse files
[DOCS-1410] Updates to smoothing algorithm docs (#1270)
[DOCS-1410] Updates to smoothing algorithm docs - Remove deprecation notice from EMA smoothing section, adjust its content a bit - Explain more about EMA smoothing section - Add alt text to images - Other minor copyedits --------- Co-authored-by: Danny Goldstein <dgold@berkeley.edu>
1 parent ec41b18 commit b5c905c

1 file changed

Lines changed: 30 additions & 29 deletions

File tree

  • content/guides/models/app/features/panels/line-plot

content/guides/models/app/features/panels/line-plot/smoothing.md

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,22 @@ title: Smooth line plots
88
weight: 30
99
---
1010

11-
W&B supports three types of smoothing:
11+
W&B supports several types of smoothing:
1212

13-
- [exponential moving average]({{< relref "smoothing.md#exponential-moving-average-default" >}}) (default)
14-
- [gaussian smoothing]({{< relref "smoothing.md#gaussian-smoothing" >}})
15-
- [running average]({{< relref "smoothing.md#running-average" >}})
16-
- [exponential moving average - Tensorboard]({{< relref "smoothing.md#exponential-moving-average-deprecated" >}}) (deprecated)
13+
- [Time weighted exponential moving average (TWEMA) smoothing]({{< relref "#time-weighted-exponential-moving-average-twema-smoothing-default" >}})
14+
- [Gaussian smoothing]({{< relref "#gaussian-smoothing" >}})
15+
- [Running average]({{< relref "#running-average-smoothing" >}})
16+
- [Exponential moving average (EMA) smoothing]({{< relref "#exponential-moving-average-ema-smoothing" >}})
1717

1818
See these live in an [interactive W&B report](https://wandb.ai/carey/smoothing-example/reports/W-B-Smoothing-Features--Vmlldzo1MzY3OTc).
1919

20-
{{< img src="/images/app_ui/beamer_smoothing.gif" alt="" >}}
20+
{{< img src="/images/app_ui/beamer_smoothing.gif" alt="Demo of various smoothing algorithms" >}}
2121

22-
## Exponential Moving Average (Default)
22+
## Time Weighted Exponential Moving Average (TWEMA) smoothing (Default)
2323

24-
Exponential smoothing is a technique for smoothing time series data by exponentially decaying the weight of previous points. The range is 0 to 1. See [Exponential Smoothing](https://www.wikiwand.com/en/Exponential_smoothing) for background. There is a de-bias term added so that early values in the time series are not biased towards zero.
24+
The Time Weighted Exponential Moving Average (TWEMA) smoothing algorithm is a technique for smoothing time series data by exponentially decaying the weight of previous points. For details about the technique, see [Exponential Smoothing](https://www.wikiwand.com/en/Exponential_smoothing). The range is 0 to 1. There is a de-bias term added so that early values in the time series are not biased towards zero.
2525

26-
The EMA algorithm takes the density of points on the line (the number of `y` values per unit of range on x-axis) into account. This allows consistent smoothing when displaying multiple lines with different characteristics simultaneously.
26+
The TWEMA algorithm takes the density of points on the line (the number of `y` values per unit of range on x-axis) into account. This allows consistent smoothing when displaying multiple lines with different characteristics simultaneously.
2727

2828
Here is sample code for how this works under the hood:
2929

@@ -47,33 +47,38 @@ return yValues.map((yPoint, index) => {
4747

4848
Here's what this looks like [in the app](https://wandb.ai/carey/smoothing-example/reports/W-B-Smoothing-Features--Vmlldzo1MzY3OTc):
4949

50-
{{< img src="/images/app_ui/weighted_exponential_moving_average.png" alt="" >}}
50+
{{< img src="/images/app_ui/weighted_exponential_moving_average.png" alt="Demo of TWEMA smoothing" >}}
5151

52-
## Gaussian Smoothing
52+
## Gaussian smoothing
5353

54-
Gaussian smoothing (or gaussian kernel smoothing) computes a weighted average of the points, where the weights correspond to a gaussian distribution with the standard deviation specified as the smoothing parameter. See . The smoothed value is calculated for every input x value.
55-
56-
Gaussian smoothing is a good standard choice for smoothing if you are not concerned with matching TensorBoard's behavior. Unlike an exponential moving average the point will be smoothed based on points occurring both before and after the value.
54+
Gaussian smoothing (or Gaussian kernel smoothing) computes a weighted average of the points, where the weights correspond to a gaussian distribution with the standard deviation specified as the smoothing parameter. The smoothed value is calculated for every input x value, based on the points occurring both before and after it.
5755

5856
Here's what this looks like [in the app](https://wandb.ai/carey/smoothing-example/reports/W-B-Smoothing-Features--Vmlldzo1MzY3OTc#3.-gaussian-smoothing):
5957

60-
{{< img src="/images/app_ui/gaussian_smoothing.png" alt="" >}}
58+
{{< img src="/images/app_ui/gaussian_smoothing.png" alt="Demo of gaussian smoothing" >}}
6159

62-
## Running Average
60+
## Running average smoothing
6361

6462
Running average is a smoothing algorithm that replaces a point with the average of points in a window before and after the given x value. See "Boxcar Filter" at [https://en.wikipedia.org/wiki/Moving_average](https://en.wikipedia.org/wiki/Moving_average). The selected parameter for running average tells Weights and Biases the number of points to consider in the moving average.
6563

66-
Consider using Gaussian Smoothing if your points are spaced unevenly on the x-axis.
64+
Consider using Gaussian Smoothing instead if your points are spaced unevenly on the x-axis.
65+
66+
Here's what this looks like [in the app](https://wandb.ai/carey/smoothing-example/reports/W-B-Smoothing-Features--Vmlldzo1MzY3OTc#4.-running-average):
6767

68-
The following image demonstrates how a running app looks like [in the app](https://wandb.ai/carey/smoothing-example/reports/W-B-Smoothing-Features--Vmlldzo1MzY3OTc#4.-running-average):
68+
{{< img src="/images/app_ui/running_average.png" alt="Demo of running average smoothing" >}}
6969

70-
{{< img src="/images/app_ui/running_average.png" alt="" >}}
70+
## Exponential Moving Average (EMA) smoothing
7171

72-
## Exponential Moving Average (Deprecated)
72+
The Exponential Moving Average (EMA) smoothing algorithm is a rule of thumb technique for smoothing time series data using the exponential window function. For details about the technique, see [Exponential Smoothing](https://www.wikiwand.com/en/Exponential_smoothing). The range is 0 to 1. A debias term is added so that early values in the time series are not biases towards zero.
7373

74-
> The TensorBoard EMA algorithm has been deprecated as it cannot accurately smooth multiple lines on the same chart that do not have a consistent point density (number of points plotted per unit of x-axis).
74+
In many situations, EMA smoothing is applied to a full scan of history, rather than bucketing first before smoothing. This often produces more accurate smoothing.
7575

76-
Exponential moving average is implemented to match TensorBoard's smoothing algorithm. The range is 0 to 1. See [Exponential Smoothing](https://www.wikiwand.com/en/Exponential_smoothing) for background. There is a debias term added so that early values in the time series are not biases towards zero.
76+
In the following situations, EMA smoothing is after bucketing instead:
77+
- Sampling
78+
- Grouping
79+
- Expressions
80+
- Non-monotonic x-axes
81+
- Time-based x-axes
7782

7883
Here is sample code for how this works under the hood:
7984

@@ -88,14 +93,10 @@ Here is sample code for how this works under the hood:
8893
8994
Here's what this looks like [in the app](https://wandb.ai/carey/smoothing-example/reports/W-B-Smoothing-Features--Vmlldzo1MzY3OTc):
9095
91-
{{< img src="/images/app_ui/exponential_moving_average.png" alt="" >}}
92-
93-
## Implementation Details
94-
95-
All of the smoothing algorithms run on the sampled data, meaning that if you log more than 1500 points, the smoothing algorithm will run _after_ the points are downloaded from the server. The intention of the smoothing algorithms is to help find patterns in data quickly. If you need exact smoothed values on metrics with a large number of logged points, it may be better to download your metrics through the API and run your own smoothing methods.
96+
{{< img src="/images/app_ui/exponential_moving_average.png" alt="Demo of EMA smoothing" >}}
9697
9798
## Hide original data
9899
99-
By default we show the original, unsmoothed data as a faint line in the background. Click the **Show Original** toggle to turn this off.
100+
By default, the original unsmoothed data displays in the plot as a faint line in the background. Click **Show Original** to turn this off.
100101
101-
{{< img src="/images/app_ui/demo_wandb_smoothing_turn_on_and_off_original_data.gif" alt="" >}}
102+
{{< img src="/images/app_ui/demo_wandb_smoothing_turn_on_and_off_original_data.gif" alt="Turn on or off original data" >}}

0 commit comments

Comments
 (0)