/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__/bernoulli.cpython-36.pyc (4445B)
3 Eg@@sdddlmZddlZddlmZddlmZddlmZm Z m Z m Z ddl m Z GdddeZdS) )NumberN) constraints)ExponentialFamily) broadcast_allprobs_to_logitslogits_to_probs lazy_property) binary_cross_entropy_with_logitscseZdZdZejejdZejZ dZ dZ d"fdd Z d#fdd Z d d Zed d ZeddZeddZeddZeddZejfddZddZddZd$ddZeddZd d!ZZS)% Bernoullia Creates a Bernoulli distribution parameterized by :attr:`probs` or :attr:`logits` (but not both). Samples are binary (0 or 1). They take the value `1` with probability `p` and `0` with probability `1 - p`. Example:: >>> m = Bernoulli(torch.tensor([0.3])) >>> m.sample() # 30% chance 1; 70% chance 0 tensor([ 0.]) Args: probs (Number, Tensor): the probability of sampling `1` logits (Number, Tensor): the log-odds of sampling `1` )probslogitsTrNcs|dk|dkkrtd|dk r8t|t}t|\|_nt|t}t|\|_|dk r\|jn|j|_|rrtj}n |jj }t t |j ||ddS)Nz;Either `probs` or `logits` must be specified, but not both.) validate_args) ValueError isinstancerrr r _paramtorchSizesizesuperr __init__)selfr r r Z is_scalar batch_shape) __class__I/usr/local/lib64/python3.6/site-packages/torch/distributions/bernoulli.pyr"s     zBernoulli.__init__csv|jt|}tj|}d|jkr6|jj||_|j|_d|jkrV|jj||_|j|_t t|j |dd|j |_ |S)Nr r F)r ) Z_get_checked_instancer rr__dict__r expandrr rr_validate_args)rrZ _instancenew)rrrr2s    zBernoulli.expandcOs|jj||S)N)rr)rargskwargsrrr_new?szBernoulli._newcCs|jS)N)r )rrrrmeanBszBernoulli.meancCs|jd|jS)N)r )rrrrvarianceFszBernoulli.variancecCst|jddS)NT) is_binary)rr )rrrrr JszBernoulli.logitscCst|jddS)NT)r%)rr )rrrrr NszBernoulli.probscCs |jjS)N)rr)rrrr param_shapeRszBernoulli.param_shapec Cs0|j|}tjtj|jj|SQRXdS)N)Z_extended_shaperZno_gradZ bernoullir r)rZ sample_shapeshaperrrsampleVs  zBernoulli.samplecCs0|jr|j|t|j|\}}t||dd S)Nnone) reduction)rZ_validate_samplerr r )rvaluer rrrlog_prob[s zBernoulli.log_probcCst|j|jddS)Nr))r*)r r r )rrrrentropyaszBernoulli.entropycCsHtjd|jj|jjd}|jddt|j}|rD|jd|j}|S) N)dtypedevicer#)r1)r#r1)r1) rZarangerr/r0viewlenZ _batch_shaper)rrvaluesrrrenumerate_supportds zBernoulli.enumerate_supportcCstj|jd|jfS)Nr#)rlogr )rrrr_natural_paramskszBernoulli._natural_paramscCstjdtj|S)Nr#)rr6exp)rxrrr_log_normalizeroszBernoulli._log_normalizer)NNN)N)T)__name__ __module__ __qualname____doc__rZ unit_intervalrealZarg_constraintsbooleanZsupportZhas_enumerate_supportZ_mean_carrier_measurerrr!propertyr"r$rr r r&rrr(r,r-r5r7r: __classcell__rr)rrr s(         r )ZnumbersrrZtorch.distributionsrZtorch.distributions.exp_familyrZtorch.distributions.utilsrrrrZtorch.nn.functionalr r rrrrs