资源算法Probabilistic Programming and Statistical Inference in PyTorch

Probabilistic Programming and Statistical Inference in PyTorch

2019-09-18 | |  87 |   0 |   0

PtStat

Probabilistic Programming and Statistical Inference in PyTorch.

Introduction

This project is being developed during my time at Cogent Labs.

The documentation is still WIP, a brief API description is reported below. The tests might also be helpful.

The API might change quickly during this initial development period.

API

The first dimension is the batch dimension, over which the samples are assumed to be independent.

# Random variables interface:class RandomVariable:
    def size(self)        # --> (batch_size, rv_dimension)

    def log_pdf(self, x)  # --> [batch_size]

    def sample(self)      # --> [batch_size, rv_dimension]

    def entropy(self)     # --> [batch_size]# Implemented random variables:Normal(size=(batch_size, rv_dimension), cuda=cuda)Normal(mu, sd)Categorical(size=(batch_size, rv_dimension), cuda=cuda)Categorical(p)Bernoulli(size=(batch_size, rv_dimension), cuda=cuda)Bernoulli(p)Uniform(size=(batch_size, rv_dimension), cuda=cuda)# KL-Divergence:def kld(rv_from, rv_to)  # --> [batch_size]

Changelog

Version 0.2.0

  • removed specialized distributions => more flexible constructors

  • refactoring: distributions into multiple files

Version 0.1.0

  • initial commit

Licensing

The code is released under the MIT license.


上一篇:FCN-pytorch-easiest

下一篇:lang-emerge-parlai

用户评价
全部评价

热门资源

  • Keras-ResNeXt

    Keras ResNeXt Implementation of ResNeXt models...

  • seetafaceJNI

    项目介绍 基于中科院seetaface2进行封装的JAVA...

  • spark-corenlp

    This package wraps Stanford CoreNLP annotators ...

  • capsnet-with-caps...

    CapsNet with capsule-wise convolution Project ...

  • inferno-boilerplate

    This is a very basic boilerplate example for pe...