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

do sensitivities make sense in a tree? #23

Draft
wants to merge 4 commits into
base: mk-gen-substs
Choose a base branch
from
Draft

Conversation

exaexa
Copy link
Collaborator

@exaexa exaexa commented Oct 28, 2024

(might be better as dense vectors)

(might be better as dense vectors)
@exaexa exaexa requested a review from stelmo October 28, 2024 15:03
@exaexa exaexa marked this pull request as draft October 28, 2024 15:03
@exaexa
Copy link
Collaborator Author

exaexa commented Oct 28, 2024

this ain't super good but let's keep it open for comments. You can e.g. nicely get the image of sensitivity to stuff by looking at scalar products, like this:

st.parameters.something' * st.fluxes.someflux

Copy link
Owner

@stelmo stelmo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah yeah, this should end up as some sort of nested tree: e.g.

sens_tree = (
  flux1 = (
    flux1 = 1,
    flux2 = 0.2,
    ...
  ),
  flux2 = (
    flux1 = -0.2,
    flux2 = 1.0,
    ...
)

@stelmo
Copy link
Owner

stelmo commented Oct 28, 2024

hmm maybe a matrix does actually make more sense, especially for gradient descent purposes... but there must be a better way of keeping track of which sensitivity a number in the matrix corresponds to?

@exaexa
Copy link
Collaborator Author

exaexa commented Oct 28, 2024

hmm maybe a matrix does actually make more sense, especially for gradient descent purposes... but there must be a better way of keeping track of which sensitivity a number in the matrix corresponds to?

the GD is doing precisely this:

parameters.XXX +=
  (sens_tree.parameters.XXX' * sens_tree.fluxes.someflux) *
  (measured.fluxes.someflux - solution.fluxes.someflux)

if you get the measured stuff in a tree, you can do this via C.zip.

(EDIT: as a bonus you can descend also on "indirect" variables for free, such as the total enzyme capacity etc)

@exaexa
Copy link
Collaborator Author

exaexa commented Oct 28, 2024

Design: The sensitivity tree would be better as dense, but pruned to just contain the interesting stuff (measured values etc).

@exaexa
Copy link
Collaborator Author

exaexa commented Oct 29, 2024

This now works nicely:

julia> sensitivity_tree.fluxes.TALA' * sensitivity_tree.parameters.PGM
0.007331400905132218

julia> sensitivity_tree.isozyme_forward_amounts.PGL.isozyme_1' * sensitivity_tree.parameters.GND
0.008737521507653744

we might actually want to soak the sensitivity tree creation into the package?

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