returns a view to record array theta which behaves
    like a (N,d) float array

def as_2d_array(theta):
    """ returns a view to record array theta which behaves
    like a (N,d) float array
    """
    v = theta.view(np.float)
    N = theta.shape[0]
    v.shape = (N, - 1)
    # raise an error if v cannot be reshaped without creating a copy
    return v