Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Documentation Plotting Script #58

Closed
araffin opened this issue Mar 14, 2018 · 2 comments
Closed

Missing Documentation Plotting Script #58

araffin opened this issue Mar 14, 2018 · 2 comments

Comments

@araffin
Copy link

araffin commented Mar 14, 2018

Hello,
Although I understand the general idea of the plotting script (smooth the reward curve), I have some trouble to understand the different functions in detail.

First, what is the idea behind fix_point(x, y, interval) ?

Then, in the smoothing function:

def smooth_reward_curve(x, y):
    # Halfwidth of our smoothing convolution
    halfwidth = min(31, int(np.ceil(len(x) / 30)))
    k = halfwidth
    xsmoo = x[k:-k]
    ysmoo = np.convolve(y, np.ones(2 * k + 1), mode='valid') / \
        np.convolve(np.ones_like(y), np.ones(2 * k + 1), mode='valid')
    downsample = max(int(np.floor(len(xsmoo) / 1e3)), 1)
    return xsmoo[::downsample], ysmoo[::downsample]

What does 30 and 31 correspond to in halfwidth = min(31, int(np.ceil(len(x) / 30))) ?

PS: the two links at the top of the script are dead link now...

@ikostrikov
Copy link
Owner

Hi, I took this code from @emansim . I think he can provide a better explanation.

@ikostrikov
Copy link
Owner

I'm going to get rid of the current plotting. So I'm closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants