Comments (15)
This is a very nice idea. I think it would go into _OperatorMeta.__new__
.
Quite honestly this is also the last chance we have to somehow unify _apply
and _call
, it would be very much preferable imo, and would greatly simplify this.
from odl.
This is a very nice idea. I think it would go into
_OperatorMeta.__new__
.
Rather into _OperatorMeta.__call__
. Some research necessary here.
Quite honestly this is also the last chance we have to somehow unify
_apply
and_call
, it would be very much preferable imo, and would greatly simplify this.
I agree. So I suppose that would be a _call()
method, either without out
argument (old _call()
) or with (an optional) out
argument (old _apply()
) and use inspect
to check what it is.
Actually, we could get rid of the metaclass altogether by that if I remember correctly.
from odl.
We have three cases of operators
- inplace
- out of place
- inplace + out of place
This if we have a _call(x, out)
for example, this does not imply the existence of a inplace operation. Some thought needed.
from odl.
These could be reflected in the arguments to _call()
- one positional argument (
x
) --> in-place - two positional arguments (
x, out
) --> out-of-place - two positional arguments, second optional (
x, out=None
) --> either way, depending onout
kwargs
would be passed through from __call__()
.
from odl.
Nice idea, we would need to be VERY explicit about this then. Would we enforce the naming? If so preferably only on out
.
from odl.
If so, definitely only on out
. I'll try an implementation today so we get this done.
from odl.
And agreed, this would be super-explicit in the docstring, and we should add a section "How to implement and operator" in the online doc.
from odl.
I'll make a new issue for the _call()
change.
from odl.
This is ancient, do we work on it?
from odl.
There's still an ancient branch, but I'm not so sure how to do this reliably. I started some coding and found myself writing a docstring parser. Then I realized that it was no easy fix. Maybe it's better to just always document Operator._call
officially so the documentation is exposed. We could simply add a hint in Operator.__call__
so users look up at the right place in the docs.
from odl.
What happens to a See Also
placed inside Operator.__call__
? Ill do a test.
from odl.
Seems it links to Operator._call
, damnit.
from odl.
That was my first thought, too, but having it point to the overridden _call
automatically is not so easy I guess.
from odl.
Any more thoughts here? I say we close this and instead encourage users to write a short description of the operator, roughly what it does, in the class docstring. Extensive explanations in the _call
docstring are of limited use anyway.
from odl.
I agree.
from odl.
Related Issues (20)
- Issue when using odl and import pytorch HOT 5
- FISTA for tomographic reconstruction HOT 6
- Do ADMM and PDHG algorithms have positivity constraints or padding?
- ImportError: cannot import name 'OperatorAsModule' from 'odl.contrib.torch' HOT 1
- Proximal of LInfty wrong? HOT 7
- pytorch autograd depreciated HOT 4
- FBP not scaled when PYFFTW_AVAILABLE is True HOT 4
- odl.tomo.backends.skimage_randon.skimage_radon_back_projector not compatible with skimage==0.19
- primal_dual_hybrid_gradient solver: why compute derivative ? HOT 1
- Reconstruct Mayo dataset - errors in importing statements
- odl.operator.operator.OpDomainError: unable to cast tensor to an element of the domain uniform_discr
- question about odl_torch.OperatorModule
- Error with compatibility with latest numpy version HOT 1
- RayTransform: ValueError: The 'astra_cuda' `impl` is not found. HOT 6
- The problem about indexing parallel2Dgeometry HOT 1
- BroadcastOperator doesn't work with scipy > 1.8.1 HOT 4
- AttributeError: module 'numpy' has no attribute 'object' HOT 3
- Python version HOT 2
- Dishing artifact and value shift with FanBeamGeometry
- AttributeError: module 'odl' has no attribute 'Operator'
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 odl.