forked from graphnet-team/graphnet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request graphnet-team#646 from RasmusOrsoe/rename-_gnn-to-…
…_architecture Change argument `gnn` to `architecture`
- Loading branch information
Showing
25 changed files
with
91 additions
and
33 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
arguments: | ||
gnn: | ||
backbone: | ||
ModelConfig: | ||
arguments: | ||
add_global_variables_after_pooling: false | ||
|
This file contains 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 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 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
arguments: | ||
gnn: | ||
backbone: | ||
ModelConfig: | ||
arguments: | ||
add_global_variables_after_pooling: false | ||
|
2 changes: 1 addition & 1 deletion
2
configs/models/example_vertex_position_reconstruction_model.yml
This file contains 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
arguments: | ||
gnn: | ||
backbone: | ||
ModelConfig: | ||
arguments: | ||
add_global_variables_after_pooling: false | ||
|
This file contains 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 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 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 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
2 changes: 1 addition & 1 deletion
2
...rained/icecube/upgrade/QUESO/SplitInIcePulses_cleaner/SplitInIcePulses_cleaner_config.yml
This file contains 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
Binary file modified
BIN
+556 Bytes
(100%)
...ed/icecube/upgrade/QUESO/SplitInIcePulses_cleaner/SplitInIcePulses_cleaner_state_dict.pth
Binary file not shown.
2 changes: 1 addition & 1 deletion
2
.../models/pretrained/icecube/upgrade/QUESO/neutrino_direction/neutrino_direction_config.yml
This file contains 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
arguments: | ||
gnn: | ||
backbone: | ||
ModelConfig: | ||
arguments: | ||
add_global_variables_after_pooling: false | ||
|
Binary file modified
BIN
+426 Bytes
(100%)
...els/pretrained/icecube/upgrade/QUESO/neutrino_direction/neutrino_direction_state_dict.pth
Binary file not shown.
2 changes: 1 addition & 1 deletion
2
.../icecube/upgrade/QUESO/neutrino_vs_muon_classifier/neutrino_vs_muon_classifier_config.yml
This file contains 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
arguments: | ||
gnn: | ||
backbone: | ||
ModelConfig: | ||
arguments: | ||
add_global_variables_after_pooling: false | ||
|
Binary file modified
BIN
+686 Bytes
(100%)
...cube/upgrade/QUESO/neutrino_vs_muon_classifier/neutrino_vs_muon_classifier_state_dict.pth
Binary file not shown.
2 changes: 1 addition & 1 deletion
2
...aphnet/models/pretrained/icecube/upgrade/QUESO/neutrino_zenith/neutrino_zenith_config.yml
This file contains 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
arguments: | ||
gnn: | ||
backbone: | ||
ModelConfig: | ||
arguments: | ||
add_global_variables_after_pooling: false | ||
|
Binary file modified
BIN
+426 Bytes
(100%)
...et/models/pretrained/icecube/upgrade/QUESO/neutrino_zenith/neutrino_zenith_state_dict.pth
Binary file not shown.
2 changes: 1 addition & 1 deletion
2
...s/pretrained/icecube/upgrade/QUESO/total_neutrino_energy/total_neutrino_energy_config.yml
This file contains 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
arguments: | ||
gnn: | ||
backbone: | ||
ModelConfig: | ||
arguments: | ||
add_global_variables_after_pooling: false | ||
|
Binary file modified
BIN
+1.32 KB
(100%)
...etrained/icecube/upgrade/QUESO/total_neutrino_energy/total_neutrino_energy_state_dict.pth
Binary file not shown.
2 changes: 1 addition & 1 deletion
2
.../icecube/upgrade/QUESO/track_vs_cascade_classifier/track_vs_cascade_classifier_config.yml
This file contains 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
arguments: | ||
gnn: | ||
backbone: | ||
ModelConfig: | ||
arguments: | ||
add_global_variables_after_pooling: false | ||
|
Binary file modified
BIN
+764 Bytes
(100%)
...cube/upgrade/QUESO/track_vs_cascade_classifier/track_vs_cascade_classifier_state_dict.pth
Binary file not shown.
This file contains 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 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,33 @@ | ||
"""Utility functions for handling deprecation transitions.""" | ||
from typing import Dict, Tuple | ||
from copy import deepcopy | ||
from torch import Tensor | ||
|
||
|
||
def rename_state_dict_entries( | ||
state_dict: Dict[str, Tensor], old_phrase: str, new_phrase: str | ||
) -> Tuple[Dict[str, Tensor], bool]: | ||
"""Replace `old_phrase` in state dict fields with `new_phrase`. | ||
Returned state dict is a deepcopy of the input. | ||
Args: | ||
state_dict: The state dict whos fields need renaming. | ||
old_phrase: Phrase in state dict field that needs to be replaced. | ||
new_phrase: Phrase to add in place of `old_phrase` in state dict. | ||
""" | ||
assert isinstance(old_phrase, str) | ||
assert isinstance(new_phrase, str) | ||
|
||
# Make a carbon-copy | ||
new_state_dict = deepcopy(state_dict) | ||
|
||
# Replace old entries in copy | ||
state_dict_altered = False | ||
for key in state_dict.keys(): | ||
if old_phrase in key: | ||
new_key = key.replace(old_phrase, new_phrase) | ||
new_state_dict[new_key] = new_state_dict.pop(key) | ||
state_dict_altered = True | ||
|
||
return new_state_dict, state_dict_altered |
This file contains 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