/ hist[-self.window_size-1:-1])
mean = diff.mean()
// unbiased std of mean
std = diff.std() / (self.window_size - 1)**.5
t = abs(mean / std)
p = stats.t.cdf(t, df=self.window_size) - .5
// 1 - confidence is lower allowed p
if p < self.critical:
raise StopIteration
After Change
if self.steps is None:
window = int(max(0.1 * hist.size // self.every, 2.0))
else:
window = int(max(0.1 * self.steps // self.every, 2.0))
losses = hist[::self.every][-window:]
diff = np.abs((losses[1:]-losses[:-1])/losses[:-1])
mean = np.mean(diff)
med = np.median(diff)