Comments (6)
Hi @xichaoqiang! Thanks for using this library.
For non linear problems, you need to define the forward modeling and the (linear) Jacobian operator.
In particular, you can derive its forward and adjoint functions directly from the nonlinear forward problem.
Check out the VarPro tutorial, and let us know!
from occamypy.
Thanks for your reply.
from occamypy.
I may only have the forward Jacobian matrix obtained by numerical difference. Does the adjoint Jacobian matrix need to be defined?
from occamypy.
I fear yes, as in adjoint-state methods you need the adjoint jacobian for computing the gradient g = F'r = F'(f(m) - d)
.
If you know the formula of your nonlinear modeling f(m)
, you can derive the analytic Jacobian and implement both forward and adjoint.
from occamypy.
Thanks. I want to slove a simple 1-D surface wave dispersion inversion with LeastSquares algorithms.
Usually I use L-M algorithm by defing the forward and jacobian functions.
I want use occamypy to the inversion problem, because I want to constrain the inversion problem with lower/upper bounds and the reference model.
How can I do by just defing the forward and jacobian functions?
from occamypy.
Hi @xichaoqiang,
Thanks for using the library. Try to have a look at the tutorial on the Rosenbrock benchmark (Rosebrock). Specifically, look at the second code block in which the Rosenbrock problem is defined. If you have to implement your own problem, you can simply inherit from occamypy.Problem and implement the constructor (init), objf, resf, and gradf. The last three corresponds to your objective function, and residual and gradient vector computations, respectively.
On the other hand, if you want to solve an L2-norm non-linear problem, define an occamypy.NonlinearOperator by using your forward and Jacobian operators. You have to wrap your functions within an occamypy.Operator. As @fpicetti mentioned, look at the second block of the VarPro tutorial. In the following code blocks, you can see how they are used to solve a non-linear L2 problem. FYI, you are not required to define the forward part of the Jacobian operator but only the adjoint. For the bounds, you can simply pass two model vectors to occamypy.NonlinearLeastSquares as minBound and maxBound, which define the lower and upper bounds, respectively.
I hope this helps you understand how to use the library a little bit more. Let us know if you have other difficulties with it.
Cheers!
from occamypy.
Related Issues (14)
- make `estimate_epsilon` a function that takes a problem as input
- Key Error HOT 1
- Is the 2D Travel-time tomography tutorial suit for cross-hole tomography? HOT 2
- Add Hstack and Dstack for nonlinear operators
- Re-write all the docstrings according to Google HOT 1
- Some question about Automatic Differentiation HOT 2
- Implement HDF5 load and save methods for vectors
- A quetsion about adjoint state of eikonal equation. HOT 3
- Add torch.nn.Module operator wrapper HOT 1
- Add an interface to PyLops HOT 1
- Add ADMM algorithm
- Add a MATLAB operator HOT 1
- add unit-tests
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from occamypy.