-
eudesyawog authoreda1c87b67
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import sys
import time
import os
import tensorflow as tf
import numpy as np
from sklearn.utils import shuffle
from sklearn.metrics import mean_squared_error
from sklearn.metrics import mean_absolute_error
from sklearn.metrics import r2_score
def get_batch(array, i, batch_size):
start_id = i*batch_size
end_id = min((i+1) * batch_size, array.shape[0])
batch = array[start_id:end_id]
return batch
def format_X(lst_X, n_timestamps=37):
X = None
for i in range(len(lst_X)):
tmp = lst_X[i]
if X is None :
X = tmp
else :
X = np.vstack((X,tmp))
X = X.reshape(X.shape[0],n_timestamps,-1)
print (new_X.shape)
return new_X
def format_y (lst_y,target,scale_by=1):
y = None
for i in range(len(lst_y)):
tmp = lst_y[i]
if y is None :
y = tmp[target]
else :
y = np.hstack((y,tmp[target]))
print (y.shape)
return y/scale_by
if __name__ == '__main__' :
# Reading data
train_radar_X1 = np.load(sys.argv[1])
train_opt_X1 = np.load(sys.argv[2])
train_indices_X1 = np.load(sys.argv[3])
train_y1 = np.load(sys.argv[4])
train_radar_X2 = np.load(sys.argv[5])
train_opt_X2 = np.load(sys.argv[6])
train_indices_X2 = np.load(sys.argv[7])
train_y2 = np.load(sys.argv[8])
sys.stdout.flush
# Formatting
train_radar_X =
test
# Run Model
units = 128
batch_size = 8
n_epochs = 500
learning_rate = 1E-4
drop = 0.3
# run()