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

Miss the "grid_search.py" file for 2nd assignment #3

Closed
jmuth opened this issue Sep 27, 2016 · 2 comments
Closed

Miss the "grid_search.py" file for 2nd assignment #3

jmuth opened this issue Sep 27, 2016 · 2 comments

Comments

@jmuth
Copy link

jmuth commented Sep 27, 2016

Miss the "grid_search.py" file for 2nd assignment.
@glederrey

import numpy as np

def generate_w(num_intervals = 10):
    w0 = np.linspace(-100.0, 200.0, num_intervals)
    w1 = np.linspace(-150.0, 150.0, num_intervals)
    return (w0, w1)

def get_best_parameters(grid_w0, grid_w1, grid_losses):
    flat_index = np.argmin(grid_losses)
    index = np.unravel_index(flat_index, grid_losses.shape)

    return (grid_losses.flat[flat_index], grid_w0[index[0]], grid_w1[index[1]])

@martinjaggi
Copy link
Member

thanks, in the meantime i have pushed this missing file. let us know if it works

@jmuth
Copy link
Author

jmuth commented Sep 27, 2016

works perfectly, thanks

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