Does tutorial 2 use the Theseus derivatives through the NLLS? (Or just through the objective?)
See original GitHub issueThis tutorial parameterizes a quadratic ax^2+b
with a
optimized by PyTorch autograd and b
optimized with the Theseus NLLS for a given a
. The key piece that enables a
to be learned is that we pass it back into the same cost function the NLLS optimizer uses except we take a gradient step of the cost function w.r.t. a
, which doesn’t use the derivative information of how b
was computed through the NLLS optimizer:
Thus if I understand correctly, this tutorial isn’t using the derivatives through the NLLS optimization process. To try to understand this better, I added a torch.no_grad
call around the NLLS optimizer to block the gradients through it and it didn’t change the output and it was still able to fit the quadratics:
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
Theseus: A Library for Differentiable Nonlinear Optimization
We present Theseus, an efficient application-agnostic open source library for differ- entiable nonlinear least squares (DNLS) optimization built on PyTorch, ...
Read more >Tutorial · NLPModels.jl - JuliaHub
The main interface for user defined problems is ADNLPModel, which defines a model easily, using automatic differentiation.
Read more >Non-linear Least Squares - Ceres Solver
In this chapter we will learn how to solve (1) using Ceres Solver. ... able to evaluate the value and the derivatives of...
Read more >Theseus Pharmaceuticals, Inc. Common Stock (THRX) Real ...
Theseus Pharmaceuticals, Inc. Common Stock (THRX) Real-time Stock Quotes - Nasdaq offers real-time quotes & market activity data for US and global markets....
Read more >Time Domain Astronomy with the THESEUS Satellite
INAF, Astrophysics and Space Science Observatory, via P. ... in the following sec- tions we will use as a reference exposure times of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for flagging @bamos and everyone for the discussion. Let’s follow @vshobha’s proposal, we’ll merge the edits to T2 that clarify the language, and add new tutorials to demonstrate the ideas above before closing this issue. Later we can see if it makes sense to consolidate any if they flow well together.
The goal of Tutorial 2 is to show the user how you can differentiate through the TheseusLayer abstraction. Since this example does not differentiate through the optimization itself, I’d suggest we just change the intro/title to simplify. As it is, it makes the point that we can create a TheseusLayer and differentiate through it. What actually gets ends up getting differentiated is under the hood from the user’s perspective – in this case, it turns out that differentiation through the optimization is not needed.
As for showcasing how to differentiate through the optimization, maybe we could do the following: