def __init__(self): reader = DataReader(1,5) name ="ECG5000" + "/" + "ECG5000" self.x_train, self.y_train = reader.read_train_data('../UCR_TS_Archive_2015/'+name+"_TEST") self.x_test, self.y_test = reader.read_test_data("../UCR_TS_Archive_2015/"+name+"_TRAIN") self.x_input, self.y_input = reader.temp_read_test_data("../UCR_TS_Archive_2015/"+name+"_TRAIN")
def __init__(self): reader = DataReader(1,3) name ="StarLightCurves" + "/" + "StarLightCurves" self.x_train, self.y_train = reader.read_train_data('../UCR_TS_Archive_2015/'+name+"_TRAIN") self.x_test, self.y_test = reader.read_test_data("../UCR_TS_Archive_2015/"+name+"_TEST") self.x_input, self.y_input = reader.temp_read_test_data("../UCR_TS_Archive_2015/"+name+"_TEST")
def get_libsvm_data(self): reader = DataReader() self.x_train, self.y_train = reader.temp_read_train_data( '../UCR_TS_Archive_2015/wafer/wafer_TRAIN2') self.x_test, self.y_test = reader.temp_read_test_data( '../UCR_TS_Archive_2015/wafer/wafer_TEST2') self.y_train = self.y_train - 1 self.y_test = self.y_test - 1
def __init__(self): reader = DataReader(152, 2) name = "wafer" + "/" + "wafer" self.x_train, self.y_train = reader.read_train_data( '../UCR_TS_Archive_2015/' + name + "_TRAIN2") self.x_test, self.y_test = reader.read_test_data( "../UCR_TS_Archive_2015/" + name + "_TEST2") self.x_input, self.y_input = reader.temp_read_test_data( "../UCR_TS_Archive_2015/" + name + "_TEST2")
def get_libsvm_data(self): reader = DataReader() self.x_train, self.y_train = reader.temp_read_train_data('../UCR_TS_Archive_2015/ECG5000/ECG5000_TEST') self.x_test, self.y_test = reader.temp_read_test_data('../UCR_TS_Archive_2015/ECG5000/ECG5000_TRAIN')
import numpy as np import sys sys.path.append("../script") from convert_input import Convert from validation import Validation from read_data import DataReader reader = DataReader(1, 2) name = "wafer" x_train, y_train = reader.read_train_data('../UCR_TS_Archive_2015/' + name + "/" + name + "_TRAIN2") x_test, y_test = reader.read_test_data("../UCR_TS_Archive_2015/" + name + "/" + name + "_TEST2") x_input, y_input = reader.temp_read_test_data("../UCR_TS_Archive_2015/" + name + "/" + name + "_TEST2") x_train = np.transpose(x_train, [1, 0, 2]) x_test = np.transpose(x_test, [1, 0, 2]) ''' To classify images using a recurrent neural network, we consider every image row as a sequence of pixels. Because MNIST image shape is 28*28px, we will then handle 28 sequences of 28 steps for every sample. ''' # Parameters learning_rate = 0.5 training_iters = 100 batch_size = x_train[0].shape[0]
def get_libsvm_data(self): reader = DataReader() self.x_train, self.y_train = reader.temp_read_train_data( '../UCR_TS_Archive_2015/StarLightCurves/StarLightCurves_TRAIN') self.x_test, self.y_test = reader.temp_read_test_data( '../UCR_TS_Archive_2015/StarLightCurves/StarLightCurves_TEST')