[Pytorch] MixtureSameFamily 을 사용해서 bimodal distribution 만들기
torch 1.5.0 버전부터 생김 bimodal gaussian distribution 만들기 n = 1000 import torch import seaborn as sns from torch.distributions import Normal from torch import distributions as D from torch.distributions.mixture_same_family import MixtureSameFamily d = torch.cat((Normal(loc=-3, scale =1.0).sample((n,1)) , Normal(loc=0.5, scale =1.0).sample((n,1))),dim=1) mix = D.Categorical(probs = torch.nn.Softmax()..
2020.05.05