/usr/local/lib64/python3.6/site-packages/torch/distributions/__pycache__
NameSizeModeActions
bernoulli.cpython-36.pyc44450644editdlrm
beta.cpython-36.pyc36820644editdlrm
binomial.cpython-36.pyc47610644editdlrm
categorical.cpython-36.pyc58130644editdlrm
cauchy.cpython-36.pyc33100644editdlrm
chi2.cpython-36.pyc14190644editdlrm
constraints.cpython-36.pyc222170644editdlrm
constraint_registry.cpython-36.pyc98950644editdlrm
continuous_bernoulli.cpython-36.pyc80770644editdlrm
dirichlet.cpython-36.pyc40850644editdlrm
distribution.cpython-36.pyc118220644editdlrm
exponential.cpython-36.pyc33630644editdlrm
exp_family.cpython-36.pyc28760644editdlrm
fishersnedecor.cpython-36.pyc32120644editdlrm
gamma.cpython-36.pyc34550644editdlrm
geometric.cpython-36.pyc41830644editdlrm
gumbel.cpython-36.pyc28640644editdlrm
half_cauchy.cpython-36.pyc29300644editdlrm
half_normal.cpython-36.pyc28210644editdlrm
independent.cpython-36.pyc45060644editdlrm
kl.cpython-36.pyc258440644editdlrm
kumaraswamy.cpython-36.pyc30400644editdlrm
laplace.cpython-36.pyc34420644editdlrm
lkj_cholesky.cpython-36.pyc45750644editdlrm
logistic_normal.cpython-36.pyc23200644editdlrm
log_normal.cpython-36.pyc24380644editdlrm
lowrank_multivariate_normal.cpython-36.pyc80740644editdlrm
mixture_same_family.cpython-36.pyc70730644editdlrm
multinomial.cpython-36.pyc50200644editdlrm
multivariate_normal.cpython-36.pyc85340644editdlrm
negative_binomial.cpython-36.pyc41490644editdlrm
normal.cpython-36.pyc41380644editdlrm
one_hot_categorical.cpython-36.pyc51730644editdlrm
pareto.cpython-36.pyc25160644editdlrm
poisson.cpython-36.pyc26820644editdlrm
relaxed_bernoulli.cpython-36.pyc55950644editdlrm
relaxed_categorical.cpython-36.pyc55630644editdlrm
studentT.cpython-36.pyc34830644editdlrm
transformed_distribution.cpython-36.pyc73350644editdlrm
transforms.cpython-36.pyc429810644editdlrm
uniform.cpython-36.pyc35800644editdlrm
utils.cpython-36.pyc68020644editdlrm
von_mises.cpython-36.pyc50790644editdlrm
weibull.cpython-36.pyc27370644editdlrm
__init__.cpython-36.pyc59810644editdlrm
Edit: /usr/local/lib64/python3.6/site-packages/torch/distributions/__pycache__/independent.cpython-36.pyc (4506B)
3 Eg @sLddlZddlmZddlmZddlmZddlmZGdddeZ dS)N) constraints) Distribution)_sum_rightmost)DictcseZdZUdZiZeeejfdfdd Z dfdd Z e ddZ e d d Z ejd d Ze d dZe ddZejfddZejfddZddZddZd ddZddZZS)! Independenta Reinterprets some of the batch dims of a distribution as event dims. This is mainly useful for changing the shape of the result of :meth:`log_prob`. For example to create a diagonal Normal distribution with the same shape as a Multivariate Normal distribution (so they are interchangeable), you can:: >>> loc = torch.zeros(3) >>> scale = torch.ones(3) >>> mvn = MultivariateNormal(loc, scale_tril=torch.diag(scale)) >>> [mvn.batch_shape, mvn.event_shape] [torch.Size(()), torch.Size((3,))] >>> normal = Normal(loc, scale) >>> [normal.batch_shape, normal.event_shape] [torch.Size((3,)), torch.Size(())] >>> diagn = Independent(normal, 1) >>> [diagn.batch_shape, diagn.event_shape] [torch.Size(()), torch.Size((3,))] Args: base_distribution (torch.distributions.distribution.Distribution): a base distribution reinterpreted_batch_ndims (int): the number of batch dims to reinterpret as event dims Ncs|t|jkr$tdj|t|j|j|j}|t|j}|dt||}|t||d}||_||_tt|j |||ddS)NzYExpected reinterpreted_batch_ndims <= len(base_distribution.batch_shape), actual {} vs {}) validate_args) len batch_shape ValueErrorformat event_shape base_distreinterpreted_batch_ndimssuperr__init__)selfZbase_distributionrrshapeZ event_dimr r ) __class__K/usr/local/lib64/python3.6/site-packages/torch/distributions/independent.pyr$s zIndependent.__init__cs`|jt|}tj|}|jj||jd|j|_|j|_tt|j ||jdd|j |_ |S)NF)r) Z_get_checked_instancertorchSizer expandr rrrZ_validate_args)rr Z _instancenew)rrrr1s  zIndependent.expandcCs|jjS)N)r has_rsample)rrrrr;szIndependent.has_rsamplecCs|jdkrdS|jjS)NrF)rr has_enumerate_support)rrrrr?s z!Independent.has_enumerate_supportcCs |jj}|jrtj||j}|S)N)r supportrrZ independent)rresultrrrrEszIndependent.supportcCs|jjS)N)r mean)rrrrrLszIndependent.meancCs|jjS)N)r variance)rrrrrPszIndependent.variancecCs |jj|S)N)r sample)r sample_shaperrrr TszIndependent.samplecCs |jj|S)N)r rsample)rr!rrrr"WszIndependent.rsamplecCs|jj|}t||jS)N)r log_probrr)rvaluer#rrrr#Zs zIndependent.log_probcCs|jj}t||jS)N)r entropyrr)rr%rrrr%^s zIndependent.entropyTcCs |jdkrtd|jj|dS)Nrz5Enumeration over cartesian product is not implemented)r)rNotImplementedErrorr enumerate_support)rrrrrr'bs zIndependent.enumerate_supportcCs|jjdj|j|jS)Nz({}, {}))r__name__r r r)rrrr__repr__gszIndependent.__repr__)N)N)T)r( __module__ __qualname____doc__Zarg_constraintsrstrr ConstraintrrpropertyrrZdependent_propertyrrrrrr r"r#r%r'r) __classcell__rr)rrrs       r) rZtorch.distributionsrZ torch.distributions.distributionrZtorch.distributions.utilsrtypingrrrrrrs