A Unified Model for Multi-class Anomaly Detection