Skip to content
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

Fix branch length optimization using correct loss; WiggleAct #5

Merged
merged 72 commits into from
Jan 31, 2024
Merged

Conversation

matsen
Copy link
Contributor

@matsen matsen commented Dec 30, 2023

  • Fix the branch length optimization for DNSMs by using WrappedBinaryMutSel.
  • Abstract DNSM classes, including a linear one
  • Add the wiggle activation, and all that was required to make that work, including multiple gradient retries
  • make ReduceLROnPlateau move slower
  • branch length logging and restoring

Fixes #4 and #6

@matsen
Copy link
Contributor Author

matsen commented Jan 23, 2024

An error-tolerant wiggle:

def wiggle(x):
    output = torch.where(x < 1, 0.3 * (x - 1), 0.3 * torch.log(x))
    if torch.isnan(output).any():
        print(x)
        nan_index = torch.where(torch.isnan(output))[0][0]
        raise ValueError(f"NaN in output for input: {x[nan_index]}")
    return output

@matsen
Copy link
Contributor Author

matsen commented Jan 23, 2024

image

@matsen matsen changed the title Fix branch length optimization using correct loss Fix branch length optimization using correct loss; WiggleAct Jan 25, 2024
@matsen matsen linked an issue Jan 26, 2024 that may be closed by this pull request
4 tasks
@matsen matsen merged commit de08fa7 into main Jan 31, 2024
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.

Enable the natural selection model to take values > 1 Incorrect loss for branch length optimization
2 participants