RuntimeWarning: invalid value encountered in greater

前端 未结 2 2112
长情又很酷
长情又很酷 2021-02-11 14:59

I tried to implement soft-max with the following code (out_vec is a numpy vector of floats):

numerator = np.exp(out_vec)
denominator =          


        
2条回答
  •  面向向阳花
    2021-02-11 15:31

    In my case the warning did not show up when calling this before the comparison (I had NaN values getting compared)

    np.warnings.filterwarnings('ignore')
    

提交回复
热议问题