Batch normalization layer
By introducing a batch normalization layer into the neural network, the problem of input distribution changes during the training process is solved, faster training and higher learning rates are achieved, and the dependence on parameter initialization and other regularization techniques is reduced.
Patent Information
- Application Number
- CN202510129880.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2015-01-28
- Filing Date
- 2016-01-28
- Publication Date
- 2025-05-30
AI Technical Summary
Existing neural networks face the problem of changes in input distribution during training, resulting in a significant impact on the training process of reducing learning rates and parameter initialization, and additional regularization techniques are required.
A batch normalization layer is introduced, and the layer is inserted between neural network layers, and the components output by calculating normalization statistics in the batch are normalized to generate a normalized layer output.
The training process of neural networks is accelerated, the impact of input distribution changes on training is mitigated, allowing for higher learning rates, and reducing dependence on other regularization techniques.
Smart Images

Figure CN120068937A_ABST
Abstract
Description
[0001] Division Explanation
[0002] This application is a divisional application of Chinese Patent Application No. 201680012517.X with an application date of January 28, 2016. Technical Field
[0003] This specification relates to processing an input through a neural network layer to generate an output. Background Art
[0004] A neural network is a machine learning model that uses one or more layers of non-linear units to predict an output for a received input. In addition to the output layer, some neural networks also include one or more hidden layers. The output of each hidden layer is used as the input to the next layer in the network, i.e., the next hidden layer or the output layer. Each layer in the network generates an output from the received input based on the current values of a corresponding set of parameters. Summary of the Invention
[0005] In general, an innovative aspect of the subject matter described in this specification can be embodied as a neural network system implemented by one or more computers. The neural network system includes: a batch normalization layer between a first neural network layer and a second neural network layer, where the first neural network layer generates a first layer output having a plurality of components. The batch normalization layer is configured to, during training of the neural network system based on a batch of training examples: receive the corresponding first layer output of each training example in the batch; calculate a plurality of normalization statistics for the batch based on the first layer output; normalize each component of each first layer output using the normalization statistics to generate a corresponding normalized layer output for each training example in the batch; generate a corresponding batch normalization layer output for each training example from the normalized layer output; and provide the batch normalization layer output as an input to the second neural network layer.
[0006] For a system of one or more computers to be configured to perform a particular operation or action means that the system has software, firmware, hardware, or a combination thereof installed thereon that causes the system to perform the operation or action when operating. For one or more computer programs to be configured to perform a particular operation or action means that the one or more programs include instructions that cause the device to perform the operation or action when executed by a data processing device.
[0007] Specific embodiments of the subject matter described in this specification can be implemented to achieve one or more of the following advantages. Compared to the same neural network that does not include any batch normalization layers, a neural network system that includes one or more batch normalization layers can be trained more quickly. For example, by including one or more batch normalization layers in a neural network system, problems caused by the distribution of the input to a given layer that changes during training can be alleviated. This can allow for the effective use of higher learning rates during training and can reduce the impact of how the parameters are initialized on the training process. Additionally, during training, the batch normalization layer can act as a regularization matrix and can reduce the need for other regularization techniques (e.g., dropout) to be employed during training. Once trained, a neural network system that includes a normalization layer can generate a neural network output that is as accurate as, if not more accurate than, the neural network output generated by the same neural network system.
[0008] Details of one or more embodiments of the subject matter in this specification are set forth in the accompanying drawings and the description below. Other features, aspects, and advantages of the subject matter will become apparent from the description, the drawings, and the claims. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] Figure 1 An example neural network system is shown.
[0010] Figure 2 is a flow diagram of an example process for using a batch normalization layer to process an input during training of a neural network system.
[0011] Figure 3 is a flow diagram of an example process for using batch normalization to process an input after a neural network system has been trained.
[0012] In the various figures, the same reference numbers and markings indicate the same elements. DETAILED DESCRIPTION
[0013] This specification describes a neural network system that includes batch normalization layers, which is implemented as a computer program on one or more computers at one or more locations.
[0014] Figure 1 An example neural network system 100 is shown. The neural network system 100 is an example of a system that is implemented as a computer program on one or more computers at one or more locations, where the systems, components, and techniques described below can be implemented.
[0015] The neural network system 100 includes a plurality of neural network layers, which are arranged in a sequence: arranged in order from the lowest layer to the highest layer in the sequence. The neural network system generates a neural network output from the neural network input by processing the neural network input that passes through each layer in the sequence.
[0016] The neural network system 100 can be configured to receive any kind of digital data input and generate any kind of score or classification output based on that input.
[0017] For example, if the input to the neural network system 100 is an image or features that have been extracted from an image, the output generated by the neural network system 100 for a given image can be a score for each category in an object category set, where each score represents the estimated likelihood that the image contains an object belonging to that category.
[0018] As another example, if the input to the neural network system 100 is an Internet resource (e.g., a web page), a document, or a part of a document, or features extracted from an Internet resource, a document, or a part of a document, the output generated by the neural network system 100 for a given Internet resource, document, or part of a document can be a score for each topic in a topic set, where each score represents the estimated likelihood that the Internet resource, document, or part of a document is related to that topic.
[0019] As another example, if the input to the neural network system 100 is the features of a flash scenario of a specific advertisement, the output generated by the neural network system 100 can be a score representing the estimated likelihood of clicking on that specific advertisement.
[0020] As another example, if the input to the neural network system 100 is the features of a personalized recommendation for a user, e.g., features characterizing the scenario of the recommendation, e.g., features characterizing the actions previously taken by the user, the output generated by the neural network system 100 can be a score for each content item in a content item set, where each score represents the estimated likelihood that the user will positively respond to the recommended content item.
[0021] As another example, if the input to the neural network system 100 is text in one language, the output generated by the neural network system 100 can be a score for each text segment in a set of text segments in another language, where each score represents the estimated likelihood that the text segment in the other language is a suitable translation of the input text into the other language.
[0022] As another example, if the input to neural network system 100 is an oral utterance, a sequence of oral utterances, or features derived from one of the former two, the output generated by neural network system 100 can be a score for each text segment in a set of text segments, where each score represents an estimated likelihood that the text segment is a correct transcription of the utterance or sequence of utterances.
[0023] As another example, neural network system 100 can be part of an autocomplete system or part of a text processing system.
[0024] As another example, neural network system 100 can be part of a reinforcement learning system and can generate an output for selecting an action to be performed by an agent interacting with an environment.
[0025] Specifically, each layer in the neural network is configured to receive an input and generate an output from the input, and the neural network layers jointly process the neural network inputs received by neural network system 100 to generate corresponding neural network outputs for each received neural network input. Some or all of the neural network layers in the sequence generate outputs from the input according to the current values of a set of parameters of the neural network layer. For example, some layers can multiply the received input by a matrix of current parameter values as part of generating an output from the received input.
[0026] Neural network system 100 further includes a batch normalization layer 108, which is between neural network layer A 104 and neural network layer B 112 in the sequence of neural network layers. Batch normalization layer 108 is configured to: during training of neural network system 100, perform a set of operations on the input received from neural network layer A 104, and, after neural network system 100 has been trained, perform another set of operations on the input received from neural network layer A 104.
[0027] Specifically, neural network system 100 can be trained based on multiple batches of training examples to determine the training values of the parameters of the neural network layers. A batch of training examples is a set of multiple training examples. For example, during training, neural network system 100 can process batch of training examples 102 and generate corresponding neural network outputs for each training example in batch 102. Then, the neural network outputs are used to adjust the values of the parameters of the neural network layers in the sequence, for example, by traditional gradient descent and backpropagation neural network training techniques.
[0028] During training of the neural network system 100 based on a given batch of training examples, the batch normalization layer 108 is configured to receive the layer A output 106 generated by the neural network layer A 104 for the training examples in the batch, process the layer A output 106 to generate a corresponding batch normalization layer output 110 for each training example in the batch, and then provide the batch normalization layer output 110 as an input to the neural network layer B 112. The layer A output 106 includes the corresponding outputs generated by the neural network layer A 104 for each training example in the batch. Similarly, the batch normalization layer output 110 includes the corresponding outputs generated by the batch normalization layer 108 for each training example in the batch.
[0029] Typically, the batch normalization layer 108 calculates a set of normalization statistics for the batch based on the layer A output 106, normalizes the layer A output 106 to generate a corresponding normalized output for each training example in the batch, and, optionally, transforms each of the normalized outputs before providing the output as an input to the neural network layer B 112.
[0030] The normalization statistics calculated by the batch normalization layer 108 and the manner in which the batch normalization layer 108 normalizes the layer A output 106 during training depend on the nature of the neural network layer A 104 that generates the layer A output 106.
[0031] In some cases, the neural network layer A 104 is a layer that generates an output that includes multiple components indexed by dimensions. For example, the neural network layer A 104 can be a fully connected neural network layer. However, in some other cases, the neural network layer A 104 is a convolutional layer or other kind of neural network layer that generates an output that includes multiple components indexed by both feature indices and spatial positions. Below will be referred to Figure 2 More specifically described is the generation of the batch normalization layer output during training of the neural network system 100 in each of these two cases.
[0032] Once the neural network system 100 has been trained, the neural network system 100 can receive a new neural network input for processing, and process the neural network input through the neural network layers to generate a new neural network output for the input based on the trained values of the parameters of the components of the neural network system 100. The operations performed by the batch normalization layer 108 during processing of the new neural network input also depend on the nature of the neural network layer A 104. Below will be referred to Figure 3 More specifically described is the processing of the new neural network input after the neural network system 100 has been trained.
[0033] The batch normalization layer 108 can be included at various positions in a sequence of neural network layers, and, in some embodiments, multiple batch normalization layers can be included in the sequence.
[0034] In Figure 1 example, in some embodiments, the neural network layer A 104 generates an output by modifying the input to the layer according to the current values of a set of parameters of the first neural network layer (e.g., by multiplying the input to the layer by a matrix of the current parameter values). In these embodiments, the neural network layer B 112 can receive the output from the batch normalization layer 108 and generate an output by applying a non-linear operation (i.e., a non-linear activation function) to the output of the batch normalization layer. Thus, in these embodiments, the batch normalization layer 108 is inserted within a traditional neural network layer, and the operations of the traditional neural network layer are divided between the neural network layer A 104 and the neural network layer B 112.
[0035] In some other embodiments, the neural network layer A 104 generates an output by modifying the layer input according to the current values of the set of parameters to generate a modified first layer input and then applying a non-linear operation to the modified first layer input before providing the output to the batch normalization layer 108. Thus, in these embodiments, the batch normalization layer 108 is inserted after the traditional neural network layer in the sequence.
[0036] Figure 2 is a flowchart of an example process 200 for generating the output of a batch normalization layer during the training of a neural network based on a batch of training examples. For convenience, the process 200 is described as being executed by a system of one or more computers located in one or more locations. For example, a batch normalization layer included in a neural network system (e.g., the batch normalization layer 108 included in Figure 1 the neural network system 100) can be appropriately programmed to execute the process 200.
[0037] The batch normalization layer receives the lower layer output of the batch of training examples (step 202). The lower layer output includes the respective outputs generated by the layer below the batch normalization layer in the sequence of neural network layers for each training example in the batch.
[0038] The batch normalization layer generates the respective normalized outputs for each training example in the batch (step 204). That is, the batch normalization layer generates the respective normalized outputs from each received lower layer output.
[0039] In some cases, the layer below the batch normalization layer is a layer that generates an output that includes multiple components indexed by dimension.
[0040] In these cases, the batch normalization layer computes the mean and standard deviation of the components of the lower layer output corresponding to each dimension for each dimension. The batch normalization layer then normalizes each component of each lower layer output in the lower layer output using the mean and standard deviation to generate the corresponding normalized output for each training example in the batch. Specifically, for a given component of a given output, the batch normalization layer normalizes the component using the mean and standard deviation computed for the dimension corresponding to the component. For example, in some embodiments, for the component x k,i , the normalized output satisfies:
[0041]
[0042] where μ Β is the mean of the components corresponding to the k-th dimension of the lower layer output in batch β, and σ B is the standard deviation of the components corresponding to the k-th dimension of the lower layer output in batch β. In some embodiments, the standard deviation is a numerically stable standard deviation equal to (σ B 2 + ε) 1 / 2 , where ε is a constant value, and σ B 2 is the variance of the components corresponding to the k-th dimension of the lower layer output in batch β.
[0043] However, in some other cases, the neural network layer below the batch normalization layer is a convolutional layer or other types of neural network layers, and the other types of neural network layers generate an output including multiple components indexed by both a feature index and a spatial location index respectively.
[0044] In some of these cases, the batch normalization layer computes the mean and variance of the components of the lower layer output having the feature index and the spatial location index for each possible combination of the feature index and the spatial location index. The batch normalization layer then computes the average of the means of the feature index and spatial location index combinations including the feature index for each feature index. The batch normalization layer also computes the average of the variances of the feature index and spatial location index combinations including the feature index for each feature index. Thus, after computing the averages, the batch normalization layer has computed the mean statistic for each feature across all spatial locations and the variance statistic for each feature across all spatial locations.
[0045] The batch normalization layer then normalizes each component of each lower layer output in the lower layer outputs using the mean of the means and the mean of the variances to generate the corresponding normalized output for each training example in the batch. Specifically, for a given component of a given output, the batch normalization layer uses the mean of the means and the mean of the variances corresponding to the feature index of the component (e.g., in the same manner as described above when the layer below the batch normalization layer generates outputs indexed by dimension) to normalize the component.
[0046] In other cases among these cases, the batch normalization layer calculates the mean and variance of the components of the lower layer output corresponding to the feature index for each feature index (i.e., the lower layer output having that feature index).
[0047] The batch normalization layer then normalizes each component of each lower layer output in the lower layer outputs using the mean and variance of the feature indices to generate the corresponding normalized output for each training example in the batch. Specifically, for a given component of a given output, the batch normalization layer then uses the mean and variance of the feature index corresponding to the component (e.g., in the same manner as described above when the layer below the batch normalization layer generates outputs indexed by dimension) to normalize the component.
[0048] Optionally, the batch normalization layer transforms each component of each normalized output (step 206).
[0049] In the case where the layer below the batch normalization layer is a layer that generates an output including a plurality of components indexed by dimension, the batch normalization layer transforms each component of each normalized output in that dimension according to the current value of the parameter set for that dimension. That is, the batch normalization layer maintains a corresponding parameter set for each dimension and uses these parameters to apply the transformation to the components of the normalized output in that dimension. The values of the parameter set are adjusted as part of the training of the neural network system. For example, in some embodiments, the transformed normalized output y generated from k,i satisfies:
[0050]
[0051] where γ k and A k are parameters for the k-th dimension.
[0052] In the case where the layer below the batch normalization layer is a convolutional layer, the batch normalization layer transforms each component of each normalized output in the normalized output according to the current value of the parameter set corresponding to the feature index of that component. That is, the batch normalization layer maintains a corresponding parameter set for each feature index and uses these parameters to apply the transformation to the components of the normalized output having the feature index, for example, in the same manner as described above when the layer below the batch normalization layer generates an output indexed by dimension. The value of the parameter set is adjusted as part of the training of the neural network system.
[0053] The batch normalization layer provides the normalized output or the transformed normalized output as the input to the layer above the batch normalization layer in the sequence (step 208).
[0054] After the neural network has generated the neural network output for the training examples in the batch, the normalization statistics are backpropagated as part of adjusting the values of the parameters of the neural network, that is, as part of performing the backpropagation training technique.
[0055] Figure 3 FIG. 300 is a flow chart of an example process 300 for generating a batch normalization layer output for a new neural network input after the neural network has been trained. For convenience, process 300 is described as being executed by a system of one or more computers located in one or more locations. For example, the batch normalization layer included in the neural network system (e.g., the batch normalization layer 108 in the neural network system 100 included in Figure 1 can be programmed appropriately to execute process 300.
[0056] The batch normalization layer receives the lower layer output of the new neural network input (step 302). The lower layer output is the output generated by the layer below the batch normalization layer in the neural network layer sequence for the new neural network input.
[0057] The batch normalization layer generates a normalized output of the new neural network input (step 304).
[0058] If the output generated by the layer below the batch normalization layer is indexed by dimension, the batch normalization layer normalizes each component in the lower layer output using the pre-computed mean and standard deviation for each dimension in the dimension to generate the normalized output. In some cases, the mean and standard deviation for a given dimension are calculated from the components in the dimension of all the outputs generated by the layer below the batch normalization layer during the training of the neural network system.
[0059] However, in some other cases, the mean and standard deviation of a given dimension are calculated based on components in the dimensions of the lower layer output generated by the layer below the batch normalization layer after training (e.g., based on the lower layer output generated during a most recent time window of a specified duration or from a specified number of lower layer outputs most recently generated by the layer below the batch normalization layer).
[0060] Specifically, in some cases, the distribution of the network input can change between the training examples used during training and the new neural network inputs used after the neural network system has been trained. Thus, the distribution of the lower layer outputs can change between them. For example, if the new neural network inputs are a different kind of input than the training examples. For instance, a neural network system has been trained based on user images and can now be used to process video frames. The user images and video frames may have different distributions in terms of the classes pictured, image attributes, composition, etc. Thus, using the statistics from training to normalize the lower layer inputs may not accurately capture the statistics of the lower layer outputs generated for the new inputs. Therefore, in these cases, the batch normalization layer can use the normalization statistics calculated from the lower layer outputs generated by the layer below the batch normalization layer after training.
[0061] If the output generated by the layer below the batch normalization layer is indexed by a feature index and a spatial location index, the batch normalization layer normalizes each component of the lower layer output using the pre - calculated mean of the means and the mean of the variances for each feature index in the feature index to generate a normalized output. In some cases, as described above, the mean of the means and the mean of the variances for a given feature index are calculated based on the output generated by the layer below the batch normalization layer for all training examples used during training. In some other cases, as described above, the mean and standard deviation for a given feature index are calculated based on the lower layer output generated by the layer below the batch normalization layer after training.
[0062] Optionally, the batch normalization layer transforms each component of the normalized output (step 306).
[0063] If the output generated by the layer below the batch normalization layer is indexed by dimension, the batch normalization layer transforms the components of the normalized output in each dimension according to the training values of the parameter set for that dimension. If the output generated by the layer below the batch normalization layer is indexed by feature index and spatial location index, the batch normalization layer transforms each component of the normalized output according to the training values of the parameter set corresponding to the feature index of the component. The batch normalization layer provides the normalized output or the transformed normalized output as the input to the layer above the batch normalization layer in the sequence (step 308).
[0064] Embodiments of the subject matter and the functional operations described in this specification can be implemented in digital electronic circuitry, in tangibly embodied computer software or firmware, in computer hardware including the structures disclosed in this specification and their structural equivalents, or in combinations of one or more of them. Embodiments of the subject matter described in this specification can be implemented as one or more computer programs, i.e., one or more modules of computer program instructions encoded on a tangible non-transitory program carrier for execution by, or to control the operation of, a data processing apparatus. Alternatively or additionally, the program instructions can be encoded on an artificially generated propagated signal (e.g., a machine-generated electrical, optical, or electromagnetic signal) that is generated to encode information for transmission to a suitable receiver apparatus for execution by the data processing apparatus. A computer storage medium may be a machine-readable storage device, a machine-readable storage substrate, a random or serial access memory device, or a combination of one or more of them.
[0065] The term “data processing apparatus” encompasses all kinds of apparatus, devices, and machines for processing data, including, for example, a programmable processor, a computer, or multiple processors or computers. The apparatus may include dedicated logic circuitry, such as an FPGA (field programmable gate array) or an ASIC (application specific integrated circuit). In addition to hardware, the apparatus may also include code that creates an execution environment for the computer programs under discussion, such as code that constitutes processor firmware, a protocol stack, a database management system, an operating system, or a combination of one or more of them.
[0066] A computer program (which may also be referred to or described as a program, software, software application, module, software module, script, or code) can be written in any form of programming language (including compiled or interpreted languages, declarative or procedural languages), and the computer program can be deployed in any form (including as a stand-alone program or as a module, component, subroutine, or other unit suitable for a computing environment). A computer program may or may not correspond to a file in a file system. The program can be stored in a part of a file that holds other programs or data (e.g., one or more scripts in a markup language document), stored in a single file dedicated to the program in question or in multiple cooperating files (e.g., files that hold one or more modules, subroutines, or portions of code). The computer program can be deployed to execute on one computer or multiple computers located at one site or distributed across multiple sites and interconnected by a communication network.
[0067] The processes and logical flows described in this specification can be performed by one or more programmable computers that execute one or more computer programs to perform functions by operating on input data and generating output. The processes and logical flows can also be performed by dedicated logic circuitry, such as an FPGA (Field Programmable Gate Array) or ASIC (Application Specific Integrated Circuit), and the apparatus can also be implemented as dedicated logic circuitry.
[0068] A computer suitable for executing a computer program can be, for example, based on a general or special purpose microprocessor or both, or any other kind of central processing unit. Generally speaking, the central processing unit will receive instructions and data from a read-only memory or a random access memory or both. The basic elements of a computer are a central processing unit for performing or executing instructions and one or more memory devices for storing instructions and data. Generally speaking, a computer also includes one or more mass storage devices (e.g., magnetic disks, magneto-optical disks, or optical disks) for storing data, or can be operatively coupled to receive data from the mass storage device or transfer data to the mass storage device or do both. However, a computer does not need to have such devices. In addition, a computer can be embedded in another device, such as, for example, a mobile phone, a personal digital assistant (PDA), a mobile audio or video player, a game console, a global positioning system (GPS) receiver, or a portable storage device (e.g., a universal serial bus (USB) flash drive), to name just a few. Computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media, and memory devices, including: for example, semiconductor memory devices (e.g., EPROM, EEPROM, and flash memory devices), magnetic disks (e.g., internal hard disks or removable disks), magneto-optical disks, CD-ROM disks, and DVD-ROM disks. The processor and memory can be supplemented by, or incorporated in, special purpose logic circuitry.
[0069] To provide for interaction with a user, embodiments of the subject matter described in this specification can be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user, a keyboard, and a pointing device (such as, a mouse or a trackball), by which the user can provide input to the computer. Other kinds of devices can also be used to provide for interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback, such as, for example, visual feedback, auditory feedback, or tactile feedback; and the input received from the user can be received in any form, including sound, voice, or tactile input. Additionally, a computer can interact with a user by sending documents to and receiving documents from the device used by the user (e.g., by sending a web page to a web browser on a client device of the user in response to a request received from the web browser).
[0070] Embodiments of the subject matter described in this specification can be implemented in a computing system that includes a backend component (e.g., as a data server), or includes a middleware component (e.g., an application server), or includes a frontend component (e.g., a client computer having a graphical user interface or a web browser through which a user can interact with an implementation of the subject matter described in this specification), or the computing system includes any combination of one or more such backend, middleware, or frontend components. The components of the system can be interconnected by any form of digital data communication medium, such as a communication network. Examples of communication networks include local area networks (“LANs”) and wide area networks (“WANs”), such as the Internet.
[0071] A computing system can include clients and servers. Clients and servers are generally remote from each other and typically interact through a communication network. The relationship between a client and a server arises from computer programs that run on respective computers and have a client-server relationship with each other.
[0072] Although this specification contains many specific implementation details, these details should not be construed as limitations on the scope of any invention or of what may be claimed, but rather as descriptions of features specific to particular embodiments of a particular invention. Certain features that are described in this specification in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented separately or in any suitable sub-combination in multiple embodiments. Moreover, although features may be described above as acting in certain combinations and even initially claimed as such, in some cases one or more features from a claimed combination can be excluded from the combination, and the claimed combination can be directed to a sub-combination or a variant of a sub-combination.
[0073] Likewise, although operations are depicted in the drawings in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in a sequential order, or that all illustrated operations be performed to achieve a desired result. In certain circumstances, multitasking and parallel processing may be advantageous. Moreover, the separation of various system modules and components in the above embodiments should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product or packaged into multiple software products.
[0074] Specific embodiments of the subject matter have been described. Other embodiments are within the scope of the following claims. For example, the acts recited in the claims can be performed in a different order and still achieve the desired result. As one example, the processes illustrated in the figures need not be in the particular order or sequential order shown to achieve the desired result. In certain embodiments, multitasking and parallel processing may be beneficial.
Claims
1. A method performed by one or more computers, the method comprising: receiving a network input; and processing the network input using a neural network to generate a network output for the network input, wherein: the neural network includes a first neural network layer and a second neural network layer, processing the network input using the neural network includes processing a first layer input to the first neural network layer according to training values of a parameter set of the first neural network layer to generate a first layer output having a plurality of components, wherein the training values of the parameter set of the first neural network layer are a result of training the neural network using a plurality of training data batches, each training data batch includes a corresponding plurality of training examples, and wherein training the neural network to determine the training values of the parameter set of the first neural network layer includes, for each of the plurality of batches: receiving a corresponding first layer output generated by the first neural network layer for each of the plurality of training examples in the batch; calculating a plurality of normalization statistics for the batch based on the first layer output, including: for each of a plurality of subsets of the plurality of components of the first layer output, determining an average of the components of the first layer output of each of the plurality of training examples in the batch that are located in the corresponding subset, and for each of the plurality of subsets of the plurality of components of the first layer output, determining a standard deviation of the components of the first layer output of each of the plurality of training examples in the batch that are located in the corresponding subset; normalizing each component of the plurality of components of each first layer output using the normalization statistics to generate a corresponding normalized layer output for each training example in the batch, including: for each first layer output and for each of the plurality of subsets, normalizing the components of the first layer output that are located in the corresponding subset using the average of the corresponding subset and the standard deviation of the corresponding subset; generating a corresponding batch-normalized layer output for each of the training examples based on the normalized layer output; and providing the corresponding batch-normalized layer output as an input to the second neural network layer.
2. The method according to claim 1, wherein training the neural network to determine the training values of the parameter set of the first neural network layer further includes, for each of the plurality of batches: generating a corresponding network output for each network input, including processing the corresponding batch-normalized layer output using the second neural network layer; and updating the parameter set of the first neural network layer using the corresponding network output using backpropagation techniques.
3. The method according to claim 2, wherein updating the parameter set of the first neural network layer using the corresponding network output using backpropagation techniques includes: backpropagating through the normalization statistics.
4. The method according to claim 1, Wherein, the multiple components output by the first layer are indexed by dimension, and wherein calculating multiple normalization statistics for the output of the first layer includes: for each dimension among the dimensions, calculating an average value of the components of the output of the first layer in the dimension; and for each dimension among the dimensions, calculating a standard deviation of the components of the output of the first layer in the dimension.
5. The method according to claim 4, wherein, normalizing each component among the multiple components of each first layer output includes: using the calculated average value and the calculated standard deviation for the dimension corresponding to the component to normalize the component.
6. The method according to claim 4, wherein, generating the corresponding batch normalization layer output for each training example in the training examples according to the normalization layer output includes: for each dimension, according to the current value of the parameter set for the dimension, transforming the components of the normalization layer output of the training examples in the dimension.
7. The method according to claim 1, wherein, the first neural network layer is a convolutional layer, wherein the multiple components of the output of the first layer are indexed by feature index and spatial position index, and wherein calculating multiple normalization statistics for the output of the first layer includes, for each feature index among the feature indexes: calculating an average value of the components of the output of the first layer corresponding to the feature index; and calculating a variance of the components of the output of the first layer corresponding to the feature index.
8. The method according to claim 7, wherein, normalizing each component among the multiple components of each layer output includes: using the average value and the variance for the feature index corresponding to the component to normalize the component.
9. The method according to claim 7, wherein, generating the corresponding batch normalization layer output for each training example in the training examples from the normalization layer output includes: transforming the component according to the current value of the parameter set of the feature index corresponding to each component among the multiple components of the normalization layer output.
10. A system, the system includes one or more computers and one or more storage devices storing instructions, the instructions when executed by the one or more computers cause the one or more computers to perform operations, the operations include: receiving a network input; and processing the network input using a neural network to generate a network output for the network input, wherein: the neural network includes a first neural network layer and a second neural network layer, processing the network input using the neural network includes processing a first layer input to the first neural network layer according to a training value of a parameter set of the first neural network layer to generate a first layer output having multiple components, wherein the training value of the parameter set of the first neural network layer is a result of training the neural network using multiple training data batches, each training data batch includes a corresponding multiple training examples, and Wherein, training the neural network to determine the training values of the parameter set of the first neural network layer includes, for each of the plurality of batches: Receiving corresponding first-layer outputs generated by the first neural network layer for each of the plurality of training examples in the batch; Calculating a plurality of normalization statistics for the batch based on the first-layer outputs, including: For each subset of the plurality of subsets of the plurality of components of the first-layer output, determining the mean of the components of the first-layer output of each of the plurality of training examples in the batch that are located in the corresponding subset, and For each subset of the plurality of subsets of the plurality of components of the first-layer output, determining the standard deviation of the components of the first-layer output of each of the plurality of training examples in the batch that are located in the corresponding subset; Normalizing each component of the plurality of components of each first-layer output using the normalization statistics to generate a corresponding normalized-layer output for each training example in the batch, including: For each first-layer output and for each of the plurality of subsets, normalizing the components of the first-layer output that are located in the corresponding subset using the mean of the corresponding subset and the standard deviation of the corresponding subset; Generating a corresponding batch-normalized-layer output for each of the training examples based on the normalized-layer output; and Providing the corresponding batch-normalized-layer output as an input to the second neural network layer.
11. The system according to claim 10, wherein, training the neural network to determine the training values of the parameter set of the first neural network layer further includes, for each of the plurality of batches: Generating a corresponding network output for each network input, including processing the corresponding batch-normalized-layer output using the second neural network layer; and Updating the parameter set of the first neural network layer using the corresponding network output using backpropagation techniques.
12. The system according to claim 11, wherein, updating the parameter set of the first neural network layer using the corresponding network output using backpropagation techniques includes: Backpropagating through the normalization statistics.
13. The system according to claim 10, wherein, the plurality of components of the first-layer output are indexed by dimension, and wherein calculating a plurality of normalization statistics for the first-layer output includes: For each dimension, calculating the mean of the components of the first-layer output in the dimension; and For each dimension, calculating the standard deviation of the components of the first-layer output in the dimension.
14. The system according to claim 13, wherein, normalizing each component of the plurality of components of each first-layer output includes: Normalizing the component using the calculated mean and the calculated standard deviation for the dimension corresponding to the component.
15. The system according to claim 13, wherein, generating the corresponding batch normalization layer output for each training example in the training examples according to the output of the normalization layer includes: for each dimension, transforming the component of the output of the normalization layer of the training examples in the dimension according to the current value of the parameter set for the dimension.
16. The system according to claim 10, wherein, the first neural network layer is a convolutional layer, wherein the multiple components of the output of the first layer are indexed by a feature index and a spatial position index, and wherein calculating multiple normalization statistics for the output of the first layer includes, for each feature index in the feature index: calculating the average value of the components of the output of the first layer corresponding to the feature index; and calculating the variance of the components of the output of the first layer corresponding to the feature index.
17. The system according to claim 16, wherein, normalizing each component among the multiple components of the output of each layer includes: normalizing the component using the average value and the variance for the feature index corresponding to the component.
18. The system according to claim 16, wherein, generating the corresponding batch normalization layer output for each training example in the training examples from the output of the normalization layer includes: transforming the component according to the current value of the parameter set for the feature index corresponding to each component among the multiple components of the output of the normalization layer.
19. One or more non - transitory computer - readable storage media storing instructions which, when executed by one or more computers, cause the one or more computers to perform operations, the operations including: receiving a network input; and processing the network input using a neural network to generate a network output for the network input, wherein: the neural network includes a first neural network layer and a second neural network layer, processing the network input using the neural network includes processing the first - layer input to the first neural network layer according to the training values of the parameter set of the first neural network layer to generate a first - layer output having multiple components, wherein the training values of the parameter set of the first neural network layer are the result of training the neural network using multiple training data batches, each training data batch includes a corresponding plurality of training examples, and wherein training the neural network to determine the training values of the parameter set of the first neural network layer includes, for each of the multiple batches: receiving the corresponding first - layer output generated by the first neural network layer for each training example in the multiple training examples in the batch; calculating multiple normalization statistics for the batch according to the first - layer output, including: for each subset among the multiple subsets of the multiple components of the first - layer output, determining the average value of the components of the first - layer output of each training example in the multiple training examples in the batch that are located in the corresponding subset, and For each subset of the plurality of subsets of the plurality of components output by the first layer, determine the standard deviation of the components of the first layer output of each training example in the batch that are located in the corresponding subset; Normalize each component of the plurality of components of each first layer output using the normalization statistic to generate a corresponding normalized layer output for each training example in the batch, including: For each first layer output and for each subset of the plurality of subsets, normalize the components of the first layer output that are located in the corresponding subset using the mean of the corresponding subset and the standard deviation of the corresponding subset; Generate a corresponding batch-normalized layer output for each training example in the training examples based on the normalized layer output; and Provide the corresponding batch-normalized layer output as an input to the second neural network layer.
20. The one or more non-transitory computer-readable storage media according to claim 19, wherein, training the neural network to determine the training values of the parameter set of the first neural network layer further includes, for each of the plurality of batches: generating a corresponding network output for each network input, including processing the corresponding batch-normalized layer output using the second neural network layer; and updating the parameter set of the first neural network layer using the corresponding network output using backpropagation techniques.