-
Notifications
You must be signed in to change notification settings - Fork 73
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
Bugfix for PhaseNet label IDs #277
Conversation
seisbench/generate/labeling.py
Outdated
label: [*model_labels].index(label) for label in labels | ||
} # label ids for P and S | ||
if noise_column: | ||
label_ids["Noise"] = len(model_labels) - sum(list(label_ids.values())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand this formula. I would expect it's just [*model_labels].index("n")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is quite similar to your idea but I wrote it the other way around and add "N" afterwards
Hi @JanisHe , I'm not sure I'd call it a bug but it's definitely good to add this functionality. However, that's why I'd prefer merging it into |
Hi Jannes, |
Hi @JanisHe , |
- Added another test - Fixed issue with noise label id - Extended documentation
I've merged the branch now. Thanks a lot for your contribution! |
Hi Jannes,
when using the original PhaseNet model or diting as base models for transfer learning, the label IDs are wrong. Default labels_ids are {"P": 0, "S": 1, "Noise": 2}, however, PhaseNet and diting have {"Noise": 0, "P": 1, "S": 2}. Therefore, transfer learning was not possible since the ids did not depend on the given labels by the loaded model. I rewrote the method "_colums_to_dict_and_labels" and added an argument model_labels to get the correct dictionary and label IDs.
Cheers,
Janis