autofit-2023.3.27.1
2023.3.27.1
2023.3.21.5
2023.3.21.3
2023.1.15.1
2022.7.11.1
2022.7.10.1
2022.6.29.2
2022.6.29.1
2022.5.2.1
2022.3.30.1
2022.3.18.2
2022.2.14.1
2022.2.13.1
2022.11.26.11
2021.9.12.1
2021.8.12.1
2021.6.4.1
2021.6.2.1
2021.10.14.1
0.9.1
0.9.0
0.8.9
0.8.8
0.8.7
0.8.6
0.8.5
0.8.4
0.8.3
0.8.2
0.8.10
0.8.1
0.8.0
0.77.1
0.77.0
0.76.0
0.75.0
0.74.0
0.73.1
0.73.0
0.72.2
0.72.1
0.72.0
0.71.5
0.71.4
0.71.3
0.71.2
0.71.1
0.71.0
0.70.4
0.70.3
0.70.2
0.70.1
0.70.0
0.7.9
0.7.8
0.7.7
0.7.6
0.7.5
0.7.4
0.7.3
0.7.2
0.7.11
0.7.10
0.7.1
0.7.0
0.69.6
0.69.5
0.69.4
0.69.3
0.69.2
0.69.1
0.69.0
0.68.0
0.67.9
0.67.8
0.67.7
0.67.6
0.67.5
0.67.4
0.67.3
0.67.2
0.67.11
0.67.10
0.67.1
0.67.0
0.65.0
0.64.3
0.64.2
0.64.1
0.64.0
0.62.2
0.62.1
0.62.0
0.61.5
0.61.4
0.61.3
0.61.2
0.60.2
0.60.1
0.6.2
0.6.1
0.6.0
0.59.7
0.59.6
0.59.5
0.59.4
0.59.3
0.59.2
0.59.1
0.59.0
0.58.0
0.57.2
0.57.1
0.57.0
0.56.0
0.55.1
0.55.0
0.54.0
0.53.0
0.52.2
0.52.1
0.52.0
0.51.1
0.51.0
0.50.5
0.50.4
0.50.3
0.50.2
0.50.1
0.50.0
0.5.8
0.5.7
0.5.6
0.5.4.0
0.5.3
0.5.2
0.5.1
0.5.0
0.49.1
0.49.0
0.48.1
0.48.0
0.47.0
0.46.2
0.46.1
0.46.0
0.45.4
0.45.3
0.45.2
0.45.1
0.45.0
0.44.2
0.44.1
0.44.0
0.4.6
0.4.5
0.4.4
0.4.3
0.4.2
0.4.0
0.33.9
0.33.8
0.33.7
0.33.6
0.33.5
0.33.4
0.33.3
0.33.2
0.33.1
0.33.0
0.32.1
0.32.0
0.31.4
0.31.3
0.31.2
0.31.1
0.31.0
0.30.5
0.30.4
0.30.3
0.30.2
0.30.1
0.30.0
0.3.2
0.3.1
0.3.0
0.29.5
0.29.4
0.29.3
0.29.2
0.29.1
0.29.0
0.28.3
0.28.2
0.28.1
0.28.0
0.27.4
0.27.3
0.27.2
0.27.1
0.27.0
0.26.6
0.26.5
0.26.4
0.26.3
0.26.2
0.26.1
0.26.0
0.25.5
0.25.4
0.25.3
0.25.2
0.25.1
0.25.0
0.24.4
0.24.3
0.24.2
0.24.1
0.24.0
0.23.9
0.23.8
0.23.7
0.23.6
0.23.5
0.23.4
0.23.3
0.23.2
0.23.13
0.23.12
0.23.11
0.23.10
0.23.1
0.23.0
0.22.6
0.22.5
0.22.4
0.22.3
0.22.2
0.22.1
0.22.0
0.21.0
0.20.1
0.20.0
0.2.1
0.2.0
0.19.2
0.19.1
0.19.0
0.18.9
0.18.8
0.18.7
0.18.6
0.18.5
0.18.4
0.18.3
0.18.2
0.18.1
0.18.0
0.17.5
0.17.4
0.17.3
0.17.2
0.17.1
0.17.0
0.16.1
0.16.0
0.15.3
0.15.2
0.15.1
0.15.0
0.14.0
0.13.0
0.12.0
0.11.2
0.11.1
0.11.0
0.10.1
0.10.0
0.1.0
2023.3.27.1
2023.3.21.5
2023.3.21.4
2023.3.21.3
2023.1.15.1
2022.7.11.1
2022.7.10.1
2022.6.29.2
2022.6.29.1
2022.5.2.1
2022.3.30.1
2022.3.18.2
2022.2.14.1
2022.2.13.1
2022.11.26.11
2021.9.12.1
2021.8.12.1
2021.6.4.1
2021.6.2.1
2021.10.14.1
0.9.1
0.9.0
0.8.9
0.8.8
0.8.7
0.8.6
0.8.5
0.8.4
0.8.3
0.8.2
0.8.10
0.8.1
0.8.0
0.77.1
0.77.0
0.76.0
0.75.0
0.74.0
0.73.1
0.73.0
0.72.2
0.72.1
0.72.0
0.71.5
0.71.4
0.71.3
0.71.2
0.71.0
0.70.4
0.70.3
0.70.2
0.70.1
0.70.0
0.7.9
0.7.8
0.7.7
0.7.6
0.7.5
0.7.4
0.7.3
0.7.2
0.7.11
0.7.10
0.7.1
0.7.0
0.69.6
0.69.5
0.69.4
0.69.3
0.69.2
0.69.1
0.69.0
0.68.0
0.67.9
0.67.8
0.67.7
0.67.6
0.67.5
0.67.4
0.67.3
0.67.2
0.67.11
0.67.10
0.67.1
0.67.0
0.65.0
0.64.3
0.64.2
0.64.1
0.64.0
0.62.2
0.62.1
0.61.5
0.61.4
0.61.3
0.61.2
0.60.2
0.60.1
0.6.2
0.6.1
0.6.0
0.59.7
0.59.6
0.59.5
0.59.4
0.59.3
0.59.2
0.59.1
0.59.0
0.58.0
0.57.2
0.57.1
0.57.0
0.56.0
0.55.0
0.54.0
0.53.0
0.52.2
0.52.1
0.52.0
0.51.1
0.51.0
0.50.5
0.50.4
0.50.3
0.50.2
0.50.1
0.50.0
0.5.8
0.5.7
0.5.6
0.5.4.0
0.5.3
0.5.2
0.5.1
0.5.0
0.49.1
0.49.0
0.48.1
0.48.0
0.47.0
0.46.2
0.46.1
0.46.0
0.45.4
0.45.3
0.45.2
0.45.1
0.45.0
0.44.2
0.44.1
0.44.0
0.4.6
0.4.5
0.4.4
0.4.3
0.4.2
0.4.0
0.33.9
0.33.8
0.33.7
0.33.6
0.33.5
0.33.4
0.33.3
0.33.2
0.33.1
0.33.0
0.32.1
0.32.0
0.31.4
0.31.3
0.31.2
0.31.1
0.31.0
0.30.5
0.30.4
0.30.3
0.30.2
0.30.1
0.30.0
0.3.2
0.3.1
0.3.0
0.29.5
0.29.4
0.29.3
0.29.2
0.29.1
0.29.0
0.28.3
0.28.2
0.28.1
0.28.0
0.27.4
0.27.3
0.27.2
0.27.1
0.27.0
0.26.6
0.26.5
0.26.4
0.26.3
0.26.2
0.26.1
0.26.0
0.25.5
0.25.4
0.25.3
0.25.2
0.25.1
0.25.0
0.24.4
0.24.3
0.24.2
0.24.1
0.24.0
0.23.9
0.23.8
0.23.7
0.23.6
0.23.5
0.23.4
0.23.3
0.23.2
0.23.13
0.23.12
0.23.11
0.23.10
0.23.1
0.23.0
0.22.6
0.22.5
0.22.4
0.22.3
0.22.2
0.22.1
0.22.0
0.21.0
0.20.1
0.20.0
0.2.1
0.2.0
0.19.2
0.19.1
0.19.0
0.18.9
0.18.8
0.18.7
0.18.6
0.18.5
0.18.4
0.18.3
0.18.2
0.18.1
0.18.0
0.17.5
0.17.4
0.17.3
0.17.2
0.17.1
0.17.0
0.16.1
0.16.0
0.15.3
0.15.2
0.15.1
0.15.0
0.14.0
0.13.0
0.12.0
0.11.2
0.11.1
0.11.0
0.10.1
0.10.0
0.1.0
توضیحات
Classy Probabilistic Programming
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | autofit-2023.3.27.1 |
| نام | autofit |
| نسخه کتابخانه | 2023.3.27.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | James Nightingale and Richard Hayes |
| ایمیل نویسنده | richard@rghsoftware.co.uk |
| آدرس صفحه اصلی | https://github.com/rhayes777/PyAutoFit |
| آدرس اینترنتی | https://pypi.org/project/autofit/ |
| مجوز | MIT License |
PyAutoFit: Classy Probabilistic Programming
===========================================
.. |binder| image:: https://mybinder.org/badge_logo.svg
:target: https://mybinder.org/v2/gh/Jammy2211/autofit_workspace/HEAD
.. |RTD| image:: https://readthedocs.org/projects/pyautofit/badge/?version=latest
:target: https://pyautofit.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
.. |Tests| image:: https://github.com/rhayes777/PyAutoFit/actions/workflows/main.yml/badge.svg
:target: https://github.com/rhayes777/PyAutoFit/actions
.. |Build| image:: https://github.com/rhayes777/PyAutoBuild/actions/workflows/release.yml/badge.svg
:target: https://github.com/rhayes777/PyAutoBuild/actions
.. |JOSS| image:: https://joss.theoj.org/papers/10.21105/joss.02550/status.svg
:target: https://doi.org/10.21105/joss.02550
|binder| |Tests| |Build| |RTD| |JOSS|
`Installation Guide <https://pyautofit.readthedocs.io/en/latest/installation/overview.html>`_ |
`readthedocs <https://pyautofit.readthedocs.io/en/latest/index.html>`_ |
`Introduction on Binder <https://mybinder.org/v2/gh/Jammy2211/autofit_workspace/release?filepath=introduction.ipynb>`_ |
`HowToFit <https://pyautofit.readthedocs.io/en/latest/howtofit/howtofit.html>`_
..
_ One day make these BOLD with a colon like my fellowsahip proposa,s where the first is Model Composition & Fitting: Tools for composing a complex model and fitting it with dynesty...
PyAutoFit is a Python based probabilistic programming language for the fully Bayesian analysis of extremely large
datasets which:
- Makes it simple to compose and fit multi-level models using a range of Bayesian inference libraries, such as `emcee <https://github.com/dfm/emcee>`_ and `dynesty <https://github.com/joshspeagle/dynesty>`_.
- Handles the 'heavy lifting' that comes with model-fitting, including model composition & customization, outputting results, model-specific visualization and posterior analysis.
- Is built for *big-data* analysis, whereby results are output as a sqlite database which can be queried after model-fitting is complete.
**PyAutoFit** supports advanced statistical methods such as `graphical and hierarchical models <https://pyautofit.readthedocs.io/en/latest/features/graphical.html>`_, `model-fit chaining <https://pyautofit.readthedocs.io/en/latest/features/search_chaining.html>`_, `sensitivity mapping <https://pyautofit.readthedocs.io/en/latest/features/sensitivity_mapping.html>`_ and `massively parallel model-fits <https://pyautofit.readthedocs.io/en/latest/features/search_grid_search.html>`_ .
Getting Started
---------------
The following links are useful for new starters:
- `The introduction Jupyter Notebook on Binder <https://mybinder.org/v2/gh/Jammy2211/autofit_workspace/release?filepath=introduction.ipynb>`_, where you can try **PyAutoFit** in a web browser (without installation).
- `The PyAutoFit readthedocs <https://pyautofit.readthedocs.io/en/latest>`_, which includes an `installation guide <https://pyautofit.readthedocs.io/en/latest/installation/overview.html>`_ and an overview of **PyAutoFit**'s core features.
- `The autofit_workspace GitHub repository <https://github.com/Jammy2211/autofit_workspace>`_, which includes example scripts and the `HowToFit Jupyter notebook tutorials <https://github.com/Jammy2211/autofit_workspace/tree/master/notebooks/howtofit>`_ which give new users a step-by-step introduction to **PyAutoFit**.
Why PyAutoFit?
--------------
**PyAutoFit** began as an Astronomy project for fitting large imaging datasets of galaxies after the developers found that existing PPLs
(e.g., `PyMC3 <https://github.com/pymc-devs/pymc3>`_, `Pyro <https://github.com/pyro-ppl/pyro>`_, `STAN <https://github.com/stan-dev/stan>`_)
were not suited to the model fitting problems many Astronomers faced. This includes:
- Efficiently analysing large and homogenous datasets with an identical model fitting procedure, with tools for processing the large libraries of results output.
- Problems where likelihood evaluations are expensive (e.g. run times of days per model-fit), necessitating highly customizable model-fitting pipelines with support for massively parallel computing.
- Fitting many different models to the same dataset with tools that streamline model comparison.
If these challenges sound familiar, then **PyAutoFit** may be the right software for your model-fitting needs!
API Overview
------------
To illustrate the **PyAutoFit** API, we'll use an illustrative toy model of fitting a one-dimensional Gaussian to
noisy 1D data. Here's the ``data`` (black) and the model (red) we'll fit:
.. image:: https://raw.githubusercontent.com/rhayes777/PyAutoFit/master/files/toy_model_fit.png
:width: 400
We define our model, a 1D Gaussian by writing a Python class using the format below:
.. code-block:: python
class Gaussian:
def __init__(
self,
centre=0.0, # <- PyAutoFit recognises these
normalization=0.1, # <- constructor arguments are
sigma=0.01, # <- the Gaussian's parameters.
):
self.centre = centre
self.normalization = normalization
self.sigma = sigma
"""
An instance of the Gaussian class will be available during model fitting.
This method will be used to fit the model to data and compute a likelihood.
"""
def model_data_1d_via_xvalues_from(self, xvalues):
transformed_xvalues = xvalues - self.centre
return (self.normalization / (self.sigma * (2.0 * np.pi) ** 0.5)) * \
np.exp(-0.5 * (transformed_xvalues / self.sigma) ** 2.0)
**PyAutoFit** recognises that this Gaussian may be treated as a model component whose parameters can be fitted for via
a non-linear search like `emcee <https://github.com/dfm/emcee>`_.
To fit this Gaussian to the ``data`` we create an Analysis object, which gives **PyAutoFit** the ``data`` and a
``log_likelihood_function`` describing how to fit the ``data`` with the model:
.. code-block:: python
class Analysis(af.Analysis):
def __init__(self, data, noise_map):
self.data = data
self.noise_map = noise_map
def log_likelihood_function(self, instance):
"""
The 'instance' that comes into this method is an instance of the Gaussian class
above, with the parameters set to values chosen by the non-linear search.
"""
print("Gaussian Instance:")
print("Centre = ", instance.centre)
print("normalization = ", instance.normalization)
print("Sigma = ", instance.sigma)
"""
We fit the ``data`` with the Gaussian instance, using its
"model_data_1d_via_xvalues_from" function to create the model data.
"""
xvalues = np.arange(self.data.shape[0])
model_data = instance.model_data_1d_via_xvalues_from(xvalues=xvalues)
residual_map = self.data - model_data
chi_squared_map = (residual_map / self.noise_map) ** 2.0
log_likelihood = -0.5 * sum(chi_squared_map)
return log_likelihood
We can now fit our model to the ``data`` using a non-linear search:
.. code-block:: python
model = af.Model(Gaussian)
analysis = Analysis(data=data, noise_map=noise_map)
emcee = af.Emcee(nwalkers=50, nsteps=2000)
result = emcee.fit(model=model, analysis=analysis)
The ``result`` contains information on the model-fit, for example the parameter samples, maximum log likelihood
model and marginalized probability density functions.
Support
-------
Support for installation issues, help with Fit modeling and using **PyAutoFit** is available by
`raising an issue on the GitHub issues page <https://github.com/rhayes777/PyAutoFit/issues>`_.
We also offer support on the **PyAutoFit** `Slack channel <https://pyautoFit.slack.com/>`_, where we also provide the
latest updates on **PyAutoFit**. Slack is invitation-only, so if you'd like to join send
an `email <https://github.com/Jammy2211>`_ requesting an invite.
نیازمندی
| مقدار | نام |
|---|---|
| ==2.2.1 | corner |
| >=4.2.1 | decorator |
| >=0.3.1.1 | dill |
| ==2.1.0 | dynesty |
| >=0.4.0 | typing-inspect |
| >=3.1.3 | emcee |
| - | matplotlib |
| >=1.0.0 | numpydoc |
| ==0.2.0 | pyprojroot |
| ==1.3.0 | pyswarms |
| >=2.10.0 | h5py |
| ==1.3.20 | SQLAlchemy |
| <=1.8.1,>=1.5.4 | scipy |
| ==1.6.3 | astunparse |
| ==3.0.0 | xxhash |
| ==2023.3.27.1 | autoconf |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.7 | Python |
نحوه نصب
نصب پکیج whl autofit-2023.3.27.1:
pip install autofit-2023.3.27.1.whl
نصب پکیج tar.gz autofit-2023.3.27.1:
pip install autofit-2023.3.27.1.tar.gz