Liknorm Python wrapper
Project description
liknorm-py
Liknorm Python wrapper.
Install
The recommended way of installing it is via conda_
conda install -c conda-forge liknorm-py
An alternative way would be via pip. First you need to install liknorm library and then
pip install liknorm
Running the tests
After installation, you can test it
python -c "import liknorm; liknorm.test()"
as long as you have pytest.
Example
>>> from numpy import empty
>>> from numpy.random import RandomState
>>> from liknorm import LikNormMachine
>>>
>>> machine = LikNormMachine('bernoulli')
>>> random = RandomState(0)
>>> outcome = random.randint(0, 2, 5)
>>> tau = random.rand(5)
>>> eta = random.randn(5) * tau
>>>
>>> log_zeroth = empty(5)
>>> mean = empty(5)
>>> variance = empty(5)
>>>
>>> moments = {'log_zeroth': log_zeroth, 'mean': mean, 'variance': variance}
>>> machine.moments(outcome, eta, tau, moments)
>>>
>>> print('%.3f %.3f %.3f' % (log_zeroth[0], mean[0], variance[0]))
-0.671 -0.515 0.946
Authors
License
This project is licensed under the MIT License.
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
liknorm-1.1.14.tar.gz
(6.4 kB
view hashes)
Built Distributions
Close
Hashes for liknorm-1.1.14-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 740dd26aa6368aa759c8e1f8e22fce2dd8ccb763376bf07816e5d2b0a4121121 |
|
MD5 | d691db7ce852653d3c05651b4ac86861 |
|
BLAKE2b-256 | ef7a5f7b75c995fe066de3580ffaeccad27024163bcd7491bec8618890deb804 |
Close
Hashes for liknorm-1.1.14-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fad43134b5a2732957a8384d1d143c74e4ec3545052118d1ad4c971bce0f4de8 |
|
MD5 | d1eaf8c643f0166953d3c8d7a4f11b63 |
|
BLAKE2b-256 | 801bac2b44210f1060fc9e256798a59783b7979a13ef8f8db2d88dbe0d37249b |
Close
Hashes for liknorm-1.1.14-cp37-cp37m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb732656a5fed695831fdb84131024a9e3189393b07dcb227c86188f90f6a5a3 |
|
MD5 | cd5a1547597d85688ff8e9f6031d4b19 |
|
BLAKE2b-256 | d6da69eee51b4546820d605ae0c4888e4e719d31d624442b2801da5fffdd88f9 |
Close
Hashes for liknorm-1.1.14-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d79afe2fe96569f2f57a78cb4d2f0c0c73cd4b4848d7ae176092bb8aea8ebe9c |
|
MD5 | d1c276218b5e37bd8a3fc85b3668c438 |
|
BLAKE2b-256 | 1649ee8610c7103c9a5d560967b316d9f80309e5bc1873d78a55627f7c504d35 |
Close
Hashes for liknorm-1.1.14-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5eb122fa44bbc2459d90c6f0b25c3ef647dacca24cfe34c24fa8fbe3c2351a94 |
|
MD5 | 9f3c45330d04677867c2cf5ff024bcbb |
|
BLAKE2b-256 | 74a380d273c48726f1e84e99f8d2d749bbdde379c919169863501bc46dbd7ee2 |
Close
Hashes for liknorm-1.1.14-cp36-cp36m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c9c24259119ae326231376783ac21e443fe6e48bd748b8ef9713e4309f9195b |
|
MD5 | 6302c04e76857da8f96d01331bac027a |
|
BLAKE2b-256 | 70f618c36d9ee70ab3d20803d1ad26867ef7c559b093d3e543e904007cf0a7e3 |
Close
Hashes for liknorm-1.1.14-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00515e02315d0967b2e5d918c1e2ba50457721bf17ad089c05015edaad354990 |
|
MD5 | 59ff1cb66ff9cedb2391715197648383 |
|
BLAKE2b-256 | 02c102e9cc8396d4638ea04864940250e296aedcad4556f3939d3a3e21357276 |
Close
Hashes for liknorm-1.1.14-cp27-cp27m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e30a5d602167a5b533a8c67092ffae3cdbb5b6585c9e9f17398ac554c6bf193e |
|
MD5 | 33cd98bf72db1ee52044f669adad08e0 |
|
BLAKE2b-256 | 8b49790c7cd3063feba54892c4115238a78ab09789253fa8eef16a91a9f7c34b |
Close
Hashes for liknorm-1.1.14-cp27-cp27m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5cea1d8bcaf2dafd811c6c569e70048c97ee0cd00216b12fe302ada30b486044 |
|
MD5 | b4cd6c0c5badaeefc434b6a42a6782e2 |
|
BLAKE2b-256 | 3b447032ca5f8629506a570ef1a35c8dd583032780665d3b1e6d3ed9c3c07b51 |