Split leaf and root dynamics optimization notebooks#69
Conversation
|
@michielkallenberg @ronvree @SCiarella @fnattino in this pull request, STE method is used for the sigmoid approximation for the parameter |
SCiarella
left a comment
There was a problem hiding this comment.
Thanks @SarahAlidoost, I really prefer this new approach to the sigmoid because the gradient now is much more controlled.
Later, we could even allow the user to set a lower sharpness to have a better gradient for parameter optimization, but right now the value of 1000 that you have chosen looks ok.
I approve this PR for merge 👍
|
I also think this is a really good idea! During the development it's much better to remove the ambiguity of whether some sigmoid approximates the original model well enough. Great suggestion! Although the soft threshold might in some case have a more realistic biophysical interpretation (as also mentioned by Francesco in issue #68), I feel these discussions should be separated from the initial model development. If I understand correctly the sharpness should ideally still be set based on the magnitude of the input if we want to guarantee there are no issues during optimization? Would it make sense to implement the thresholds as nn.Module instances so it's easier to inspect their behavior and see the impact of any potential adjustments? Thanks @SarahAlidoost! I also approve the PR for merge |
yes, smaller sharpness means larger gradients (
If I understood your comment correctly, you mean to wrap the threshold in a
Thanks for reviewing it 👍 |
fnattino
left a comment
There was a problem hiding this comment.
Thanks @SarahAlidoost! I have commented to this as part of #68. Looks good to me, my main concern was the large value of the sharpness parameter, but as also mentioned in the issue, we can probably get back to what is a reasonable default value for it later on!
|
@michielkallenberg when you have time, can you please have a look at this PR and discussion in #68? Thanks! |
|
Thanks @SarahAlidoost. I did not know this STE trick. Nice. |
No, that was not the issue here. LAI should have gradient wrt SPAN. The reason was a sharp sigmoid that acts like a step function in the previous changes. This is now fixed with STE method.
Thanks for reviewing. |
|
Thanks for your response! What I meant was that this soft threshold pattern will reoccur a lot in diffWofost and understanding its behavior will matter a lot for understanding the model. I agree a nn.Module is in a way just a wrapper and doesn't provide any functional behavior but it makes things more modular and makes refactoring easier. For me it would make sense to implement it that way but of course it's just a suggestion |
thanks for the clarification. I submitted issue #72 for this. |



closes #66
closes #68
🔴 After merging #61, I will update the docs.