dataset stretch now optional

This commit is contained in:
Si11ium 2020-05-15 09:43:29 +02:00
parent 2c4d903fa2
commit d929149a15

View File

@ -9,6 +9,8 @@ class Speed(object):
self.max_ratio = max_ratio
def __call__(self, x):
if not all([self.speed_factor, self.max_ratio]):
return x
start = int(np.random.randint(0, x.shape[-1],1))
end = int((np.random.uniform(0, self.max_ratio, 1) * x.shape[-1]) + start)
end = min(end, x.shape[-1])