-
Notifications
You must be signed in to change notification settings - Fork 3
[doc] n3fit model #437
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
Merged
Merged
[doc] n3fit model #437
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
ce9b5c6
first commit to document n3fit model
vschutze-alt 093b541
First commit
ecole41 50b96c4
architecture instructions
ecole41 9c41aa7
Update colibri/doc/sphinx/source/available-models/n3fit.rst
ecole41 15b666d
add blank lines for good compilation
vschutze-alt fc26f92
fix typo
vschutze-alt 14ad42d
make subtitles compile properly
vschutze-alt 0c5c6f0
add more details
vschutze-alt 32bf4a0
update info on settings
vschutze-alt ec9fb69
clean up runcard parameters
vschutze-alt f0be0a7
add more details
vschutze-alt d087740
remove todo
vschutze-alt 76a8aaf
add link to keras
vschutze-alt 5f6d612
Merge branch 'main' into doc_n3fit
comane f66dfeb
Added default to mcseed and added it to mc runcard example
ecole41 8cdffd8
change mcseed to monte carlo settings
vschutze-alt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| .. _n3fit-model: | ||
|
|
||
| =========== | ||
| n3fit Model | ||
| =========== | ||
|
|
||
| **Model Respository:** https://github.com/HEP-PBSP/colibri-n3fit/tree/main/colibri_n3fit . | ||
|
|
||
| This model is based on the `n3fit` model used in the NNPDF framework :cite:`NNPDF:2021uiq`, | ||
| which is open source and available here: https://github.com/NNPDF/nnpdf . | ||
|
|
||
|
|
||
| What is this model for | ||
| ---------------------- | ||
|
|
||
| This model is mostly intended to run :ref:`Monte Carlo fits <running_mc_replica>`, | ||
| and can be used to compare NNPDF's n3fit model to other models/parametrisations or | ||
| fitting methodologies. | ||
|
|
||
| Model description | ||
| ----------------- | ||
|
|
||
| This model parametriseses PDFs by the following functional form: | ||
|
|
||
| .. math:: | ||
| :label: eq:nnpdf-parametrisaton | ||
|
|
||
| f_{i}(x) = A_i \mathrm{NN}(x)_{j} * x^{1-\alpha_{j}} * (1-x)^{\beta_{j}}, | ||
|
|
||
| where the PDFs are defined in the evolution basis, as described in Ref. :cite:alp:`NNPDF:2021uiq`, | ||
| and :math:`\mathrm{NN}(x)_{j}` is the output of a Neural Network. | ||
|
|
||
| The free parameters of this model are are: | ||
|
|
||
| * The preprocessing parameters, :math:`\alpha` and :math:`\beta`, which are sampled for each replica from uniform distributions, as defined by ``FLAV_INFO_NNPDF40`` in ``colibri-n3fit/colibri_n3fit/utils.py``. These values are fixed during training. | ||
| * The NN weights, which are found by minimising the :math:`\chi^2` (see :ref:`this section <likelihood>`). | ||
|
|
||
| Settings that are specific to this model are described :ref:`below <n3fit-model-settings>`. | ||
|
|
||
|
|
||
| How to use this model | ||
| --------------------- | ||
|
|
||
| Before running a fit, you will have to clone the repository: | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| git clone https://github.com/HEP-PBSP/colibri-n3fit/tree/main/colibri_n3fit , | ||
|
|
||
| and install the dependencies and executable: | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| conda env create -f environment.yml | ||
| conda activate example-colibri-n3fit | ||
| pip install -e . | ||
|
|
||
| You can then run an fit with the available example runcard: | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| colibri_n3fit colibri_n3fit/runcards/example_pdf_fit_monte_carlo.yaml -r 1 | ||
|
|
||
| To analyse the results of this fit, you can follow the instructions given in | ||
| :ref:`this section <mc_fit_folders>`. | ||
|
|
||
|
|
||
| .. _n3fit-model-settings: | ||
|
|
||
| Model specific settings | ||
| ^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
|
||
| The neural network architecture can be defined in the runcard through the following parameters: | ||
|
|
||
| .. code-block:: | ||
|
|
||
| nodes: [25,20,8] # The number of nodes in each layer of the neural network. The output should be set to the number of PDF flavours | ||
| activations: [tanh, tanh, linear] | ||
| nnseed: 945709987 # Seed used for the sampling of preprocessing factors | ||
|
|
||
| - ``nodes``: the number of nodes in each hidden layer. The last layer should have a number of nodes equal to the number of PDF flavours being fitted. All flavours in the evolution basis are fitted by default in this model, but you can choose to fit a subset of these with ``flavour_mapping`` if and only if you are running a :ref:`closure test <lh-closure-test>`. | ||
| - ``activations``: the activation function to be used in each hidden layer, e.g. ``tanh`` or ``linear``. You can read about other options in the `Keras documentation <https://keras.io/api/layers/activations/>`_ . | ||
| - ``nnseed``: The random seed used to sample the preprocessing factors :math:`\alpha` and :math:`\beta` from uniform distributions for each replica. | ||
|
|
||
| You can read more about other relevant settings, such as Monte Carlo or Training settings in the :ref:`section on how to run Monte Carlo fits <running_mc_replica>`. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.