
我试图在 cnn 的末尾实现 softmax,我得到的输出是 nan 和 zeros。我给 softmax 大约 10-20k 的高输入值我给了一个数组X=[2345,3456,6543,-6789,-9234]
我的功能是
def softmax (X):
B=np.exp(X)
C=np.sum(np.exp(X))
return B/C
Run Code Online (Sandbox Code Playgroud)
我收到错误 true divide and run time error
C:\Anaconda\envs\deep_learning\lib\site-packages\ipykernel_launcher.py:4: RuntimeWarning: invalid value encountered in true_divide
after removing the cwd from sys.path.
Run Code Online (Sandbox Code Playgroud)