Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor!: implement Model interface to lambdify Callables #222

Merged
merged 60 commits into from
Mar 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
e4b5d0f
build: install sympy expertsystem
redeboer Jan 26, 2021
956d2b8
ci: add numba to style requirements
redeboer Feb 18, 2021
0b50e84
ci: add jax to test and doc requirements
redeboer Feb 18, 2021
11f6617
ci: upgrade developer dependencies (automatic)
redeboer Feb 9, 2021
ce546da
TEMP ci: deactivate upgrade workflow
redeboer Feb 18, 2021
97cad34
TEMP ci: run notebooks on RTD branch previews
redeboer Feb 16, 2021
4a1c824
feat: add sympy base model Function adapter
spflueger Jan 26, 2021
f3a7ff6
refactor: calculate non squared invariant masses
spflueger Feb 8, 2021
cf55022
feat: define SympyModel interface
spflueger Feb 8, 2021
58d05c3
feat!: add unbinned log likelihood for SympyModels
spflueger Feb 8, 2021
99bcae5
feat: add common backend argument process function
spflueger Feb 9, 2021
0c5f4d6
feat!: add gradient support for estimators
spflueger Feb 9, 2021
778b23b
docs: add sympy notebooks
redeboer Feb 9, 2021
79c1314
docs: illustrate runtimes backend switch
redeboer Feb 9, 2021
003c1af
docs: run jax with analytic gradient
redeboer Feb 10, 2021
15ae83e
chore: make pylint and mypy work
spflueger Feb 10, 2021
6636cdc
test: analytic gradient creator function using jax
spflueger Feb 10, 2021
bba3ae5
feat: allow complex valued parameters + flattening
spflueger Feb 16, 2021
c8e6dd6
fix: allow YamlSummary to dump and load complex
redeboer Feb 17, 2021
e240892
chore: remove old AmplitudeModel code and fix tests
spflueger Feb 16, 2021
bb45f92
docs: update usage notebooks new sympy design
spflueger Feb 17, 2021
b3b80d8
refactor: wrap sympy lambdify for custom behavior
spflueger Feb 18, 2021
2134119
feat: add numba.jit support
redeboer Feb 18, 2021
c44b808
docs: illustrate complete workflow on one page
redeboer Feb 18, 2021
8aafa20
fix: add option to disable tqdm in minuit
redeboer Feb 18, 2021
f8a7556
docs: add live plot of fit with custom callback
redeboer Feb 18, 2021
60f5d83
refactor: adapt to latest version of sympy expertsystem
redeboer Feb 24, 2021
3be27d6
chore: adapt docs and type changes for Function
spflueger Mar 2, 2021
585c6f8
chore: remove old Unbinned Log Likelihood
spflueger Mar 2, 2021
cd45027
WIP refactor!: implement HelicityKinematics.convert
redeboer Mar 5, 2021
1ccb487
WIP: improve interfaces
spflueger Mar 8, 2021
d4ac59f
WIP fix: finish Model implementation up to type hints
redeboer Mar 8, 2021
1f16c5f
Merge branch 'sympy-new-interface' into sympy
redeboer Mar 8, 2021
a14c4d8
refactor!: implement MomentumPool from expertsystem
redeboer Mar 8, 2021
7e7d0da
fix: add note about Data interface aliases
redeboer Mar 11, 2021
11d9d4e
Merge branch 'master' into sympy
redeboer Mar 11, 2021
72276e4
refactor: follow renaming to EventCollection and HelicityAdapter
redeboer Mar 11, 2021
6b8a559
refactor!: add DataConverter interface (WIP)
spflueger Mar 11, 2021
454980a
Merge branch 'master' into sympy
redeboer Mar 11, 2021
c01fafd
chore: fix some code parts from previous refator
spflueger Mar 11, 2021
c1b016e
Revert "TEMP ci: deactivate upgrade workflow"
redeboer Mar 11, 2021
06de0a6
fix: update documentation to DataAdapter
redeboer Mar 11, 2021
65801ce
ci: upgrade developer dependencies (automatic)
redeboer Mar 11, 2021
30c6e78
fix: linting errors
redeboer Mar 12, 2021
d8e38b8
refactor: rename physics.amplitude to model.sympy
redeboer Mar 12, 2021
4833a68
refactor: rename tf_phasespace to tensorflow
redeboer Mar 12, 2021
0601496
ci: upgrade developer dependencies (automatic)
redeboer Mar 12, 2021
5e4678d
docs: improve module descriptions
redeboer Mar 12, 2021
5429044
refactor: rename data.tensorflow to data.phasespace
redeboer Mar 12, 2021
7851185
refactor: move data generate functions to data module
redeboer Mar 12, 2021
a853540
refactor: merge model.sympy into model
redeboer Mar 12, 2021
e56cdcd
Merge branch 'master' into sympy
redeboer Mar 12, 2021
1bef381
docs: update README.md
redeboer Mar 12, 2021
2f48d1b
docs: improve wording in notebooks
redeboer Mar 12, 2021
7601bf7
docs: shorten URLs of example notebooks
redeboer Mar 12, 2021
c4d776b
docs: move custom callback example to step 3
redeboer Mar 12, 2021
db711b5
refactor: rename data.helicity to data.adapter
redeboer Mar 12, 2021
11b5701
ci: upgrade developer dependencies (automatic)
redeboer Mar 12, 2021
6b09286
ci: activate nbqa-flake8 and fix errors
redeboer Mar 12, 2021
fcd8e7a
Revert "TEMP ci: run notebooks on RTD branch previews"
redeboer Mar 12, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*.json
*.npy
*.pdf
*.pickle
*.png
*.svg
*.v2
Expand Down
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ repos:
hooks:
- id: nbqa-black
args: [--nbqa-mutate]
- id: nbqa-flake8
args: ["--extend-ignore=E402,F821"]
- id: nbqa-isort
args: [--nbqa-mutate]

