Coder Social home page Coder Social logo

Comments (7)

jmontalt avatar jmontalt commented on July 19, 2024

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 the Options 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.

chaithyagr avatar chaithyagr commented on July 19, 2024

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.

jmontalt avatar jmontalt commented on July 19, 2024

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.

chaithyagr avatar chaithyagr commented on July 19, 2024

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.

jmontalt avatar jmontalt commented on July 19, 2024

This has been addressed in #30 and the requested feature will be available in the next release.

from tensorflow-nufft.

chaithyagr avatar chaithyagr commented on July 19, 2024

Wonderful, thank you for your efforts @jmontalt !

from tensorflow-nufft.

jmontalt avatar jmontalt commented on July 19, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.