Imported from https://github.com/cgtuebingen/ggnn