回答編集履歴

1

修正

2020/04/07 03:41

投稿

tiitoi
tiitoi

スコア21956

test CHANGED
@@ -11,3 +11,19 @@
11
11
 
12
12
 
13
13
  [torch.distributions.categorical — PyTorch master documentation](https://pytorch.org/docs/stable/_modules/torch/distributions/categorical.html#Categorical.log_prob)
14
+
15
+
16
+
17
+ ## 追記
18
+
19
+
20
+
21
+ > multinomialを使っているので基本的には並べ替えを変えているようですが、それだけでしょうか。
22
+
23
+
24
+
25
+ カテゴリカル分布は、多項分布で N = 1 とした場合なので、`torch.multinomial(probs_2d, 1, True)` で計算しています。
26
+
27
+
28
+
29
+ [ややこしい離散分布に関するまとめ - 作って遊ぶ機械学習。](http://machine-learning.hatenablog.com/entry/2016/03/26/211106)