質問編集履歴
3
コード追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -477,3 +477,121 @@
|
|
477
477
|
|
478
478
|
|
479
479
|
```
|
480
|
+
|
481
|
+
|
482
|
+
|
483
|
+
|
484
|
+
|
485
|
+
|
486
|
+
|
487
|
+
|
488
|
+
|
489
|
+
追記。。
|
490
|
+
|
491
|
+
```
|
492
|
+
|
493
|
+
for epoch in range(epochs):
|
494
|
+
|
495
|
+
|
496
|
+
|
497
|
+
print()
|
498
|
+
|
499
|
+
print(f'Epoch: {epoch+1}')
|
500
|
+
|
501
|
+
|
502
|
+
|
503
|
+
run_train()
|
504
|
+
|
505
|
+
|
506
|
+
|
507
|
+
extending_seq = train_seq[-test_size:].tolist()
|
508
|
+
|
509
|
+
|
510
|
+
|
511
|
+
run_test()
|
512
|
+
|
513
|
+
|
514
|
+
|
515
|
+
plt.figure(figsize=(12, 4))
|
516
|
+
|
517
|
+
plt.xlim(-20, len(y)+20)
|
518
|
+
|
519
|
+
plt.grid(True)
|
520
|
+
|
521
|
+
|
522
|
+
|
523
|
+
plt.plot(y.numpy())
|
524
|
+
|
525
|
+
|
526
|
+
|
527
|
+
plt.plot(
|
528
|
+
|
529
|
+
range(len(y)-test_size, len(y)),
|
530
|
+
|
531
|
+
extending_seq[-test_size:]
|
532
|
+
|
533
|
+
)
|
534
|
+
|
535
|
+
|
536
|
+
|
537
|
+
plt.show()
|
538
|
+
|
539
|
+
```
|
540
|
+
|
541
|
+
|
542
|
+
|
543
|
+
|
544
|
+
|
545
|
+
エラー内容
|
546
|
+
|
547
|
+
```Epoch: 1
|
548
|
+
|
549
|
+
-----------------------------------------------------------------------
|
550
|
+
|
551
|
+
NotImplementedError Traceback (most recent call last)
|
552
|
+
|
553
|
+
<ipython-input-212-863045c37b1e> in <module>
|
554
|
+
|
555
|
+
4 print(f'Epoch: {epoch+1}')
|
556
|
+
|
557
|
+
5
|
558
|
+
|
559
|
+
----> 6 run_train()
|
560
|
+
|
561
|
+
7
|
562
|
+
|
563
|
+
8 extending_seq = train_seq[-test_size:].tolist()
|
564
|
+
|
565
|
+
|
566
|
+
|
567
|
+
<ipython-input-206-e770668ef1d7> in run_train()
|
568
|
+
|
569
|
+
10 )
|
570
|
+
|
571
|
+
11
|
572
|
+
|
573
|
+
---> 12 train_predicted_label = model.forward(train_window)
|
574
|
+
|
575
|
+
13 train_loss = criterion(train_precicted_label, correct_label)
|
576
|
+
|
577
|
+
14
|
578
|
+
|
579
|
+
|
580
|
+
|
581
|
+
~/opt/anaconda3/lib/python3.8/site-packages/torch/nn/modules/module.py in _forward_unimplemented(self, *input)
|
582
|
+
|
583
|
+
173 registered hooks while the latter silently ignores them.
|
584
|
+
|
585
|
+
174 """
|
586
|
+
|
587
|
+
--> 175 raise NotImplementedError
|
588
|
+
|
589
|
+
176
|
590
|
+
|
591
|
+
177
|
592
|
+
|
593
|
+
|
594
|
+
|
595
|
+
NotImplementedError:
|
596
|
+
|
597
|
+
```
|
2
文法修正
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
SyntaxError: invalid syntax エラー Python
|
test
CHANGED
File without changes
|
1
文法修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -6,9 +6,9 @@
|
|
6
6
|
|
7
7
|
ご教授お願いいたします。
|
8
8
|
|
9
|
-
|
9
|
+
参考動画[リンク内容](https://www.youtube.com/watch?v=KeCK4ml4VVU&t=2178s) 13:41
|
10
|
-
|
10
|
+
|
11
|
-
```
|
11
|
+
```
|
12
12
|
|
13
13
|
import torch
|
14
14
|
|