Skip to content

Adapted NN generation to n3fit update#25

Merged
comane merged 5 commits intomainfrom
fix-n3fit-NNgeneration-compat
Feb 18, 2026
Merged

Adapted NN generation to n3fit update#25
comane merged 5 commits intomainfrom
fix-n3fit-NNgeneration-compat

Conversation

@ElieHammou
Copy link
Collaborator

This PR addresses the issue #24.

I have imported the new ReplicaSettings class and created an instance of it for _pdfNN_layer_generator to use as an argument.

Another issue was caused by the function write_exportgrid from colibri.export_results which was expecting Q0 as an argument rather than Q. I have fixed this as well.

Note that there is still a mismatch between the previous keys (initializer_name and layer_type), still present in the example runcard, and the new ones expected by ReplicaSettings (initializer and layer_type). It could be nice to harmonise this before merging but it is purely cosmetic:

    replicas_settings = [
        ReplicaSettings(
            nodes=nodes,
            activations=activations,
            initializer=initializer_name,
            architecture=layer_type,
            seed=seed,
        )

The fixes were successfully test on the example POD runcard.

Copilot AI review requested due to automatic review settings December 9, 2025 16:18
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adapts the codebase to work with an updated n3fit API by migrating from passing individual parameters to _pdfNN_layer_generator to using the new ReplicaSettings class, and correcting a parameter name in write_exportgrid calls.

Key Changes:

  • Imports and uses the new ReplicaSettings class from n3fit.model_gen to configure neural network replicas
  • Updates _pdfNN_layer_generator function call to accept replicas_settings instead of individual parameters (nodes, activations, initializer_name, layer_type, seed, impose_sumrule, num_replicas)
  • Fixes parameter name from Q to Q0 in write_exportgrid function calls

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ElieHammou
Copy link
Collaborator Author

The build test has failed because the right version of eko could not be found with python 3.11.
I installed my environment with the file from the repo and it gave me python 3.12.12 so I am not sure why the test points to 3.11

@ElieHammou ElieHammou requested a review from comane December 10, 2025 09:26
@ElieHammou ElieHammou mentioned this pull request Feb 16, 2026
@LucaMantani LucaMantani changed the base branch from main to avoid_basis_evolution_issue7 February 17, 2026 09:13
@LucaMantani LucaMantani changed the base branch from avoid_basis_evolution_issue7 to main February 17, 2026 09:13
Copy link
Member

@LucaMantani LucaMantani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Thanks @ElieHammou

Copy link
Member

@comane comane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks for fixing it

@comane comane merged commit dd66c4a into main Feb 18, 2026
2 checks passed
@comane comane deleted the fix-n3fit-NNgeneration-compat branch February 18, 2026 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants