Layers is a library for Neural Networks in TensorFlow. It provides implementations for a variety of neural network layers and other helper functions. It is designed with an emphasis on being well documented, cleanly written, and as generalizable as possible to new network architectures. To this end, many tricks and techniques are used to ensure the best-practice methods of defining these layers are used by default, and that the layers can be used with non-standard numbers of spatial dimensions, enabling them to be used for 1D, 2D, 3D and more.
Install Python. Both Python2 and Python3 are supported, although Python3 should be more efficient.
Install setuptools:
pip install setuptools
Install the latest version of TensorFlow. Follow the instructions at their website. You will likely also want to use cuDNN and CUDA if you are using GPU acceleration.
Then, simply clone this repo and run python setup.py install
- Fully Connected Layer
- Generalizes to N>=0 spatial dimensions
- Uses Xavier initialization by default
- Uses batch normalization by default
- Batch Normalization Layer
- Generalizes to N>=0 spatial dimensions
- Dropout Layer
- Generalizes to N>=0 spatial dimensions
- Convolutional Layer
- Generalized to 1<=N<=3 spatial dimensions (due to limitations in
tf.convolution
) - Initializes using Xavier initialization by default
- Uses batch normalization by default
- Generalized to 1<=N<=3 spatial dimensions (due to limitations in
- Pooling Layer
- Generalizes to N>=1 spatial dimensions
- Can compute a mask for the selected indices when max pooling
- Unpooling Layer
- Performs the unpooling technique described in the SegNet Paper
- Provides a novel generalization to N>=1 spatial dimensions
- Xavier initializer
- Provides a tensor to be used as the intializer for the network weights as described in this paper.
- K-Competitive Layer
- Implements the k-competitive layer for fully connected networks described in the KATE paper.
- Provides a novel generalization for it for N>=0 spatial dimensions.
Please feel free to use this library in your own non-commercial work! Just be sure to cite me in the paper and code. If you found it especially useful and want it for commercial work, ask me first. Or even hire me! ( ͡ᵔ ͜ʖ ͡ᵔ )