Open cspencerjones opened 11 months ago
I have been playing around here: https://github.com/ggebbie/TMI.jl/blob/d0971825c9f60552400dd83e50aa194748577840/src/TMI.jl#L2219-L2295 (script to run this is here: https://github.com/ggebbie/TMI.jl/blob/invert-model/scripts/invert_model_TS.jl)
If I optimize right now the cost function grows, so I'm definitely doing something wrong. It was working ok until I implemented the Lagrange multipliers, so I probably have an error there. I'm mostly just posting this so that we can look at the code and talk about it at some point - see if I'm going in a good direction or if I need to refocus/rethink.
I'll take a look. I am currently working on issue #123 which has led me to refactor many things. I can help merge your work with the other changes.
Updated list given that we are not learning the cross-face flux, but the water-mass matrix
I ended up getting rid of some of the Lagrange multiplier code but I now think I'm optimizing successfully here: https://github.com/ggebbie/TMI.jl/tree/invert-model.
The next step is to try this on actual model output.
This is my first attempt at writing down the steps required to get to a place where we can invert model output to get the transport matrix. Comments welcome!
Test to see if tracer is conserved more accurately after optimization(Edit: there is actually no reason for this to be true at this point)