Single Layer Neural Net in Python