funkelab / gunpowder

A library to facilitate machine learning on multi-dimensional images.
https://funkelab.github.io/gunpowder/
MIT License
79 stars 56 forks source link

Fix bug: Duplicating counts in ProfilingStats #66

Closed pattonw closed 5 years ago

pattonw commented 5 years ago

batch_filter doubles all TimingSummary counts in its batch. This occurs because the batch.crop simply copies profiling_stats. Merging batch and node_batch ends up merging the profiling_stats with itself.

My quick hacky solution: Simply add a flag for if we want to merge profiling stats.

A potentially better solution: Require process to create and return a batch. This way the node_batch would not contain any upstream profiling_stats, and would only add its own timings to the batch. This would require modifying every subclass of BatchFilter but would be more fitting with the design of node_dependencies.