Questions tagged [pytorch-distributions]

6 questions
3
votes
2 answers

KL Divergence of two torch.distribution.Distribution objects

I'm trying to determine how to compute KL Divergence of two torch.distribution.Distribution objects. I couldn't find a function to do that so far. Here is what I've tried: import torch as t from torch import distributions as tdist import…
ikamen
  • 3,175
  • 1
  • 25
  • 47
0
votes
0 answers

RuntimeError: RPC has not been initialized. Call torch.distributed.rpc.init_rpc first

I am making the experimental FedAvg simulation using the Pytorch RPC, but the server side throws errors when I run it. It seems that it is my coding problem, but I don't know what the problem is. Here are some related code snippets: . . . #Start…
0
votes
1 answer

Can we use torch.multiprocessing.spawn with wandb sweep hyper-parameter tuning?

Can we use torch.multiprocessing.spawn with wandb.sweep (https://docs.wandb.ai/guides/sweeps). torch.multiprocessing.spawn(func, nprocs=world_size, join=True) I tried but got errors and cannot find tutorials.
skytree
  • 1,060
  • 2
  • 13
  • 38
0
votes
0 answers

How to make torch.distributions.MultivariateNormal accept zero values on the diagonal of covariance matrix?

I use torch.normal to generate (1,n)-dimensional samples with an std vector that includes zero values. This doesn't generate any errors (when std[k] is zero the corresponding mean[k] is sampled). However, torch.distributions.MultivariateNormal…
Rima
  • 3
  • 2
0
votes
0 answers

Multi Dimensional Sample from a given distribution

I'm trying to genrate a binary sample with multiple dimensions of which i can control the probability distribution as well, i found it useful with torch.distributions.binomial which allows controlling the probability distribution but dosen't help…
0
votes
1 answer

Learning multivariate normal covariance matrix using pytorch

I am trying to learn a multivariate normal covariance matrix (Sigma, ∑) using some observations. The way I went at it is by using pytorch.distributions.MultivariateNormal: import torch from torch.distributions import MultivariateNormal # I tried…