updates and debugs

This commit is contained in:
Eren Golge
2018-02-13 01:45:52 -08:00
parent dadefb5dbc
commit 56697ac8cf
10 changed files with 121 additions and 63 deletions
+2 -3
View File
@@ -14,9 +14,8 @@ def prepare_data(inputs):
return np.stack([pad_data(x, max_len) for x in inputs])
def pad_per_step(inputs, outputs_per_step):
"""zero pad inputs if it is not divisible with outputs_per_step (r)"""
def pad_per_step(inputs, pad_len):
timesteps = inputs.shape[-1]
return np.pad(inputs, [[0, 0], [0, 0],
[0, outputs_per_step - (timesteps % outputs_per_step)]],
[0, pad_len]],
mode='constant', constant_values=0.0)