-
Notifications
You must be signed in to change notification settings - Fork 0
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
New Dataset superclass #89
Conversation
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.
👍
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 appreciate what you're doing here, but there's something that doesn't quite make sense.
The ModelBase
covers all sorts of models, e.g. SHM models, so it doesn't make sense for it to have a method selection_factors_of_sequences
. We could call it something generic like evaluate_sequences
, as long as all the components will make sense for SHM models and DXSM models.
netam/models.py
Outdated
def selection_factors_of_sequences(self, sequences, encoder=None): | ||
if encoder is None: | ||
raise ValueError("An encoder must be provided.") | ||
device = next(self.parameters()).device |
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.
Let's make this a @property
.
I've changed |
Addressing #55, I consolidating some branch lengths-related code into a new superclass
BranchLengthDataset
. I can't seem to find any other duplicated code.The only opportunity for more code reuse would be to abstract methods like
to
that map over all attributes of the class and apply some function. This could be done inBranchLengthDataset
using thevars
builtin, but I think it might be more trouble than it's worth.Will close #55