You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
where train_seq is a keras.utils.Sequence implemented by the following code:
def cnn_pad(data, pad_frames):
"""Pad the data by repeating the first and last frame N times."""
pad_start = np.repeat(data[:1], pad_frames, axis=0)
pad_stop = np.repeat(data[-1:], pad_frames, axis=0)
return np.concatenate((pad_start, data, pad_stop))
class DataSequence(Sequence):
def __init__(self, x, y, fps=FPS, pad_frames=None):
self.x = x
y_proc = np.zeros(np.shape(x)[1])
np.add.at(y_proc, y[0]*FPS, 1)
self.y = [y_proc]
self.pad_frames = pad_frames
def __len__(self):
return len(self.x)
def __getitem__(self, idx):
x = np.array(cnn_pad(self.x[idx], self.pad_frames))[np.newaxis, ..., np.newaxis]
y = self.y[idx][np.newaxis, ..., np.newaxis]
return x, y
x = [np.random.randn(1949, 81)] # to emulate audio
y = [np.asarray([1, 2, 3, 4, 5])] # to emulate annotations
train_seq = DataSequence(x[:1], y[:1], pad_frames=2)
How may I use LRFinder for this type of data? Ie, is it possible to "retrieve" valid x and y from the Sequence?
To reproduce this issue (almost in entirety, with the exception of the keras h5 model), here is some dummy code:
The text was updated successfully, but these errors were encountered:
I'm using 3rd party working code that fits a TCN-based model with
where
train_seq
is akeras.utils.Sequence
implemented by the following code:How may I use LRFinder for this type of data? Ie, is it possible to "retrieve" valid
x
andy
from theSequence
?To reproduce this issue (almost in entirety, with the exception of the keras h5 model), here is some dummy code:
The text was updated successfully, but these errors were encountered: