Last active
December 7, 2015 19:23
-
-
Save zafarali/80a2228673808b780dab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# time_values is a signal of shape: (time, n_channels) | |
# window data tensor is of shape: (time, window_size, n_channels) | |
# where window_size just holds all the data for the T-window_size data. | |
window_data_tensor = np.zeros((time_values.shape[0], window_size, time_values.shape[1])) | |
for t in range(1, time_values.shape[0]): | |
if t <= window_size: | |
window_data_tensor[t, :, :] = np.pad(time_values[:t, :], ((0, window_size-t), (0,0)), mode='constant') | |
elif t > window_size and t < time_values.shape[0]-window_size+1: | |
window_data_tensor[t, :, :] = np.array(time_values[t: t+window_size, :]) | |
else: | |
window_data_tensor[t, :, :] = np.array() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment