logo
Loading...

Negative Sampling次方係數的範例程式 - Cupoy

作業解答中的範例程式為 import numpy as np a = [15, 10, 2] den...

Negative Sampling次方係數的範例程式

2021/01/12 09:12 下午
Chris
觀看數:13
回答數:1
收藏數:0

作業解答中的範例程式為 ``` import numpy as np a = [15, 10, 2] denominator = np.sum(a) numerator = a numerator2 = np.power(a, 0.75) numerator3 = np.power(a, 0.5) print(numerator/denominator) print(numerator2/denominator) print(numerator3/denominator) ``` 輸出為: ``` [0.55555556 0.37037037 0.07407407] [0.28229597 0.20827456 0.06228862] [0.14344383 0.11712139 0.05237828] ``` 最後兩列輸出加總起來的機率總和不為1,實作過程中是否有誤?