ZNN is a multi-core CPU implementation of deep learning for 2D and 3D convolutional networks (ConvNets). While the core is written in C++, it is most often controlled via the Python interface.
When to Use ZNN¶
- Wide and deep networks
- For bigger output patches ZNN is the only (reasonable) open source solution
- Very deep networks with large filters
- FFTs of the feature maps and gradients can fit in RAM, but not on the GPU
- Runs out of the box on machines with large numbers of cores (e.g. 144+ circa 2016)
ZNN shines when filter sizes are large so that FFTs are used.
CPU vs GPU?¶
Most of current deep learning implementations use GPUs, but that approach has some limitations:
- SIMD (Single Instruction Multiple Data)
- GPUs have only a single instruction decoder - all cores do same work. You may have heard that CPUs can also use a variation of SIMD, but they can specify it per core.
- Branching instructions (if statements) force current GPUs to execute both branches, causing potentially serious decreases in performance.
- Parallelization done per convolution
- Direct convolution is computationally expensive
- FFT can’t efficiently utilize all cores
- Memory limitations
- GPUs can’t cache FFT transforms for reuse
- Limitations on the dense output size (few alternatives for this feature)
What do I need to use ZNN?¶
Once you’ve gotten a binary of ZNN either by compiling or using one of our Amazon Web Service AMIs (machine images), here’s what you’ll need to get started:
- Sample Definition File (.spec example)
- Provides binding between datasets and ground truths.
Job Configuration File (.cfg example)
Some prior familiarity with convnets. ;)
Keep following this tutorial and you’ll learn how to put it all together.
- Zlateski, A., Lee, K. & Seung, H. S. (2015) ZNN - A Fast and Scalable Algorithm for Training 3D Convolutional Networks on Multi-Core and Many-Core Shared Memory Machines. (arXiv link)
- Lee, K., Zlateski, A., Vishwanathan, A. & Seung, H. S. (2015) Recursive Training of 2D-3D Convolutional Networks for Neuronal Boundary Detection. (arXiv link)