-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reason of the question"StopIteration" #68
Comments
Is this the intent of the author or a bug in the program |
If I want to iterate more times to better train the model, how can I improve the problem |
Maybe this is a small mistake. Perhaps you can refer to the following modification code:
|
OK, thanks very much👍
… 在 2020年5月3日,下午9:22,shenjian5 ***@***.***> 写道:
Maybe this is a small mistake. Perhaps you can refer to the following modification code:
def generate_train_batch(self, seq_len, batch_size, normalise):
'''Yield a generator of training data from filename on given list of cols split for train/test'''
i = 0
x_batch = []
y_batch = []
# while i < (self.len_train - seq_len):
while True:
for b in range(batch_size):
x, y = self._next_window(i, seq_len, normalise)
x_batch.append(x)
y_batch.append(y)
i += 1
if i == (self.len_train - seq_len):
# stop-condition for a smaller final batch if data doesn't divide evenly
i = 0
yield np.array(x_batch), np.array(y_batch)
x_batch = []
y_batch = []
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
尊敬的人资负责人:
您好!
我想咨询一下关于暑期实习的问题,我是一名本科应届毕业生,目前已保送至中科大读研,希望通过实习来开拓视野,长长见识。请问这种情况有没有在今年暑期获取华为实习的机会呢,主要考虑技术研发岗位。
| |
HITWH LIZHOGN
|
|
[email protected]
|
签名由网易邮箱大师定制
|
@shenjian5 It works for me.Thanks~! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In the founction "generate_train_batch" belong to dara_processor.py.
i = 0
while i < (self.len_train - seq_len):
x_batch = []
y_batch = []
for b in range(batch_size):
if i >= (self.len_train - seq_len):
# stop-condition for a smaller final batch if data doesn't divide evenly
yield np.array(x_batch), np.array(y_batch)
i = 0
x, y = self._next_window(i, seq_len, normalise)
x_batch.append(x)
y_batch.append(y)
i += 1
yield np.array(x_batch), np.array(y_batch)
sometimes, i==self.len_train-seq_len. So it cannot satisfy the while loop .
The text was updated successfully, but these errors were encountered: