Skip to content

Adjoint sensitivities for Python-imported models with events#1539

Merged
dweindl merged 115 commits intomainfrom
adjoint_event
Jun 25, 2025
Merged

Adjoint sensitivities for Python-imported models with events#1539
dweindl merged 115 commits intomainfrom
adjoint_event

Conversation

@paulstapor
Copy link
Copy Markdown
Contributor

No description provided.

@paulstapor paulstapor changed the base branch from master to develop August 5, 2021 11:31
@codecov
Copy link
Copy Markdown

codecov bot commented Aug 5, 2021

Codecov Report

❌ Patch coverage is 79.16667% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.71%. Comparing base (635a227) to head (83a665e).
⚠️ Report is 94 commits behind head on main.

Files with missing lines Patch % Lines
src/model.cpp 60.00% 6 Missing ⚠️
src/abstract_model.cpp 0.00% 4 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1539      +/-   ##
==========================================
+ Coverage   75.69%   79.71%   +4.01%     
==========================================
  Files         323      328       +5     
  Lines       22195    22403     +208     
  Branches     1513     1514       +1     
==========================================
+ Hits        16801    17859    +1058     
+ Misses       5019     4533     -486     
+ Partials      375       11     -364     
Flag Coverage Δ
cpp 75.43% <79.16%> (?)
cpp_python 33.87% <39.58%> (+0.02%) ⬆️
petab 39.31% <25.00%> (?)
python 34.25% <52.08%> (-40.22%) ⬇️
sbmlsuite-jax ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
include/amici/abstract_model.h 100.00% <ø> (ø)
include/amici/forwardproblem.h 97.00% <ø> (+7.00%) ⬆️
include/amici/model.h 85.71% <ø> (+17.85%) ⬆️
python/sdist/amici/_codegen/cxx_functions.py 96.29% <ø> (ø)
python/sdist/amici/de_export.py 97.42% <100.00%> (+0.01%) ⬆️
python/sdist/amici/de_model.py 93.34% <100.00%> (-0.09%) ⬇️
src/backwardproblem.cpp 93.18% <100.00%> (+3.86%) ⬆️
src/forwardproblem.cpp 95.90% <100.00%> (+3.09%) ⬆️
src/abstract_model.cpp 8.69% <0.00%> (+1.23%) ⬆️
src/model.cpp 86.83% <60.00%> (+6.62%) ⬆️

... and 48 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sonarqubecloud
Copy link
Copy Markdown

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 7 Code Smells

15.4% 15.4% Coverage
13.3% 13.3% Duplication

@dweindl dweindl linked an issue Nov 22, 2021 that may be closed by this pull request
@dweindl dweindl changed the title Adjoint event Adjoint sensitivities for Python-import models with events Jun 25, 2025
@dweindl dweindl marked this pull request as ready for review June 25, 2025 12:04
@dweindl dweindl requested a review from a team as a code owner June 25, 2025 12:04
@dweindl dweindl requested a review from FFroehlich June 25, 2025 12:06
@dweindl
Copy link
Copy Markdown
Member

dweindl commented Jun 25, 2025

This PR extends support for adjoint sensitivity analysis for models with events.
This does not yet cover all cases. Checking gradients for a given model is still highly recommended.

Changes:

  • Generate functions for computing the adjoint state and quadrature updates (fdeltaxB, fdeltaqB) during Python model import
  • Add Python-specific functions with updated signature for fdeltaxB, fdeltaqB
  • Store additional information at discontinuities
  • Test adjoint sensitivities in existing test cases. Some failure are currently ignored and require further investigation.

@dweindl dweindl self-assigned this Jun 25, 2025
@sonarqubecloud
Copy link
Copy Markdown

@dweindl dweindl merged commit 68ed3b5 into main Jun 25, 2025
44 of 47 checks passed
@dweindl dweindl deleted the adjoint_event branch June 25, 2025 15:13
@dweindl dweindl changed the title Adjoint sensitivities for Python-import models with events Adjoint sensitivities for Python-imported models with events Jun 25, 2025
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.

adjoint sensitivies for models with events

4 participants