hfawaz / aaltd18

Data augmentation using synthetic data for time series classification with deep residual networks
GNU General Public License v3.0
183 stars 42 forks source link

problem in augment.py #5

Closed chenfei0328 closed 5 years ago

chenfei0328 commented 5 years ago

Hi, I found that there might be a problem in function get_weights_average_selected which in augment.py.

In line 57, final_neighbors_idx = np.random.permutation(k)[:subk] What if random indexs consist of the idx_center ? It might cover the idx_center so that the weights vector may not include the weight of 0.5 of the init_dba.

Therefore I added new code after the line. while idx_center in topk_idx[final_neighbors_idx]: final_neighbors_idx = np.random.permutation(k)[:subk]

What do you think?

hfawaz commented 5 years ago

Hi,

Nice pointing it out, thanks for sharing!

Glad to see people benefiting from the code as well as contributing.

chenfei0328 commented 5 years ago

Thanks for your reply! :)