Comments (6)
Laurent and Brett, I've spent some time yesterday refreshing my memory on some discrete Fourier Transform calculations, and I've got a few results to show. This method allows you to reconstruct only that part of the fourier plane you're interested in. It also has benefits for reducing the effect of aliasing - which we really haven't talked about. The current bandaid we use is apodization, but this results in reduced resolution. I'll provide an example of this for Monday's meeting - and we can discuss...
from shampoo.
Here are some more updates on profiling.
pyfftw
is only faster than scipy
given certain caveats, which are related to how the input array is stored in memory. I was using one of the pyfftw
APIs that didn't make these caveats obvious, so the advertised speedups over numpy and scipy weren't happening.
In the plot below, I show the runtime for reconstructing various numbers of holograms using different functions within pyfftw
, and scipy
's FFT for comparison.
The default in shampoo thus far has been FFTW.interface
, which you can see is the slowest of the options I tested, which is why I noted above that we could get speedups by switching immediately to scipy. However, you can go faster by using a different module within FFTW
(builders). This module also has an option that allows you to use multithreading to speed up your reconstructions.
Question for @jkentwallace and @LaurentRDC: is there any reason not to use one of these multithreading options by default? If not, I'll work on migrating shampoo's fft
methods to use the fast multithreaded pyfftw
module.
from shampoo.
Since FFTW is written in C, multithreading should yield a performance boost (unlike Python). I don't see why not :)
In the GUI, I'm reconstructing on a separate core right now, and it would be easy to extend that to many cores. Since each core has more than one thread, it would be a good idea to implement multithreading now.
from shampoo.
from shampoo.
I'm thinking I'll make pyfftw
a mandatory dependency at this point, since we've quantified its performance now, and its the best option. I was concerned at first that the fftw
library installation could be challenging on some platforms, but it seems like no one has had a problem with it yet, so I'm ready to lock in. Any objections?
from shampoo.
Anyone installing Anaconda is equipped with pyFFTW, so there's at least one easy way to get it. Through conda there's no need for a C compiler, so I think making it a dependency is reasonable.
from shampoo.
Related Issues (17)
- Reconstruction of non-square holograms raises error HOT 7
- Error Installing SHAMPOO HOT 3
- Raise warning if pyfftw not installed HOT 1
- Camera features to be controlled in the GUI HOT 3
- Missing feature: magnification HOT 2
- Efficiency: calculate G only on mask
- Double check atan2 usage HOT 5
- Efficiency: switch to using fftshift method HOT 1
- Feature request: adjustable Fourier mask attribute
- Docs wishlist
- HDF5 Storage of ReconstructedWave object HOT 5
- RuntimeWarning: invalid value encountered in sqrt np.sqrt(1.0 - first_term - second_term)) HOT 4
- Is the picture specific? HOT 6
- Error with shampoo.test() HOT 2
- ModuleNotFoundError
- MNT: Stop using ci-helpers in appveyor.yml
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 shampoo.