0bcbc6010cb581aec78aac51dbfda7d1e6a89621,data/generate_arabic_voice_dataset.py,,,#,4
Before Change
""" Load train set """
X = X_data[np.array(trainind)-1] //////Train data
max_nb_variables = -np.inf
min_nb_variables = np.inf
for i in range(X.shape[0]):
var_count = X[i].shape[-1]
if var_count > max_nb_variables:
max_nb_variables = var_count
if var_count < min_nb_variables:
min_nb_variables = var_count
print("max number variables : ", max_nb_variables)
print("min number variables : ", min_nb_variables)
X_train = np.zeros((X.shape[0], X[0].shape[0], max_nb_variables))
y_train = y_data[(np.array(trainind)-1)] //////Train Labels
// pad ending with zeros to get numpy arrays
for i in range(X_train.shape[0]):
var_count = X[i].shape[-1]
X_train[i, :, :var_count] = X[i]
X_train_mean = X_train.mean()
X_train_std = X_train.std()
print("Train Mean +- std : ", X_train_mean, X_train_std)
//X_train = (X_train - X_train_mean) / (X_train_std + 1e-8)
""" Load test set """
X = X_data[(np.array(testind)-1)] ////////Test Data
X_test = np.zeros((X.shape[0], X[0].shape[0], max_nb_variables))
y_test = y_data[(np.array(testind)-1)] ////////Test Labels​
// pad ending with zeros to get numpy arrays
for i in range(X_test.shape[0]):
var_count = X[i].shape[-1]
X_test[i, :, :var_count] = X[i]
//X_test = (X_test - X_train_mean) / (X_train_std + 1e-8)
After Change
""" Load train set """
X = X_data[np.array(trainind)-1] //////Train data
var_list = []
for i in range(X.shape[0]):
var_count = X[i].shape[-1]
var_list.append(var_count)
var_list = np.array(var_list)
max_nb_variables = var_list.max()
min_nb_variables = var_list.min()
median_nb_variables = np.median(var_list)
print("max nb variables train : ", max_nb_variables)
print("min nb variables train : ", min_nb_variables)
print("median nb variables train : ", median_nb_variables)
X_train = np.zeros((X.shape[0], X[0].shape[0], max_nb_variables))
y_train = y_data[(np.array(trainind)-1)] //////Train Labels
// pad ending with zeros to get numpy arrays
for i in range(X_train.shape[0]):
var_count = X[i].shape[-1]
X_train[i, :, :var_count] = X[i]
X_train_mean = X_train.mean()
X_train_std = X_train.std()
print("Train Mean +- std : ", X_train_mean, X_train_std)
//X_train = (X_train - X_train_mean) / (X_train_std + 1e-8)
""" Load test set """
X = X_data[(np.array(testind)-1)] ////////Test Data
X_test = np.zeros((X.shape[0], X[0].shape[0], max_nb_variables))
y_test = y_data[(np.array(testind)-1)] ////////Test Labels​
// pad ending with zeros to get numpy arrays
for i in range(X_test.shape[0]):
var_count = X[i].shape[-1]
X_test[i, :, :var_count] = X[i]
//X_test = (X_test - X_train_mean) / (X_train_std + 1e-8)
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 25
Instances
Project Name: titu1994/MLSTM-FCN
Commit Name: 0bcbc6010cb581aec78aac51dbfda7d1e6a89621
Time: 2017-08-14
Author: titu1994@gmail.com
File Name: data/generate_arabic_voice_dataset.py
Class Name:
Method Name:
Project Name: titu1994/MLSTM-FCN
Commit Name: 0bcbc6010cb581aec78aac51dbfda7d1e6a89621
Time: 2017-08-14
Author: titu1994@gmail.com
File Name: data/generate_arabic_voice_dataset.py
Class Name:
Method Name:
Project Name: titu1994/MLSTM-FCN
Commit Name: 0bcbc6010cb581aec78aac51dbfda7d1e6a89621
Time: 2017-08-14
Author: titu1994@gmail.com
File Name: data/generate_action_3d_dataset.py
Class Name:
Method Name:
Project Name: titu1994/MLSTM-FCN
Commit Name: 0bcbc6010cb581aec78aac51dbfda7d1e6a89621
Time: 2017-08-14
Author: titu1994@gmail.com
File Name: data/generate_activity_dataset.py
Class Name:
Method Name:
Project Name: titu1994/MLSTM-FCN
Commit Name: 0bcbc6010cb581aec78aac51dbfda7d1e6a89621
Time: 2017-08-14
Author: titu1994@gmail.com
File Name: data/generate_arabic_dataset.py
Class Name:
Method Name: