Derivatives and inverse of a deep-network vision model