Expand Down
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@
"telemetry.enableCrashReporter": false,
"telemetry.enableTelemetry": false,
"yaml.schemas": {
"https://raw.githubusercontent.com/ComPWA/expertsystem/0.6.10/src/expertsystem/schemas/amplitude-model.json": [
"https://raw.githubusercontent.com/ComPWA/expertsystem/0.7.0a0/src/expertsystem/schemas/amplitude-model.json": [
"*recipe.y*ml"
],
"https://raw.githubusercontent.com/ComPWA/expertsystem/0.6.10/src/expertsystem/schemas/particle-list.json": [
"https://raw.githubusercontent.com/ComPWA/expertsystem/0.7.0a0/src/expertsystem/schemas/particle-list.json": [
"*particle.y*ml"
]
}
Expand Down
15 changes: 5 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,13 @@
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort)

TensorWaves is a Python package for doing Partial Wave Analysis with
[TensorFlow](https://www.tensorflow.org/) as computational backend. The package
originates from [pycompwa](https://compwa.github.io/), which did its
computations through ([ComPWA](https://github.com/ComPWA/ComPWA)) ― ComPWA's
function tree is similar to TensorFlow graphs and can therefore be replaced by
the tools that TensorFlow already offers. The decision to completely migrate
ComPWA to TensorFlow has been further inspired by
[TensorFlowAnalysis](https://gitlab.cern.ch/poluekt/TensorFlowAnalysis) and
[zfit](https://github.com/zfit/zfit/).
TensorWaves is a fitter package that optimizes mathematical models to data
samples. The models can be any mathematical expression that is then converted
to any computational backend. In addition, TensorWaves provides functionality
to generate toy Monte Carlo data samples.

All documentation can be found on
[tensorwaves.rtfd.io](https://pwa.readthedocs.io/projects/tensorwaves/).
[tensorwaves.rtfd.io](https://pwa.readthedocs.io/projects/tensorwaves).

For an overview of **upcoming releases and planned functionality**, see
[here](https://github.com/ComPWA/tensorwaves/milestones?direction=asc&sort=title&state=open).
Expand Down
23 changes: 22 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
],
"language": "en-US",
"words": [
"backends",
"blatt",
"bottomness",
"breit",
Expand All @@ -72,6 +73,8 @@
"itertools",
"jsonschema",
"jupyter",
"lambdifying",
"lineshape",
"mathbb",
"matplotlib",
"mkdir",
Expand All @@ -97,17 +100,20 @@
"topness",
"traceback",
"unbinned",
"vectorize",
"venv",
"weisskopf",
"xcode",
"zfit"
],
"ignoreWords": [
"amplitf",
"arange",
"atfi",
"axvline",
"cano",
"celltoolbar",
"cmin",
"codacy",
"codecov",
"codemirror",
Expand All @@ -118,18 +124,24 @@
"dtype",
"eval",
"evalf",
"figsize",
"fmin",
"fval",
"genindex",
"gridspec",
"heli",
"histtype",
"iloc",
"imag",
"iminuit",
"indeterministic",
"isort",
"jupyterlab",
"keras",
"kernelspec",
"lambdification",
"lambdified",
"lambdify",
"linestyle",
"linkcheck",
"linspace",
Expand All @@ -143,11 +155,13 @@
"mprime",
"nbconvert",
"nbformat",
"nbins",
"nbody",
"nbsphinx",
"ncalls",
"ndarray",
"noqa",
"numba",
"pandoc",
"phasespace",
"phsp",
Expand All @@ -162,11 +176,18 @@
"pytestconfig",
"rightarrow",
"rtfd",
"scipy",
"seealso",
"sharex",
"subsys",
"tolist",
"tqdm",
"unflatten",
"unflattened",
"unnormalized",
"vstack",
"xlabel"
"xlabel",
"xlim",
"ylim"
]
}
4 changes: 3 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,17 +135,19 @@
# Intersphinx settings
intersphinx_mapping = {
"expertsystem": (
"https://pwa.readthedocs.io/projects/expertsystem/en/0.6.10",
"https://pwa.readthedocs.io/projects/expertsystem/en/0.7.0a0",
None,
),
"iminuit": ("https://iminuit.readthedocs.io/en/stable", None),
"jax": ("https://jax.readthedocs.io/en/stable", None),
"matplotlib": ("https://matplotlib.org", None),
"mypy": ("https://mypy.readthedocs.io/en/stable", None),
"numpy": ("https://numpy.org/doc/stable", None),
"pandas": ("https://pandas.pydata.org/pandas-docs/stable", None),
"pwa": ("https://pwa.readthedocs.io", None),
"pycompwa": ("https://compwa.github.io", None),
"python": ("https://docs.python.org/3", None),
"sympy": ("https://docs.sympy.org/latest", None),
"tensorflow": (
"https://www.tensorflow.org/api_docs/python",
"tensorflow.inv",
Expand Down
30 changes: 20 additions & 10 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,27 @@ For an overview of upcoming releases and planned functionality, see
```
````

For a quick demo of the TensorWaves workflow, see {doc}`/usage`.

TensorWaves is a Python package for doing Partial Wave Analysis with
[TensorFlow](https://www.tensorflow.org) as computational backend. The package
originates from [pycompwa](pycompwa), which did its computations through
[ComPWA](https://github.com/ComPWA/ComPWA) — ComPWA's function tree is similar
to TensorFlow graphs and can therefore be replaced by the tools that TensorFlow
already offers. The decision to completely migrate ComPWA to TensorFlow has
been further inspired by
TensorWaves is a fitter package that optimizes mathematical models to data
samples. The models can be any mathematical expression (best expressed with
{mod}`sympy`) that is then converted to any computational backend. In addition,
the {mod}`tensorwaves.data` module allows one to generate toy data samples.

```{link-button} usage
---
classes: btn-outline-primary btn-block
type: ref
text: Click here for a quick demo
---
```

The package originates from {mod}`pycompwa`, which did its computations through
[ComPWA](https://github.com/ComPWA/ComPWA). ComPWA's function tree is similar
to for instance
[TensorFlow graphs](https://www.tensorflow.org/tensorboard/graphs) and
[SymPy expression trees](https://docs.sympy.org/latest/tutorial/manipulation.html).
The decision to use Python only has been further inspired by
[TensorFlowAnalysis](https://gitlab.cern.ch/poluekt/TensorFlowAnalysis)/[AmpliTF](https://github.com/apoluekt/AmpliTF)
and [zfit](https://github.com/zfit/zfit)
and [zfit](https://github.com/zfit/zfit).

## Table of Contents

Expand Down
1 change: 1 addition & 0 deletions docs/tensorflow.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Version: 2
# The remainder of this file is compressed using zlib.

tf.Tensor py:class 1 tf/Tensor -
tf.Variable py:class 1 tf/Variable -
tensorflow.python.keras.losses.Loss py:class 1 tf/keras/losses/Loss -
tensorflow.python.ops.stateful_random_ops.Generator py:class 1 tf/random/Generator -
Expand Down
Loading