TorchLikelihoods: User-friendly handling of likelihoods in Pytorch
Project description
TorchLikelihoods
A library for handling likelihoods in PyTorch for any type of data
Installation
Run the following to install
pip install torchlikelihoods
Usage
from torchlikelihoods import NormalLikelihood
import torch
num_samples, num_feats = 100, 5
normal_data = torch.randn((num_samples, num_feats))
lik = NormalLikelihood(domain_size=num_feats)
scaler = lik.get_scaler()
print(f"Domain size: {lik.domain_size()}")
print(f"Params size: {lik.params_size()}")
Do you want to get involved in the development?
pip install -e .[dev]
Testing
To run the tests:
make test
pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
torchlikelihoods-0.0.5.tar.gz
(13.6 kB
view details)
Built Distribution
File details
Details for the file torchlikelihoods-0.0.5.tar.gz
.
File metadata
- Download URL: torchlikelihoods-0.0.5.tar.gz
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | db1449a429fb268500ad0fa54a1dc80d82018c89ac1423c4729868bbe0db006d |
|
MD5 | 88175221397ce927240eb9c0275384fd |
|
BLAKE2b-256 | f678034789d5f9028630d00eda186caf4b7038953b505fbda1a942a90a9b2677 |
File details
Details for the file torchlikelihoods-0.0.5-py3-none-any.whl
.
File metadata
- Download URL: torchlikelihoods-0.0.5-py3-none-any.whl
- Upload date:
- Size: 25.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81a3ddc3ebbb4d726251c1a9428d4d301d6bcfe4c9d63d18bfcbf7d9dc674614 |
|
MD5 | caab3d1c3af16521909c008ebc3956f1 |
|
BLAKE2b-256 | c68c57f2e01334e684cfc04a9b180c7ed0c83c6a9700d20f9f24113ebe1db47a |