From a8ac56a82fa7c3c55656fada363803207460d886 Mon Sep 17 00:00:00 2001 From: Jactus Date: Tue, 8 Dec 2020 17:49:52 +0800 Subject: [PATCH] Format --- qlib/contrib/model/pytorch_gats_ts.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/qlib/contrib/model/pytorch_gats_ts.py b/qlib/contrib/model/pytorch_gats_ts.py index 7706c4d28..7b0669dba 100644 --- a/qlib/contrib/model/pytorch_gats_ts.py +++ b/qlib/contrib/model/pytorch_gats_ts.py @@ -32,13 +32,12 @@ from ...contrib.model.pytorch_gru import GRUModel class DailyBatchSampler(Sampler): - def __init__(self, data_source): self.data_source = data_source self.data = self.data_source.data.loc[self.data_source.get_index()] - self.daily_count = self.data.groupby(level=0).size().values # calculate number of samples in each batch - self.daily_index = np.roll(np.cumsum(self.daily_count), 1) # calculate begin index of each batch + self.daily_count = self.data.groupby(level=0).size().values # calculate number of samples in each batch + self.daily_index = np.roll(np.cumsum(self.daily_count), 1) # calculate begin index of each batch self.daily_index[0] = 0 def __iter__(self):