def build_model(self):
    input_layer = Input(shape=(self.X_train.shape[1], 1))
    x = Conv1D(filters=256, kernel_size=7, activation='relu', padding='same')(input_layer)
    x = MaxPooling1D(4)(x)
    x = Conv1D(filters=128, kernel_size=5, activation='relu', padding='same')(x)
    x = MaxPooling1D(4)(x)
    x = Conv1D(filters=64, kernel_size=5, activation='relu', padding='same')(x)
    x = MaxPooling1D(2)(x)
    x = Conv1D(filters=32, kernel_size=3, activation='relu', padding='same')(x)
    x = MaxPooling1D(2)(x)
    x = Conv1D(filters=32, kernel_size=3, activation='relu', padding='same')(x)
    x = MaxPooling1D(2)(x)
    x = Conv1D(filters=1, kernel_size=3, activation='relu', padding='same')(x)
    encoded = MaxPooling1D(2, padding='same')(x)
    x = Conv1D(filters=1, kernel_size=3, activation='relu', padding='same')(encoded)
    x = UpSampling1D(2)(x)
    x = Conv1D(filters=32, kernel_size=3, activation='relu', padding='same')(x)
    x = UpSampling1D(2)(x)
    x = Conv1D(filters=32, kernel_size=3, activation='relu', padding='same')(x)
    x = UpSampling1D(2)(x)
    x = Conv1D(filters=64, kernel_size=5, activation='relu', padding='same')(x)
    x = UpSampling1D(2)(x)
    x = Conv1D(filters=128, kernel_size=5, activation='relu', padding='same')(x)
    x = UpSampling1D(4)(x)
    x = Conv1D(filters=256, kernel_size=7, activation='relu', padding='same')(x)
    x = UpSampling1D(4)(x)
    decoded = Conv1D(1, 1, activation='tanh', padding='same')(x)
    self.autoencoder = Model(input_layer, decoded)
    self.autoencoder.summary()
    self.autoencoder.compile(loss='mse', optimizer='adam')
    return self.autoencoder
def build_model(self):
    input_layer = Input(shape=(self.X_train.shape[1], 1))
    x = Conv1D(filters=256, kernel_size=7, activation='relu', padding='same')(input_layer)
    x = MaxPooling1D(4)(x)
    x = Conv1D(filters=128, kernel_size=5, activation='relu', padding='same')(x)
    x = MaxPooling1D(4)(x)
    x = Conv1D(filters=64, kernel_size=5, activation='relu', padding='same')(x)
    x = MaxPooling1D(2)(x)
    x = Conv1D(filters=32, kernel_size=3, activation='relu', padding='same')(x)
    x = MaxPooling1D(2)(x)
    x = Conv1D(filters=32, kernel_size=3, activation='relu', padding='same')(x)
    x = MaxPooling1D(2)(x)
    x = Conv1D(filters=1, kernel_size=3, activation='relu', padding='same')(x)
    encoded = MaxPooling1D(2, padding='same')(x)
    x = Conv1D(filters=1, kernel_size=3, activation='relu', padding='same')(encoded)
    x = UpSampling1D(2)(x)
    x = Conv1D(filters=32, kernel_size=3, activation='relu', padding='same')(x)
    x = UpSampling1D(2)(x)
    x = Conv1D(filters=32, kernel_size=3, activation='relu', padding='same')(x)
    x = UpSampling1D(2)(x)
    x = Conv1D(filters=64, kernel_size=5, activation='relu', padding='same')(x)
    x = UpSampling1D(2)(x)
    x = Conv1D(filters=128, kernel_size=5, activation='relu', padding='same')(x)
    x = UpSampling1D(4)(x)
    x = Conv1D(filters=256, kernel_size=7, activation='relu', padding='same')(x)
    x = UpSampling1D(4)(x)
    decoded = Conv1D(1, 1, activation='tanh', padding='same')(x)
    self.autoencoder = Model(input_layer, decoded)
    self.autoencoder.summary()
    self.autoencoder.compile(loss='mse', optimizer='adam')
    return self.autoencoder