Skip to content

Add preprocessing factors to json file#1035

Merged
scarrazza merged 5 commits into
masterfrom
add_preprocessing_factor_to_json
Jan 13, 2021
Merged

Add preprocessing factors to json file#1035
scarrazza merged 5 commits into
masterfrom
add_preprocessing_factor_to_json

Conversation

@scarlehoff
Copy link
Copy Markdown
Member

@scarlehoff scarlehoff commented Dec 9, 2020

Since I was already looking at what was (or not) independent of the length of the basis I decided to also add the preprocessing factors to the output json file, which I believe was a feature of nnfit that was lost in n3fit just out of laziness.

Example output:
  "preprocessing": [                                                                                                                                                                           
    {                                                                                                                                                                                          
      "fl": "sng",                                                                                                                                                                             
      "smallx": 0.4398651421070099,                                                                                                                                                            
      "largex": 2.6411304473876953,                                                                                                                                                            
      "trainable": false
    },
    {
      "fl": "g",
      "smallx": 0.734717071056366,
      "largex": 1.709303855895996,
      "trainable": false
    },
    {
      "fl": "v",
      "smallx": 0.10663021355867386,
      "largex": 2.4233202934265137,
      "trainable": false
    },
    {
      "fl": "v3",
      "smallx": 0.7327896356582642,
      "largex": 2.9963228702545166,
      "trainable": true
    },
    {
      "fl": "v8",
      "smallx": 0.6589133739471436,
      "largex": 3.629549741744995,
      "trainable": true
    },
    {
      "fl": "t3",
      "smallx": 1.161284327507019,
      "largex": 1.8856220245361328,
      "trainable": true
    },
    {
      "fl": "t8",
      "smallx": 1.1631083488464355,
      "largex": 4.324087142944336,
      "trainable": true
    },
    {
      "fl": "cp",
      "smallx": 0.5860853791236877,
      "largex": 2.698132038116455,
      "trainable": true
    }
  ],

@scarlehoff scarlehoff added the n3fit Issues and PRs related to n3fit label Dec 9, 2020
@scarlehoff scarlehoff requested a review from scarrazza December 9, 2020 17:59
@scarlehoff scarlehoff changed the title add preprocessing factors to json file Add preprocessing factors to json file Dec 9, 2020
@Zaharid Zaharid requested review from siranipour and tgiani December 10, 2020 10:55
@scarlehoff scarlehoff changed the base branch from pertur_c to master December 17, 2020 10:12
@scarlehoff scarlehoff force-pushed the add_preprocessing_factor_to_json branch from aaed4b3 to 60146ca Compare December 17, 2020 10:26
@scarlehoff
Copy link
Copy Markdown
Member Author

Updated with the comments form the code meeting.

Comment thread n3fit/src/n3fit/vpinterface.py Outdated
Comment thread n3fit/src/n3fit/vpinterface.py Outdated
Comment thread n3fit/src/n3fit/vpinterface.py Outdated
Comment thread n3fit/src/n3fit/vpinterface.py Outdated
Comment thread n3fit/src/n3fit/vpinterface.py Outdated
Comment thread n3fit/src/n3fit/vpinterface.py Outdated
Comment thread n3fit/src/n3fit/vpinterface.py Outdated
@scarlehoff
Copy link
Copy Markdown
Member Author

I've added a get_weight_by_name method to the layers so that one can get the right alpha and beta without having to care about the order. If there's a mismatch one would see null in the json file, which I guess is better than just skipping the dictionary.

@scarlehoff scarlehoff force-pushed the add_preprocessing_factor_to_json branch from 7f39e64 to 18d752f Compare January 12, 2021 15:47
@scarlehoff
Copy link
Copy Markdown
Member Author

Forgot to look at the calendar, is "Travis is broken for some reason" day again! :)

@siranipour
Copy link
Copy Markdown
Contributor

The new commits still look good to me.

The failing tests are because of this apparently

@scarlehoff
Copy link
Copy Markdown
Member Author

Funny it never failed before. I'll push a possible fix.

@scarlehoff scarlehoff force-pushed the add_preprocessing_factor_to_json branch from 18d752f to 45233ac Compare January 12, 2021 21:39
Comment thread n3fit/src/n3fit/vpinterface.py
@scarrazza scarrazza merged commit 720e6d4 into master Jan 13, 2021
@scarrazza scarrazza deleted the add_preprocessing_factor_to_json branch January 13, 2021 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

n3fit Issues and PRs related to n3fit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants