def __init__(self, dataset_path, sensor_idxs, action_idxs, max_laps, n_out, out_activation_f, regression=True): x_train, y_train, x_valid, y_valid, scaler = read_logs(dataset_path, sensor_idxs, action_idxs, max_laps, noise=False, shuffled=True, scale=True, valid_prop=.2) # indices must be integers for classification if regression: dtype = theano.config.floatX self.y_train = y_train.astype(dtype=theano.config.floatX) self.y_valid = y_valid.astype(dtype=theano.config.floatX) else: dtype = int self.y_train = y_train.astype(dtype=dtype)+1 self.y_valid = y_valid.astype(dtype=dtype)+1 self.x_train = x_train.astype(dtype=theano.config.floatX) self.x_valid = x_valid.astype(dtype=theano.config.floatX) self.sensor_idxs = sensor_idxs self.action_idxs = action_idxs self.max_laps = max_laps self.scaler = scaler self.network = None self.n_out = n_out self.out_activation_f = out_activation_f self.out_activation_f_name = get_activation_function_name(out_activation_f) self.regression = regression
def __init__(self, dataset_path, sensor_idxs, action_idxs, max_laps, n_hidden, n_out, h0_activation_f, out_activation_f): x_train, y_train, x_valid, y_valid, scaler = read_logs(dataset_path, sensor_idxs, action_idxs, max_laps, noise=False, shuffled=True, scale=True, valid_prop=.2) self.x_train = x_train.astype(dtype=theano.config.floatX) self.y_train = y_train.astype(dtype=theano.config.floatX) self.x_valid = x_valid.astype(dtype=theano.config.floatX) self.y_valid = y_valid.astype(dtype=theano.config.floatX) self.sensor_idxs = sensor_idxs self.action_idxs = action_idxs self.max_laps = max_laps self.scaler = scaler self.network = None self.n_hidden = n_hidden self.n_out = n_out self.h0_activation_f = h0_activation_f self.h0_activation_f_name = get_activation_function_name(h0_activation_f) self.out_activation_f = out_activation_f self.out_activation_f_name = get_activation_function_name(out_activation_f)