Comments (7)
Hi @chaithyagr, I think this is a good idea and I'd be happy to support the feature.
I would suggest that such a parameter goes into an Options
structure which would then be passed to nufft
(similar to FINUFFT itself). For example:
import tensorflow_nufft as tfft
opts = tfft.Options(max_batch_size=4)
result = tfft.nufft(source, points, options=opts)
There are a few reasons why I think this approach is a good idea:
- It makes it clear to users that these are advanced options that provide fine-grained control over the performance and memory usage, but otherwise do not have an effect on the result.
- It keeps the
nufft
signature and doc page simple for most users, and those with higher customization needs can delve deeper into theOptions
structure. - It recognises that there are many low-level parameters that we might want to expose in the future (as indeed there are internally already), and it makes sense to keep them together.
A good model might be tf.data.Options
. This is basically a Python structure which is serialized as a protocol buffer before passing to the OptionsDataset
op.
Note that I'm not necessarily suggesting we should add any other internal parameters now, as each of them will involve some work adapting code and testing. But the Options
structure provides a straightforward way to do so in the future.
Let me know what you think and whether you are happy to implement this!
from tensorflow-nufft.
This is a great idea but for now, I seem to have implemented the basic version which directly feeds from nufft
interp
and spread
functions. I do agree that this makes codebase and also the module a bit clunky right now. But i had to do it for my personal project. I can start this PR for now as we work on the Options
Module as you mentioned, what do you think?
from tensorflow-nufft.
Thank you for your contribution. However, I am not in favour of making "temporary" changes to the public API. I'll keep the PR open as it's a good starting point, but I don't think it is ready to be merged yet. I'll keep this in mind and will do my best to help with the implementation when I find some time. In the meantime, I would suggest that you keep this version for your own work while we set up the final solution.
from tensorflow-nufft.
Ya, I was also not very happy with my own solution. But I dont have time yet to work on this. It is a nice-to-have feature though. For now, I have my own version.
from tensorflow-nufft.
This has been addressed in #30 and the requested feature will be available in the next release.
from tensorflow-nufft.
Wonderful, thank you for your efforts @jmontalt !
from tensorflow-nufft.
No problem! It should be easy to add more options in the future. Anything else you would like to add, please do not hesitate to ask (or create a PR directly).
from tensorflow-nufft.
Related Issues (19)
- `tfft.util.estimate_density` is inaccurate HOT 1
- Implement shape inference function HOT 1
- Running NUFFT in parallel causes a seg fault in CPU kernel HOT 2
- how to specify number of modes/frequencies? HOT 3
- NUFFT ignores TensorFlow's intra-op parallelism setting HOT 1
- NUFFT ignores CUDA device/stream specified by TF framework HOT 1
- Accept tensors in the `grid_shape` argument HOT 1
- Implement 1D NUFFT for GPU HOT 1
- Finish code refactoring/linting
- I dont think the gradients wrt to `points` is right? HOT 5
- NaN's randomly pop up in computations HOT 18
- Compiling without cuda? HOT 16
- Random failing to associate CUDA stream issues? HOT 4
- Test Case NUFFT1 and Real Valued Data HOT 2
- Still facing NaN issues! HOT 21
- Scaling for NUFFT operator HOT 1
- Cannot pip install HOT 2
- ImportError: cannot import name 'nufft_options_pb2' HOT 1
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 tensorflow-nufft.