Cognitive Architecture and Perceptual Inference