• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

doc/source/H17-May-2019-36778

paramz/H17-May-2019-7,6885,143

paramz.egg-info/H03-May-2022-2825

LICENSEH A D17-May-20191.4 KiB2922

MANIFEST.inH A D17-May-2019127 86

PKG-INFOH A D17-May-2019966 2825

README.mdH A D17-May-20194.1 KiB11879

README.rstH A D17-May-2019104 53

setup.cfgH A D17-May-2019203 1711

setup.pyH A D17-May-20195.8 KiB13848

README.md

1# paramz
2
3[![pypi](https://badge.fury.io/py/paramz.svg)](https://pypi.python.org/pypi/paramz)
4[![build](https://travis-ci.org/sods/paramz.svg?branch=master)](https://travis-ci.org/sods/paramz)
5[![codecov](https://codecov.io/gh/sods/paramz/branch/master/graph/badge.svg)](https://codecov.io/gh/sods/paramz)
6
7#### Coverage
8![codecov.io](https://codecov.io/gh/sods/paramz/branch/master/graphs/commits.svg)
9
10Parameterization Framework for parameterized model creation and handling.
11This is a lightweight framework for using parameterized models.
12
13See examples model in 'paramz.examples.<tab>'
14
15### Features:
16
17 - Easy model creation with parameters
18 - Fast optimized access of parameters for optimization routines
19 - Memory efficient storage of parameters (only one copy in memory)
20 - Renaming of parameters
21 - Intuitive printing of models and parameters
22 - Gradient saving directly inside parameters
23 - Gradient checking of parameters
24 - Optimization of parameters
25 - Jupyter notebook integration
26 - Efficient storage of models, for reloading
27 - Efficient caching included
28
29## Installation
30You can install this package via pip
31
32  pip install paramz
33
34There is regular update for this package, so make sure to keep up to date
35(Rerunning the install above will update the package and dependencies).
36
37## Supported Platforms:
38
39Python 2.7, 3.5 and higher
40
41## Saving models in a consistent way across versions:
42
43As pickle is inconsistent across python versions and heavily dependent on class structure, it behaves inconsistent across versions.
44Pickling as meant to serialize models within the same environment, and not to store models on disk to be used later on.
45
46To save a model it is best to save the m.param_array of it to disk (using numpy’s np.save).
47Additionally, you save the script, which creates the model.
48In this script you can create the model using initialize=False as a keyword argument and with the data loaded as normal.
49You then set the model parameters by setting m.param_array[:] = loaded_params as the previously saved parameters.
50Then you initialize the model by m.initialize_parameter(), which will make the model usable.
51Be aware that up to this point the model is in an inconsistent state and cannot be used to produce any results.
52
53```python
54# let X, Y be data loaded above
55# Model creation:
56m = paramz.examples.RidgeRegression(X, Y)
57m.optimize()
58# 1: Saving a model:
59np.save('model_save.npy', m.param_array)
60# 2: loading a model
61# Model creation, without initialization:
62m_load = paramz.examples.RidgeRegression(X, Y,initialize=False)
63m_load.update_model(False) # do not call the underlying expensive algebra on load
64m_load.initialize_parameter() # Initialize the parameters (connect the parameters up)
65m_load[:] = np.load('model_save.npy') # Load the parameters
66m_load.update_model(True) # Call the algebra only once
67print(m_load)
68```
69
70## Running unit tests:
71
72Ensure nose is installed via pip:
73
74    pip install nose
75
76Run nosetests from the root directory of the repository:
77
78    nosetests -v paramz/tests
79
80or using setuptools
81
82    python setup.py test
83
84## Developer Documentation:
85
86- [HTML version](http://paramz.rtfd.io)
87- [PDF version](https://media.readthedocs.org/pdf/paramz/latest/paramz.pdf)
88
89### Compiling documentation:
90
91The documentation is stored in doc/ and is compiled with the Sphinx Python documentation generator, and is written in the reStructuredText format.
92
93The Sphinx documentation is available here: http://sphinx-doc.org/latest/contents.html
94
95**Installing dependencies:**
96
97To compile the documentation, first ensure that Sphinx is installed. On Debian-based systems, this can be achieved as follows:
98
99    sudo apt-get install python-pip
100    sudo pip install sphinx
101
102**Compiling documentation:**
103
104The documentation can be compiled as follows:
105
106    cd doc
107    sphinx-apidoc -o source/ ../GPy/
108    make html
109
110The HTML files are then stored in doc/build/html
111
112## Funding Acknowledgements
113
114Current support for the paramz software is coming through the following projects.
115
116* [EU FP7-PEOPLE Project Ref 316861](http://staffwww.dcs.shef.ac.uk/people/N.Lawrence/projects/mlpm/) "MLPM2012: Machine Learning for Personalized Medicine"
117
118

README.rst

1paramz
2======
3
4Please refer to the github homepage for detailed instructions on installation and usage.
5