Understanding Deep Architectures with Reasoning Layer