Description
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
Reactions are currently unavailable
You can’t perform that action at this time.
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 comparisondo 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