def train(n_iter, lr):
        for i in range(n_iter):
            u = np.random.choice(np.arange(split))
            loss = rmsprop.train(Xtrain[u:u+50], ytrain[u:u+50], lr)
            print("Loss:", loss)

        preds = mlp.predict(Xtest).argmax(axis=1)
        print("Error: ", 1 - (preds == labels[test_idx]).sum() / float(N - split))
dataset/ETHPy150Open sharadmv/deepx/examples/mlp.py/train/original