In [ ]:
def get_weights():
    y = np.random.random() * (2.0 / np.sqrt(M))
    return 0.5 - (1 / np.sqrt(M)) + y