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

Conditional Neural Processes #217

Merged
merged 38 commits into from
Aug 12, 2024
Merged

Conditional Neural Processes #217

merged 38 commits into from
Aug 12, 2024

Conversation

mastoffel
Copy link
Collaborator

@mastoffel mastoffel commented Jul 12, 2024

CNP's do meta learning, they train on many datasets with context_x, context_y, target_x as inputs, not one dataset with X, y. This PR makes it work anyway. We create a meta-dataset from standard X, y input, with variable context sizes for each episode. This is then fed into the CNP for training. The full training dataset is stored as an attribute and provided as the context during prediction, so that we can do cnp.predict(X) in the same way as for the other models.

@mastoffel mastoffel requested a review from bryanlimy July 12, 2024 10:21
@mastoffel mastoffel requested a review from edaub July 12, 2024 10:22
Copy link
Contributor

github-actions bot commented Jul 12, 2024

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  autoemulate/emulators
  __init__.py
  conditional_neural_process.py 141-142, 246-247, 253-281, 286, 300
  neural_net_torch.py
  autoemulate/emulators/neural_networks
  base.py
  cnp_module.py
  datasets.py 11
  losses.py
  tests
  test_cnp.py
  test_cnp_dataset.py
  test_estimators.py
Project Total  

This report was generated by python-coverage-comment-action

@codecov-commenter
Copy link

codecov-commenter commented Jul 12, 2024

Codecov Report

Attention: Patch coverage is 97.72727% with 9 lines in your changes missing coverage. Please review.

Project coverage is 91.57%. Comparing base (8c482e6) to head (4659143).
Report is 4 commits behind head on main.

Files Patch % Lines
...utoemulate/emulators/conditional_neural_process.py 92.00% 8 Missing ⚠️
autoemulate/emulators/neural_networks/datasets.py 97.95% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #217      +/-   ##
==========================================
+ Coverage   91.14%   91.57%   +0.43%     
==========================================
  Files          45       51       +6     
  Lines        2393     2802     +409     
==========================================
+ Hits         2181     2566     +385     
- Misses        212      236      +24     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mastoffel mastoffel marked this pull request as ready for review July 23, 2024 10:56
remove attn cnp

remove attn cnp tests

remove attn cnp
@mastoffel mastoffel merged commit 9345877 into main Aug 12, 2024
6 checks passed
@mastoffel mastoffel deleted the neuralprocesses branch August 12, 2024 14:35
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.

2 participants