Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 256559c

Browse files
403 - move the comment to right place
1 parent 40bcdb5 commit 256559c

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎tutorial-contents/403_RNN_regressor.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
LR = 0.02 # learning rate
2121

2222
# show data
23-
steps = np.linspace(0, np.pi*2, 100, dtype=np.float32)
24-
x_np = np.sin(steps)# float32 for converting torch FloatTensor
23+
steps = np.linspace(0, np.pi*2, 100, dtype=np.float32)# float32 for converting torch FloatTensor
24+
x_np = np.sin(steps)
2525
y_np = np.cos(steps)
2626
plt.plot(steps, y_np, 'r-', label='target (cos)')
2727
plt.plot(steps, x_np, 'b-', label='input (sin)')
@@ -71,8 +71,8 @@ def forward(self, x, h_state):
7171
for step in range(100):
7272
start, end = step * np.pi, (step+1)*np.pi # time range
7373
# use sin predicts cos
74-
steps = np.linspace(start, end, TIME_STEP, dtype=np.float32)
75-
x_np = np.sin(steps)# float32 for converting torch FloatTensor
74+
steps = np.linspace(start, end, TIME_STEP, dtype=np.float32)# float32 for converting torch FloatTensor
75+
x_np = np.sin(steps)
7676
y_np = np.cos(steps)
7777

7878
x = torch.from_numpy(x_np[np.newaxis, :, np.newaxis]) # shape (batch, time_step, input_size)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /