Bean Machine概率模型推断库

联合创作 · 2023-09-26

Bean Machine 是一种概率编程语言,用于使用声明性语法对用 Python 语言编写的统计模型进行推理。Bean Machine 构建在 PyTorch 和 Bean Machine Graph(自定义 C++ 后端)之上。

安装

Bean Machine 支持 Python 3.7、3.8 和 PyTorch 1.10。

使用 Pip 安装最新版本

pip install beanmachine

从源代码安装

从 GitHub 下载最新的 Bean Machine 源代码:

git clone https://github.com/facebookresearch/beanmachine.git cd beanmachine

然后,您可以从以下任一安装选项中进行选择。

Anaconda

我们建议使用 conda 来管理虚拟环境并安装必要的构建依赖项。

conda create -n {env name} python=3.7; conda activate {env name}
conda install boost eigen
pip install 

Docker

docker build -t beanmachine .
docker run -it beanmachine:latest bash

验证安装

如果您想运行内置单元测试:

# install pytest 7.0 from GitHub
pip install git+https://github.com/pytest-dev/pytest.git@7.0.0.dev0
pytest .
浏览 5
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报