Imported from https://github.com/paulwarkentin/pytorch-neural-doodle