nflows
v0.14
nflows是使用Pytorch的歸一流流量的全面集合。
從PYPI安裝:
python -m pip install nflows
要使用pixi安裝並添加nflows ,從項目目錄運行中
pixi add nflows
並在激活的環境中安裝與conda的特定Conda環境
conda install --channel conda-forge nflows
定義流程:
from nflows import transforms , distributions , flows
# Define an invertible transformation.
transform = transforms . CompositeTransform ([
transforms . MaskedAffineAutoregressiveTransform ( features = 2 , hidden_features = 4 ),
transforms . RandomPermutation ( features = 2 )
])
# Define a base distribution.
base_distribution = distributions . StandardNormal ( shape = [ 2 ])
# Combine into a flow.
flow = flows . Flow ( transform = transform , distribution = base_distribution )評估輸入的對數概率:
log_prob = flow . log_prob ( inputs )從流中採樣:
samples = flow . sample ( num_samples )示例文件夾中提供了工作流程的其他示例。
安裝所有依賴關係以進行開發:
pip install -r requirements.txt
引用包裹:
@software { nflows ,
author = { Conor Durkan and
Artur Bekasov and
Iain Murray and
George Papamakarios } ,
title = { {nflows}: normalizing flows in {PyTorch} } ,
month = nov,
year = 2020 ,
publisher = { Zenodo } ,
version = { v0.14 } ,
doi = { 10.5281/zenodo.4296287 } ,
url = { https://doi.org/10.5281/zenodo.4296287 }
}版本編號旨在是nflows/version.py的版本。年度/月對應於發布日期。可以在Zenodo上找到其他版本的Bibtex條目。
如果您特別使用基於樣條的流量,請考慮引用神經條件流紙:[Bibtex]。
nflows衍生自最初與
C. Durkan,A。 Bekasov,I。 Murray,G。 Papamakarios, Neural Spline Flow ,Neurips 2019。 [Arxiv] [Bibtex]
nflows已在
Conor Durkan,Iain Murray,George Papamakarios,在對比度學習的對比度無推理中,ICML 2020。 [Arxiv]。
伊恩·默里(Iain Murray)的Artur Bekasov,以嵌套的輟學量為標準化流量。 [arxiv]。
蒂姆·迪克霍恩( Tim Dockhorn),詹姆斯·A·里奇(James A. [arxiv]。
有條件的密度估計包Pyknos使用了nflows ,進而使用了無似然推理框架SBI。