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

Various improvements #19

Open
12 tasks
mathurinm opened this issue Nov 21, 2019 · 0 comments
Open
12 tasks

Various improvements #19

mathurinm opened this issue Nov 21, 2019 · 0 comments

Comments

@mathurinm
Copy link
Collaborator

mathurinm commented Nov 21, 2019

  • get rid of def get_alpha_max_mtl(X, Y), get_alpha_max_sgcl etc and hardcode them into get_alpha_max

  • res = norm(R.T @ (Sigma_inv @ R), ord=ord)
    return res > return norm(...)

  • R[l, :, :] > R[l]

  • result = l_2_inf(X.T @ Sigma_max_inv @ Y)
    result /= (n_sensors * n_times) > do the division on the previous line

  • _, Sigma_max_inv = clp_sqrt(
    cov_Yl, sigma_min) > no need to breakline (appears at other locations)

  • pb_name == "MTL" > dangerous, use pb_name=pb_name.lower() in the beginning and use lowercase later for comparison

  • do we really need the data submodule? the functions could go into utils.py

  • There are occurrences of n_epochs, _, _ = R_all_epochs.shape > use shape[0]

  • def normalize(X):
    for i in range(X.shape[1]):
    X[:, i] /= norm(X[:, i])
    return X > use broadcasting directly X /= np.linalg.norm(X, axis=0)[None, :]

  • dictionary > design

  • toeplitz(vect, vect) > second vect is not necessary and this variable can be avoided

  • Often the default parameters are still passed in the function which makes the code harder to read, they can be removed for readability

@QB3

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

1 participant