X_train_rev = [X[::-1] for X in X_train] X_test_rev = [X[::-1] for X in X_test] X_train = np.expand_dims(X_train, axis=2) X_train_rev = np.expand_dims(X_train_rev, axis=2) X_test = np.expand_dims(X_test, axis=2) X_test_rev = np.expand_dims(X_test_rev, axis=2)