Imported from https://github.com/mehdidc/hybrid-keras