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

Refactor models and losses #1

Merged
merged 8 commits into from Oct 12, 2021
Merged

Refactor models and losses #1

merged 8 commits into from Oct 12, 2021

Conversation

NinelK
Copy link
Collaborator

@NinelK NinelK commented Oct 8, 2021

This refactoring is necessary if we want to work with different likelihoods for neural and behavioral data.

Before this commit: every loss function was receiving everything (all initial conditions, latents, rates, etc.), including unnecessary data;
Now: loss functions only get what they need as inputs, loss terms are explicitly written in models

  1. Make inputs to loss functions explicit (no getters with magic numbers)
  2. model.call() does not return inputs anymore, which was confusing and potentially misleading
  3. Behavioral scale added: this parameter should make the model invariant to the scale of behavioral data
  4. Add 'full' and 'causal' decoders (like in the old code)
  5. Fix TNDM model saving: now decoder dimensions are saved

1. model.call() does not return inputs anymore, which was confusing and
potentially misleading
2. Make inputs to loss functions explicit (no getters with magic
numbers)
    Before: all loss functions were receiving everything, including
unnecessary data;
    Now: loss functions only get what they need as inputs, loss terms
are explicitely written in models
3. Add neural and behavioral scales: these parameters should make the
model invariant to the scale of data inputs.
4. Add 'full' and 'causal' decoders
5. Fix TNDM model saving: now decoder dimensions are saved
Conditions are needed for the new R2... there is no need for them in the main repo at the moment.
@colehurwitz
Copy link
Collaborator

Reviewing now

@colehurwitz
Copy link
Collaborator

colehurwitz commented Oct 9, 2021

Added a new param, soft_max_min_poisson_log_firing_rate, to both LFADS and TNDM. Hopefully, that doesn't break anything. Now we can adjust that if it is an issue.

The PR looks good! I would add the new likelihoods and masks in a separate PR as we discussed.

@NinelK
Copy link
Collaborator Author

NinelK commented Oct 9, 2021

Hopefully, that doesn't break anything. Now we can adjust that if it is an issue.

Looks good to me. Unit tests are also doing fine.

@NinelK NinelK merged commit 792a2dc into main Oct 12, 2021
@NinelK NinelK deleted the refactoring-losses branch October 14, 2021 14:54
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.

None yet

2 participants