How to do inference using grid sampler and how does it exactly work?
See original GitHub issueHi All,
I want to perform inference on a multi modal data using the grid sampler. However, I am not able to wrap my head around the working of the grid sampler in this link: https://torchio.readthedocs.io/data/patch_inference.html?highlight=gridsample
Here, it says that:
grid_sampler = torchio.inference.GridSampler(
sample,
patch_size,
patch_overlap,
)
Here the sample
is one individual object of the Subject
class? I was just wondering if this would become a little clumsy while performing inference on a list of subjects
?Or do I just create a list of grid_samplers
and iterate through them?
It would be great if you could point me to an example which does inference for an entire list of images.
Thanks you!
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Grid Sampler and Aggregator do not take the Protected ...
I'm currently setting my dataset up for inference and stumbled across the Grid Sampler and Aggregator (as stated by the Tutorials on Colab)....
Read more >Inference - TorchIO - Read the Docs
Grid samplers are useful to perform inference using all patches from a volume. It is often used with a GridAggregator . Parameters: subject...
Read more >Computing probability distributions on a grid
And in more than 1 or 2 or 3 dimensions, using the entire grid is almost never practical, so sampling works as a...
Read more >Module 7: Introduction to Gibbs Sampling
Suppose p(x,y) is a p.d.f. or p.m.f. that is difficult to sample from directly. ... We will use Gibbs sampling to perform inference...
Read more >Chapter 4 Approximate inference | Bayesian Inference 2019
Simulation: generate a random sample from the posterior distribution, and use its empirical distribution function as an approximation of the posterior.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @fepegar, Thanks a lot for your explanation. I understood it.
What I would do is something like:
Why would you need a data loader for the subjects? Would you like to load them in parallel? In that case, you can use a
DataLoader
withcollate_fn=lambda x: x
and the subjects data loader will return a list of instances ofSubject
that you can iterate through, using another data loader to run the inference on multiple patches at the same time.