cherry.plot

Description

Plotting utilities for reproducible research.

ci95

ci95(values)

[Source]

Description

Computes the 95% confidence interval around the given values.

Arguments

Returns

Example

from statistics import mean
smoothed = []
for replay in replays:
    rewards = replay.rewards.view(-1).tolist()
    y_smoothed = ch.plot.smooth(rewards)
    smoothed.append(y_smoothed)
means = [mean(r) for r in zip(*smoothed)]
confidences = [ch.plot.ci95(r) for r in zip(*smoothed)]
lower_bound = [conf[0] for conf in confidences]
upper_bound = [conf[1] for conf in confidences]

exponential_smoothing

exponential_smoothing(x, y=None, temperature=1.0)

[Source]

Decription

Two-sided exponential moving average for smoothing a curve.

It performs regular exponential moving average twice from two different sides and then combines the results together.

Arguments

Return

Credit

Adapted from OpenAI's baselines implementation.

Example

from cherry.plot import exponential_smoothing
x_smoothed, y_smoothed, _ = exponential_smoothing(x_original,
                                                  y_original,
                                                  temperature=3.)