Skip to content

Commit 9626a06

Browse files
authored
Merge pull request #66 from jingege315/patch-1
循环的最后一个元素和下一次循环的第一个元素时间不连续
2 parents 51c6c66 + 7f0e442 commit 9626a06

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tutorial-contents/403_RNN_regressor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def forward(self, x, h_state):
7777
for step in range(100):
7878
start, end = step * np.pi, (step+1)*np.pi # time range
7979
# use sin predicts cos
80-
steps = np.linspace(start, end, TIME_STEP, dtype=np.float32) # float32 for converting torch FloatTensor
80+
steps = np.linspace(start, end, TIME_STEP, dtype=np.float32, endpoint=False) # float32 for converting torch FloatTensor
8181
x_np = np.sin(steps)
8282
y_np = np.cos(steps)
8383

0 commit comments

Comments
 (0)