Hi!!
I am new to pytorch and learning how to create models using this library. I stumbled upon a problem which I am not satisfied with the result. I have time-series rainfall data of 2 locations (say) of sparse nature. I have another time-series discharge data of the same corresponding timestamp. I was trying to implement message passing technique on the rainfall data to predict the output.
The problem that I am facing is that, I am unable to capture the noise present in the data. Normalization is making the model predict within a certain range and the loss (MSE) is very high, and also facing the problem of vanishing gradient. Without normalization, the model is running fine but it still can’t capture the peaks in the data. I want to create a regression model and should be able to predict the output as accurately as possible. I have provided below a snapshot of the data I am working on. Anyone has any idea how to proceed in such cases. Like what sort of data preprocessing should I use? Any other idea is also welcome.
Below is the data I am working on: (It is time-series rainfall data at two location)
|0.16536|1.0815|
|0.2265|0.40153|
|9.2792|13.009|
|0|0.52373|
|5.2225|8.1669|
|9.155|8.5628|
|16.232|11.966|
|0|0|
|0|0|
|0.68834|0.42485|
|2.6633|3.2057|
|0.55367|0|
|0.42821|0.36416|
|0|0|
|0.52851|0|
|0|0|
|0.56329|2.3651|
|62.18|68.424|
|17.317|13.931|
|3.0101|2.2046|
|3.1223|2.195|
|0.42841|0.84839|
|0|0|
|0|0|
|0|0|
|0|0|
|0|3.9716|
|42.991|34.303|
|4.2095|10.829|
|4.3815|3.346|
|6.7946|7.0046|
|3.5685|3.9512|
|1.9721|1.689|
|0|1.0911|
|0.50898|1.2984|
|0|0|
|0|0.24441|
|2.5431|5.4309|
|11.86|8.0414|
|8.1427|7.0408|
|4.3814|5.1197|
|36.802|36.494|
|37.613|29.521|
|12.507|11.328|
|1.1586|0.91039|
|1.7551|2.4275|
|59.477|58.617|
|117.67|109.88|
|42.803|45.34|
|34.876|29.392|
|5.5668|4.4756|
|2.8691|2.0609|
|0.71369|0.79896|
|3.0449|1.0395|
|0.29588|0.86516|
|13.991|11.335|
|7.7794|6.6794|
|11.029|8.6004|
|0.83678|0.53255|
|0|0|
|3.4257|2.9133|
|0|0|
|0.27684|0|
|0.35685|0.30346|
|0|0|
|0.35685|0.30346|
|0|0|
|0|0.65467|
|4.8819|5.7815|
|9.9462|13.378|
|3.0643|3.5531|
|54.453|47.621|
|1.2719|0.82426|
|2.0581|1.3586|
|2.931|3.4094|
|0.53289|0.37278|
|10.148|8.011|
|0.95923|1.6467|
|15.341|14.092|
|27.876|22.478|
|16.308|13.339|
|6.9866|6.2161|
|0.11419|0|
|0|0|
|0|0|
|1.4274|1.6939|
|8.0268|6.6762|
|12.073|10.436|
|8.8614|8.5336|
|47.916|44.097|
|23.637|22.833|
|2.4682|1.8208|
|0.90741|0.81557|
|0|0|
|0|0|
|0|0|
|8.4158|7.6021|
|0.47954|0.7065|
|2.2549|1.7032|
|1.0325|8.3775|
|6.2831|4.0566|
|0.8944|0.67964|
|0|0|
|0|0|
|0|0|
|5.2605|4.2369|
|3.8944|2.7943|
|7.0062|6.4566|
|2.5711|3.7906|
|4.7231|3.7524|
|0|0|
|0|0|
|0|1.425|
|28.166|24.699|
|0.62062|1.6724|
|2.95|2.7186|
|5.7739|3.8542|
|0.11079|0|
|0|0|
|0|0|
|0|0|
|0|0|
|0|0|
|6.6902|4.3993|
|4.198|8.7643|
|12.299|17.737|
|42.404|40.307|
|0|0|
|0|0|
|0.73926|0.39229|
|2.4706|0.96544|
|0.74079|0.93956|
|16.941|20.445|
|2.8888|2.3161|
|228.12|223.08|
|119.89|126.83|
|17.481|13.835|
|11.571|10.083|
|0.54318|0.36997|
|3.5986|3.441|
|14.895|13.772|
|11.986|10.813|
|0.38155|0.20247|
|0|0|
|0.56104|0.2739|
|0|0|
|4.8039|2.3781|
|3.0893|2.4885|
|16.925|16.083|
|11.332|11.848|
|32.371|32.014|
|5.9992|5.0592|
|23.149|19.879|
|17.217|18.016|
|0.45489|0.28007|
|0.51168|1.4491|
|36.609|39.317|
|50.908|56.331|
|23.758|25.088|
|25.746|30.655|
|91.922|115.18|
|14.312|11.161|
|15.995|12.795|
|7.6038|5.8729|
|12.835|11.738|
|7.6304|3.8684|
|5.5476|5.4368|
|6.2778|8.4247|
|26.262|26.816|
|14.05|10.054|
|12.673|12.984|
|6.3795|6.2335|
|5.8158|4.4046|
|6.6592|4.8966|
|7.8674|7.3834|
|15.523|15.385|
|38.713|37.785|
|3.9541|2.543|
|0.45485|0.2818|
|1.5739|0.83519|
|0|0|
|3.8612|3.1003|
|19.09|15.346|
|0|0|
|0.27264|0.62568|
|43.807|47.71|
|12.939|10.416|
|37.469|52.284|
|1.1962|1.3695|
|6.7148|7.6671|
|22.741|22.165|
|2.8744|2.0202|
|9.0014|7.3895|
|37.929|35.096|
|3.2075|2.8871|
|9.159|9.3081|
|193.67|211.22|
|17.694|20.537|
|2.4756|1.7585|
|0.31688|0.25573|
|4.0687|3.4191|
|69.187|69.59|
|195.36|206.57|
|46.422|51.912|
|1.9917|1.6094|
|1.0139|0.82107|
|14.271|9.9503|
|8.8943|7.8079|
|2.1964|4.903|
|4.1732|2.2145|
|0|0|
|0|0|
|0|0|
|0|0|
|1.3717|0.73683|
|2.2893|1.2148|
|0|0|
|0.58186|0.77218|
|0.14506|0.11273|
|0|0|
|1.2158|0.6921|
|0|0|
|0|0|
|0|0|
|1.3593|0.7213|
|14.032|11.359|
|0|0|
|1.2903|3.6542|
|0.11787|0|
|1.7381|1.4076|
|0|0|
|0|0|
|1.4238|4.0322|
|0|0|
|0|0|
|0|0|
|0|0|
|0|0|
|0|0|
|3.3952|2.738|
|0|0|
|0.22247|0.63003|
|0.95802|0.95579|
|0|0|
|0.38125|0.19588|
|0|0|
|9.4257|10.853|
|1.6789|1.5367|
|0.31944|0.24292|
|0|0|
|3.665|2.591|
|1.9944|1.5653|
|0.78456|0.83141|
|0|0|
|6.2637|13.458|
|5.6231|14.99|
|15.285|16.319|
|39.255|35.706|
|1.8358|1.0743|
|0.13786|0.21663|
|1.1704|1.7356|
|0|0|
|1.4375|1.0932|
|1.0319|1.4749|
|35.898|29.941|
|1.4646|0.36023|
|15.237|19.182|
|64.453|59.906|
|24.237|22.406|
|6.3653|5.7744|
|1.7125|1.4617|
|0.55284|0.49217|
|0.23019|0.11827|
|0|0|
|3.4595|6.406|
|0.21462|0.10458|
|0|0|
|0|0|
|0|0|
|0|0|
|0|0|
|0|0|
|0|0|
|2.2245|2.6077|
|0|0|
|0|0|
|6.0951|6.1653|
|7.3257|6.8011|
|13.838|8.9669|
|9.7243|9.1535|
|0|0|
|48.673|47.786|
|8.5892|9.3817|
|1.0879|0.85028|
|2.025|1.4516|
|3.3598|2.7923|
|0|0|
|1.8836|2.016|
|0|0|
|0|0|
|0|0|
|0|0|
|1.7897|5.6817|
|0|0|
|15.307|14.471|
|31.121|26.435|
|1.0974|0.79653|
|0.58942|0.51872|
|4.1048|4.1563|
|4.887|5.0548|
|4.2897|3.2253|
|5.4735|4.8818|
|2.6706|2.3289|
|24.213|15.576|
|50.555|50.834|
|1.2231|0.45812|
|7.6132|7.2986|
|83.487|73.107|
|7.0269|5.9202|
|7.1984|3.8354|
|12.845|8.8825|
|63.801|50.286|
|5.7242|5.3688|
|2.6848|1.9388|
|4.4756|4.1547|
|9.041|9.2891|
|17.828|16.313|
|31.286|32.732|
|70.818|66.621|
|0.14308|0|
|0.62292|1.2626|
|0|0|
|0|0|
|5.1464|5.1108|
|9.0747|7.9515|
|7.5052|7.6026|
|2.065|1.6895|
|22.385|15.084|
|2.1113|1.6427|
|3.0464|2.7062|
|12.164|10.051|
|3.8649|3.0153|
|31.008|28.465|
|50.897|46.497|
|19.385|13.673|
|2.2287|1.2672|
|20.233|16.256|
|15.231|10.466|
|0.5319|1.6711|
|0|0|
|0|0|
|0|0|
|0|0|
|0|0|
|0|0|
|0|0|
|0|0|
|0|0|
|0|0|
|0|0|
|0|0|
|0|0|
|0|0|
|0|0|
|0|0|
|0|0|
|0|0|
|0|0|
|0|0|
|0|0|
|0.52878|0|
|0|0|
|0|0|
|0|0|
|0|0|
|0|0|
|0|0|
|0|0|
|0.23847|0.1162|
|2.4924|11.109|
|5.1443|1.8825|
|0|0.71893|
|0.93003|0.45319|
|30.911|24.885|
|2.8013|0.22078|
|0|0|
|1.81|0.66235|
|0|0|
|2.9176|3.4071|
|10.35|7.2|
|11.275|18.447|
|23.699|22.938|
|18.409|9.6427|
|0.36524|2.5783|
|18.508|10.511|
|0.36578|0|
|20.414|17.759|
|0|3.192|
|0.90619|0.49908|
|9.3634|9.2008|
|9.8865|11.567|
|3.0478|10.031|
|8.1422|8.2345|
|16.822|8.5605|
|0.90619|0.44157|
|37.302|30.234|
|59.649|47.522|
|16.631|15.52|
|3.4824|2.1761|
|2.1132|0.94124|
|21.057|20.977|
|3.9183|1.5272|
|45.735|34.932|
|4.3465|6.4565|
|54.982|51.746|
|13.438|15.683|
|29.48|25.186|
|17.448|12.646|
|39.422|25.071|
|38.229|24.55|
|26.559|19.975|
|20.929|18.245|
|42.338|33.403|
|8.8997|7.2342|
|0.32212|0|
|0.15653|0|
|0|0|
|2.0827|2.0401|
|49.988|50.005|
|29.558|29.887|
|2.7095|15.826|
|21.416|24.102|
|8.0173|5.0854|
|23.513|24.014|
|20.621|11.82|
|1.4117|3.3636|
|19.871|22.893|
|2.2939|2.9562|
|7.5153|11.516|
|6.2116|7.1282|
|14.262|16.489|
|31.006|29.474|
|1.1927|0.29235|
|0.20513|0|
|7.7014|4.7711|
|10.89|5.8468|
|0|0.13538|
|2.7686|3.4507|
|7.9151|8.7497|
|139.49|103.69|
|4.9196|3.6895|
|0.43778|0.31844|
|0|0|
|40.859|39.33|
|48.457|53.032|
|21.952|31.363|
|3.1381|12.748|
|2.2228|1.8045|
|1.349|1.1351|
|45.076|65.924|
|9.6615|13.891|
|2.5439|0.47345|
|0|0|
|0.12209|0|
|31.571|26.36|
|32.599|18.288|
|6.1368|2.3872|
|9.1036|6.0124|
|0.36627|0|
|8.2661|5.2619|
|19.898|13.673|
|0.95531|2.2357|
|0.64395|1.6467|
|0.49243|1.2592|
|0|0|
|1.7617|0.7366|
|21.756|16.101|
|22.013|3.836|
|1.9598|1.2886|
|0|0.17532|
|0.52068|1.5502|
|2.5917|6.0103|
|2.4621|6.2962|
|7.1098|19.134|
|22.982|14.74|
|30.91|28.247|
|2.324|8.8884|
|0|0|
|0|0|
|0|0|
|0|0|
|0|0|
|0|2.9906|
|0|1.1215|
|0|0|
|0|0|
|0|0|
|0|0|
|0|2.8784|
|4.3797|0.56641|
|0.35694|0.37382|
|7.5656|11.907|
|34.815|9.0407|
|14.332|2.3798|
|0|1.5513|
|1.0708|0|
|0|0.37382|
|0|0|
|0|0|
|0|0|
|0|0|
|0|0|
|0|0|
|0|0|
|1.8383|0.31467|
|1.042|4.0816|
|0|0|
|9.0337|3.0051|
|3.2121|3.5179|
|4.578|1.4908|
|20.596|19.981|
|1.5394|2.3372|
|2.4139|0.70801|
|0|0|
|0|0|
|2.3561|1.6002|
|0.99944|0|
|0.71388|0.8224|
|9.8496|0.69142|
|9.6731|0.14953|
|0.28471|3.9188|
|22.392|25.404|
|9.9536|8.1928|
|44.345|44.005|
|23.156|18.332|
|3.3953|5.2018|
|4.8733|9.1164|
|0.63205|2.4757|
|0|0.67287|
|22.105|20.2|
|19.081|15.97|
|12.486|11.337|
|6.9543|5.6385|
|10.082|13.133|
|28.21|29.261|
|15.58|16.163|
|23.324|19.76|
|17.961|7.8841|
|17.56|16.03|
|1.344|1.8388|
|0.23915|0.93677|
|0.97281|4.9948|
|60.237|53.455|
|61.807|60.61|
|9.1706|12.212|
|8.0547|19.099|
|44.82|47.701|
|24.865|24.31|
|45.096|50.247|
|21.692|23.477|
|10.725|11.252|
|14.439|16.326|
|1.4189|0.47201|
|0.1936|0.75833|
|0|0.22304|
|2.5033|2.6423|
|10.191|1.2273|
|4.1967|4.01|
|7.7122|13.405|
|4.338|14.113|
|36.03|36.049|
|66.107|115.06|
|1.9405|2.6178|
|2.2978|2.4601|
|5.2418|3.4223|
|2.648|2.911|
|0|0|
|0|0|
|0|0|
|0|0|
|0.11958|0.46838|
|0|0|
|0|0|
|20.587|13.536|
|14.576|15.236|
|5.4199|5.055|
|5.7436|5.2161|
|1.6567|3.6862|
|2.9574|2.8637|
|1.4041|1.7626|
|4.043|2.548|
|14.048|13.603|
|3.69|0.55067|
|1.5602|6.1113|
|10.919|14.116|
|0|0|
|0.74958|0|
|0|0|
|0|7.8876|
|0.46692|3.1373|
|9.5027|13.101|
|13.952|5.7059|
|0.28555|0|
|3.4302|3.0164|
|3.3581|1.8289|
|10.886|21.895|
|7.5371|4.6025|
|8.4397|10.66|
|2.0571|0.92049|
|0|0|
Below is the corresponding output:
2.29
1.759
55.97
30
23.43
22.343
21.735
19.145
54.59
30.48
24.5
22.912
23.554
53.81
54
40.16
23.41
22.35
22
24.68
24.1
24.68
35.22
34.05
25
24.15
22.832
32.32
25.02
30.1
21
14.617
12.62
10.93
8.209
17.32
19.45
17.16
12
4.97
4.014
17.19
157.5
67.13
53.18
22
24.45
764.4
1152.3
489.5
299.4
186.5
125
97.53
57.94
49.5
68.31
69.93
59.36
60
30.95
18.43
17.68
14.35
13.34
13.16
12
11.78
12.11
14.96
31.6
40.03
45.1
35
35.35
61
58.09
50.37
37.76
32.99
36
32.51
24.52
28.61
27.83
27.83
19.04
17
15.47
14.74
156
204.5
140
75.8
45
35.52
26.84
23.46
20.99
24.71
29.2
29
32.06
30.03
20.85
16.59
16.54
16.9
18
36.63
40.71
41.08
35.69
25.65
85.24
40
95.2
60.98
30.65
21.54
19.52
19.04
0
0
0
0
0
13.14
10.799
8.541
11.465
45
23.113
19.616
130.337
2000.82
760.295
425.731
250
153.86
98.284
74.883
95.109
62.775
55
45
35
45
60
156.969
104.66
138.908
160
150.366
62.633
36.257
29.935
99.106
1050.6
850
7132.83
3500
1199.84
1155.64
1350.27
615.661
500
467.934
1291.37
1201.8
765.402
748.686
469.044
650
387.986
352.143
951.827
909.097
552.181
367.211
350
141.817
108.907
90.093
96.889
126.653
174.246
600
944.8
628.424
214.335
183.458
336.317
315.066
300
215.543
359.222
1850
850.415
353.158
260.752
1160
3038
6001
1423.24
984.055
918.883
718.101
332.52
314.489
235.604
181.891
161.493
86.378
85.782
85.782
70.632
100.487
70.676
75.339
65.742
56.137
52.35
40.915
37.22
40.162
100.43
60.609
75.946
54.78
43.903
42.799
45.548
50.548
45.067
42.279
40
32.228
30.114
35.606
58.87
49.653
46.713
46
1.5
1.25
1.041
1.041
1.041
3.34
3.167
2.989
3.5
5.521
15.779
17.201
15.781
15.187
10.251
23.5
25.655
20.967
22.388
22.392
50.763
40.425
35
69.948
83.199
45.544
38.11
30.725
40.033
35.5
25.546
20.674
15.028
14.872
15.194
14.05
13.4
13.239
12.137
11.775
11.165
11.095
10.007
10.5
12.766
31.755
19.543
21.701
84.116
55.42
40
40.755
35.815
30.662
19.352
17.304
16.506
14
15.115
14.603
19.454
34.476
39.35
30.903
38.5
30.516
28.426
33.741
29.999
25.575
30.283
90
40.323
36.638
39.49
50
40.632
105.663
270
143.442
99.15
82.228
112.289
290
838.018
300
145.716
92.516
71.028
59.888
70
130.247
180
250.237
185
137.981
100.97
95.729
83.053
75
68.83
64.499
67.038
74.359
109.706
80.054
60
45.282
40.391
31.127
28.31
20.489
20.042
20
19.527
20.735
19.527
23.761
25.322
24.531
24
22.779
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
3.714
12.201
6.782
5.099
5.493
6.25
5.366
5.009
19.014
9.383
56
175.388
100
55.776
49.943
58.971
38.833
36.263
65.196
50
31.469
54.105
76.89
83.705
200
460.02
325
477.265
125.062
75.648
50.648
47.125
278.665
800
471.158
1174.89
836.934
220.609
201.954
197.36
790
451.959
536.209
455.262
493.471
490
521.808
211
162.535
148.017
206.987
221.888
208.166
434.173
495
505.996
343.073
198.599
4040.95
8448.9
2285.45
950
790.956
2823.77
2332.43
1410.24
915.169
512.284
1350
1800.57
1326.78
1344.68
947.703
526.334
535.599
1500
958.09
431.353
392.366
357.769
386.628
379.11
421
421.009
399.208
374.965
362.956
409.484
396.156
350
558.879
450.705
0.244
0.237
0.317
0.289
0.315
0.3
0.284
0.256
0.247
0.228
0.242
5.216
5
12.34
2345.54
1412.26
890.676
536.153
395.647
270
247.293
205.264
63.08
45.396
31.009
32.161
30.12
42.897
44.51
36.62
39.258
46.305
43.703
185
250.483
102.181
47.919
48.694
51.992
39.14
28
24.464
42.383
38.425
48.874
197.902
157.884
100
84.704
50.802
161.553
138.971
42.034
43.653
45
129.328
361.152
194.253
975.743
1016.08
709.699
600
299.091
140.713
483.382
464.094
714.807
588.046
715
1406.54
1126.61
1285.01
1073.49
930.527
640.74
500
313.52
268.012
107.16
71.387
84.279
104.336
1800
3003.24
1500.9
821.283
329.844
311.175
139.08
90
69.756
47.326
40.079
37.064
45.759
175.815
480
230.321
130
103.876
71.843
64.851
58.334
125
90.877
87.565
69.909
50.923
47.025
51.968
40
27.872
27.059
141.529
48.611
39.275
47.373
85
57.658
45.701
45.492
54.175