Imported from https://github.com/Enjia/Spatial-Regularization-Network-in-Tensorflow