import numpy as np
import matplotlib.pyplot as plt
from keras.models import Sequential
from keras.layers import Dense, Activation
from keras.optimizers import SGD
X= np.zeros([N, Dx])
Labels=np.zeros([N, Cy]) # neural network takes the indicators instead of Y
for i in range(N):
X[i, :]=M[:, Y[i]]
Labels[i, Y[i]]=1
X=X+ np.random.normal(0, .5, X.shape)