Method and apparatus with neural network model compression
Патент · US A1
Полный текст
A method of compressing an artificial neural network model includes: obtaining a first output of a to-be-compressed model by inputting training data to the to-be-compressed model and obtaining a second output of a teacher model by inputting the training data to the teacher model; obtaining a student model by pruning the to-be-compressed model using a gating network pruning network based on the first output of the to-be-compressed model; obtaining an output of the student model by inputting the training data to the student model; calculating a distillation loss based on the output of the student model and the second output of the teacher model; training the to-be-compressed model and the gating network pruning network based on the distillation loss; and obtaining a compressed model by pruning the trained to-be-compressed model with the trained gating network pruning network.