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 818b4b4

Browse files
Merge pull request MorvanZhou#61 from keineahnung2345/403-comment
403 - move the comment to right place
2 parents 0b3aa23 + 256559c commit 818b4b4

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)')
@@ -77,8 +77,8 @@ 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)
81-
x_np = np.sin(steps)# float32 for converting torch FloatTensor
80+
steps = np.linspace(start, end, TIME_STEP, dtype=np.float32)# float32 for converting torch FloatTensor
81+
x_np = np.sin(steps)
8282
y_np = np.cos(steps)
8383

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

0 commit comments

Comments
(0)

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