CPC G06V 10/776 (2022.01) [G06V 10/7747 (2022.01); G06V 10/82 (2022.01); G06V 40/161 (2022.01)] | 13 Claims |
1. A method for detecting a face, comprising:
receiving image data; and
identifying a region in the image data where face data is located by inputting the image data into a preset neural network for processing, wherein the preset neural network is trained by a method for training a neural network and the method for training a neural network comprises:
determining a neural network;
training the neural network at a first learning rate according to a first optimization mode, wherein the first learning rate is updated each time the neural network is trained; |
mapping the first learning rate of the first optimization mode to a second learning rate of a second optimization mode in the same vector space;
determining the second learning rate satisfies a preset update condition; and
continuing to train the neural network at the second learning rate according to the second optimization mode; and
wherein the mapping the first learning rate of the first optimization mode to the second learning rate of the second optimization mode in the same vector space comprises:
determining an update range, wherein the update range represents a range for updating a first network parameter in a case that the neural network is trained at the first learning rate according to the first optimization mode, and the first network parameter represents a parameter of the neural network in a case that the neural network is trained at the first learning rate according to the first optimization mode;
determining a parameter gradient of a second network parameter, wherein the second network parameter represents a parameter of the neural network in a case that the neural network is trained at the second learning rate according to the second optimization mode; and
determining a projection of the update range on the parameter gradient in the same vector space as the second learning rate of the second optimization mode.
|