Neural network with adaptive gradient clipping

JP2024178267A5Active Publication Date: 2025-01-10ジーディーエム·ホールディング·エルエルシー
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2024160443
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2021-02-12
Filing Date
2024-09-17
Publication Date
2025-01-10
Estimated Expiration
2042-02-02

AI Technical Summary

Technical Problem

Traditional gradient clipping methods for training neural networks, particularly in normalizer-free networks, fail to provide stability and efficiency, especially in very deep networks, due to their reliance on batch size, learning rate, and depth, leading to diminished returns and task performance degradation.

Method used

Adaptive gradient clipping technique that adjusts the gradient clipping threshold based on the ratio of gradient norm to parameter norm, ensuring stable parameter updates by reducing the slope value if the ratio exceeds a threshold, allowing effective training without batch normalization layers.

Benefits of technology

Enhances training stability and efficiency, enabling large batch sizes and parallel processing, reduces computational costs, and maintains task performance, even in limited resource scenarios, while supporting powerful data augmentations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

To provide a system and method for training a neural network with an adaptive gradient clipping, and a computer storage medium.SOLUTION: A method comprises determining a gradient associated with a parameter of a neural network (301). The method further comprises determining a ratio of a gradient norm to parameter norm (305) and comparing the ratio to a threshold (310). When the ratio is determined to exceed the threshold (YES in 310), the value of the gradient is reduced such that the ratio is equal to or below the threshold (315) and the value of the parameter is updated on the basis of the reduced gradient value (320). When the ratio is determined not to exceed the threshold (NO in 310), the gradient value is maintained (325) and the value of the parameter is updated on the basis of the maintained gradient value (330).SELECTED DRAWING: Figure 3
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present specification relates to a system and method for training neural networks using adaptive gradient clipping techniques. [Background technology]

[0002] A neural network is a machine learning model that uses one or more layers of nonlinear units to predict an output given a received input. Some neural networks include one or more hidden layers in addition to an output layer. The output of each hidden layer is used as an input for the next layer in the network, i.e., the next hidden layer, or the output layer. Each layer of the network generates an output from the received input depending on the current values ​​of the respective set of parameters.

[0003] Some neural networks are recurrent neural networks. A recurrent neural network is a neural network that receives an input sequence and generates an output sequence from the input sequence. In particular, a recurrent neural network may use some or all of the network's internal state from a previous time step when computing an output at a current time step. An example of a recurrent neural network is a long short-term memory (LSTM) neural network that includes one or more LSTM memory blocks. Each LSTM memory block may include one or more cells, each including an input gate, a forget gate, and an output gate that enable the cell to remember a previous state for that cell, for example, for use in generating a current activation or to be provided to other components of the LSTM neural network. [Prior art documents] [Non-patent literature]

[0004] [Non-Patent Document 1] Brock et al., “Characterizing signal propagation to close the performance gap in unnormalized resnets,” 9th International Conference on Learning Representations, ICLR, 2021. [Non-Patent Document 2] Foret et al., “Sharpness-aware minimization for efficiently improving generalization,” 9th International Conference on Learning Representations, ICLR, 2021, https: / / openreview.net / forum?id=6Tm1mposlrM [Non-Patent Document 3] Cubuk et al., "Randaugment: Practical automated data augmentation with a reduced search space," Proceedings of the IEEE / CVF Conference on Computer Vision and Pattern Recognition Workshops, pp. 702-703, 2020. [Non-Patent Document 4] Vaswani et al., “Attention Is All You Need,” 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA, https: / / papers.nips.cc / paper / 7181-attention-is-all-you-need.pdf [Non-Patent Document 5] Goodfellow et al., “Generative Adversarial Networks,” arXiv preprint arXiv: 1406.2661, 2014, https: / / arxiv.org / pdf / 1406.2661.pdf Summary of the Invention [Problem to be solved by the invention]

[0005] This specification generally describes how a system implemented as a computer program on one or more computers at one or more locations can perform a method for training a neural network (i.e., tuning the parameters of a neural network). [Means for solving the problem]

[0006] In one aspect, a computer-implemented method is provided for training a neural network that includes determining a gradient associated with a parameter of the neural network. A ratio of the gradient norm to the parameter norm is determined and compared to a threshold. In response to determining that the ratio exceeds the threshold, the value of the gradient is reduced such that the ratio is equal to or less than the threshold. The value of the parameter is then updated based on the reduced gradient value.

[0007] The method provides an adaptive gradient clipping technique that ensures stable parameter updates. In some neural networks, for example very deep neural networks with hundreds or thousands of layers, batch normalization has been required for effective training. The method allows such neural networks, referred to herein as "normalizer-free" neural networks, to be effectively trained without the need for batch normalization layers. Batch normalization introduces dependencies between training data items within a batch, which makes it more difficult to implement on parallel or distributed processing systems. Also, batch normalization is a computationally expensive operation.

[0008] Using the adaptive gradient clipping technique described herein, a normalizer-free network can be made to have the same properties as a batch-normalized network to replicate the beneficial effects of batch normalization in a normalizer-free network by ensuring that the ratio of gradient norm to parameter norm remains within an acceptable range during training. This results in more stable parameter updates in the normalizer-free network, which allows training in large batch sizes that reduce overall training time while maintaining task performance. Batch normalization and removing the dependency of training items within a batch also allows training to be more easily implemented on parallel or distributed processing systems. Independence of training data items is also important for sequence modeling tasks.

[0009] Conventional gradient clipping methods only consider the size of the gradient, and not the size of the parameters themselves, and the ratio of the gradient norm to the parameter norm. Using conventional gradient clipping methods in normalizer-free networks does not provide the full benefits provided by using the present adaptive gradient clipping method. In particular, in training using conventional gradient clipping, the clipping threshold depends on the depth, batch size, and learning rate, requiring fine-grained tuning when changing any of these factors. Diminishing returns are also observed for larger networks when using conventional gradient clipping. Using ratios for gradient clipping provides improved stability of parameter updates that replicate the properties and benefits of batch normalization that conventional gradient clipping lacks to do so.

[0010] In some prior art methods, the ratio is used to adapt the learning rate, which also has the effect of scaling the gradient when performing the parameter update step. However, in the present adaptive gradient clipping method, the value of the gradient is reduced only if the ratio is outside the acceptable range. This has a significant impact on the network's ability to generalize and maintain task performance. This is especially true when computational resources are limited and smaller batch sizes must be used.

[0011] The ratio of the gradient norm to the parameter norm may be defined as the gradient norm divided by the parameter norm.

[0012] The method may further include, in response to determining that the ratio is below a threshold, maintaining a value of the slope and updating a value of the parameter based on the maintained value of the slope, i.e., the slope may not be changed when the ratio is below a threshold.

[0013] Reducing the value of the gradient may include multiplying the value of the gradient by a scale factor to reduce the value of the gradient. The scale factor may be based on the ratio, and reducing the value of the gradient may include multiplying the value of the gradient by a scale factor based on the ratio to reduce the value of the gradient. For example, the scale factor may be based on the inverse of the ratio. Alternatively, or in addition, the scale factor may be based on a threshold. For example, the threshold may be a value in the range of 0.01 to 0.16. The scale factor may be based on a combination of the ratio and the threshold. For example, the scale factor may be based on the threshold multiplied by the inverse of the ratio.

[0014] Alternatively, the value of the threshold may be based on the learning rate. For example, the threshold may be directly proportional to the inverse of the learning rate. The value of the threshold may also be based on the batch size. For example, for larger batch sizes, a smaller value for the threshold may be chosen (which results in stronger clipping).

[0015] The gradient norm and the parameter norm may be determined based on parameters associated with one neuron of the neural network, i.e., the one neuron may be only a single neuron, and the gradient norm and the parameter norm may be unity norms.

[0016] The parameters of the neural network may be weights associated with neurons of the neural network, the gradient norm may be determined based on a gradient associated with each weight associated with the neuron, and the parameter norm may be determined based on a weight value of each weight associated with the neuron.

[0017] The gradient and parameter norms may be determined based on the Frobenius norm, i.e., the Frobenius norm of a gradient or parameter matrix associated with a neural network layer may be defined as the square root of the sum of the squares of each individual element of that matrix.

[0018] The gradient norm may be calculated as the Frobenius norm computed over the gradients associated with each weight associated with the neuron, and the parameter norm may be calculated as the Frobenius norm computed over each weight associated with the neuron.

[0019] Reducing the value of the gradient may be based on the following formula:

[0020]

number

[0021] Here, W l is the weight matrix for the lth layer, where i is the index of the neuron in the lth layer (hence W l , which may be a row vector of

[0022]

number

[0023] is a parameter

[0024]

number

[0025] is the gradient corresponding to ||.||, and λ is a scalar threshold. F is the Frobenius norm. Also,

[0026]

number

[0027] teeth,

[0028]

number

[0029] ε may be calculated as ε = 10, which can prevent the parameters initialized to 0 from clipping the gradient to 0. -3 or any other small value, as appropriate.

[0030] The neural network may be a deep residual neural network. The neural network may comprise a residual block, which is without a normalization layer. That is, the residual block may not include a batch normalization or other type of normalization layer. The residual block may include a convolution operation, a pooling operation, and / or a nonlinear operation, but may not include an activation normalization operation such as batch normalization. The nonlinearity may be a Gaussian error linear unit (GELU) or a rectified linear unit (ReLU). The convolution operation may be a grouped convolution. For example, a group width of a 3×3 convolution may be 128.

[0031] The parameters may be parameters associated with a convolutional layer. If the parameters are weights of a convolutional filter, the gradient norm and the parameter norm may be calculated over a fan-in range that includes the channel dimension and the spatial dimension. The adaptive gradient clipping method may be applied to all layers of the network. However, the final output layer may be excluded. Also, the first convolutional layer may be excluded.

[0032] The neural network may be a deep residual neural network with a four-stage backbone. The stages may comprise a sequence of residual blocks with activations of a fixed width and resolution. The backbone may comprise residual blocks in a ratio of 1:2:6:3 starting from the first stage to the fourth stage. That is, the first stage may comprise one residual block, the second stage may comprise two residual blocks, the third stage may comprise six residual blocks, and the fourth stage may comprise three residual blocks. Networks of greater depth may have an increasing number of residual blocks while keeping the specified ratio. For example, the network may have five residual blocks in the first stage, ten residual blocks in the second stage, thirty residual blocks in the third stage, and fifteen residual blocks in the fourth stage. The input layer, the fully connected layer, and the output layer do not typically form part of the backbone.

[0033] The width of each stage may be twice the width of the previous stage. For example, the width may be 256 in the first stage, 512 in the second stage, 1024 in the third stage, and 2048 in the fourth stage. In an alternative configuration, the width of the third and fourth stages may be 1536. For example, the width may be 256 in the first stage, 512 in the second stage, and 1536 in both the third and fourth stages. In another embodiment, the width may be 256 in the first stage, 1024 in the second stage, and 1536 in both the third and fourth stages.

[0034] The residual block may be a bottleneck residual block. The bottleneck residual block may include a first grouped convolution layer in the bottleneck and a second grouped convolution layer. A normal bottleneck consists of only one convolution layer in the bottleneck. It has been found that including a second convolution layer in the bottleneck can significantly improve task performance with little impact on training time. For example, the bottleneck residual block may include a 1×1 convolution layer that reduces the number of channels to form the bottleneck, and the bottleneck includes a first 3×3 grouped convolution layer, a second 3×3 grouped convolution layer, and a 1×1 convolution layer that restores the number of channels.

[0035] The weights of the convolutional layer of the residual block may undergo scaled weight standardization, i.e., the weights may be reparameterized based on the mean and standard deviation of the weights in that layer. Further details related to scaled weight standardization can be found in Brock et al., “Characterizing signal propagation to close the performance gap in unnormalized resnets,” 9th International Conference on Learning Representations, ICLR, 2021, which is incorporated by reference in its entirety.

[0036] The input of the residual block may be downscaled based on the variance of the input. The variance may be determined analytically. The final activations of the residual branch of the residual block may be scaled by a scalar parameter. The value of the scalar parameter may be 0.2. For example, the residual block may be scaled by h i+1 =h i +αf i (h i / β i ), where h i represents the input to the i-th residual block, and f i () represents the function computed by the i-th residual branch. The function is Var(f i The scalar α may be parameterized to be the variance that preserves the initial setting, such that Var(z) = Var(z). The scalar α may be 0.2 as previously described. The scalar β i may be determined by predicting the standard deviation of the input to the i-th residual block,

[0037]

number

[0038] where Var(h i+1 )=Var(hi )+α 2 and for the transition block, the skip path is i / β i ) and the expected variance is h i+1 =1+α 2 Further details may also be found in Brock et al., referenced above.

[0039] The residual block may further comprise a squeeze-and-excite layer. The squeeze-and-excite layer may process the input activations according to the following sequence of functions: global average pooling, fully connected linear function, scaled nonlinear function, second fully connected linear function, sigmoid function, and linear scaling. For example, the output of the layer may be 2σ(FC(GELU(FC(pool(h)))))×h, where σ is the sigmoid function, FC is the fully connected linear function, pool is the global average pooling, and h is the input activations. A scalar multiplier of 2 may be used to maintain signal variance.

[0040] The residual block may further comprise a learnable scalar gain at the end of the residual branch of the residual block. The learnable scalar may be initialized with a value of 0. The learnable scalar may be in addition to the scalar α described above.

[0041] As mentioned above, the adaptive gradient clipping method allows the training data items in a batch to be independent and may therefore be used in sequence modeling tasks where batch normalization cannot be used. Conventional gradient clipping is often used in language modeling, and the adaptive gradient clipping method may provide an advantageous alternative in such applications. Further examples of suitable sequence modeling tasks are given below. The neural network may be a neural network of the transformer type, i.e. a neural network including one or more transformer layers. The transformer layer may typically include an attention neural network layer, in particular a self-attention neural network layer, optionally followed by a feedforward neural network. The transformer type neural network may be used in sequence modeling and is described in more detail below. The neural network may be a neural network of the generative adversarial network (GAN) type. GANs are described in more detail below.

[0042] Updating the parameter values ​​may be based on a batch size of at least 1024 training data items. In previous work involving normalizer-free neural networks, training on ImageNet for large batch sizes such as 1024 was unstable. Using an adaptive gradient clipping method, improved stability is provided, making it possible to train with batch sizes of at least 1024. For example, a batch size of 4096 may be used.

[0043] The neural network may be pre-trained. For example, the neural network may be trained on a different dataset and / or for a different training purpose prior to further training on a particular task of interest and / or with a particular dataset of interest. Thus, the network may be pre-trained and then fine-tuned. The method may receive as input a neural network for training and may provide as output an updated neural network.

[0044] The method may further include receiving a training dataset including the image data. Determining the gradient may be based on a loss function to measure performance of the neural network on the image processing task.

[0045] The calculation of gradients and updating of parameters may be performed based on a stochastic gradient descent optimization algorithm, or any other suitable optimization algorithm. The method may be used in combination with regularization methods such as dropout depth and stochastic depth. The dropout rate may increase with depth. The dropout rate may be in the range of 0.2 to 0.5. The method may also be used in combination with momentum-based update rules such as Nesterov's momentum. The method also allows the use of large learning rates, which speeds up training due to the improved stability of the training method.

[0046] The determination of the gradient may be based on a sharpness-aware minimization technique. In the sharpness-aware minimization technique, the loss function may include a traditional loss based on the training task and an additional loss based on the shape of the minima. This additional loss seeks parameters in a neighborhood with uniformly low loss values. In other words, flatter minima are sought, which are believed to provide better generalization compared to sharply shaped minima. The determination of the gradient may include performing a gradient ascent step to determine modified versions of the parameters, and performing a gradient descent step based on the modified versions of the parameters to determine gradients associated with the parameters. The gradient ascent step may be performed based on a subset of the current batch of training data items. For example, 1 / 5 of the training data items in the current batch may be used. When used in conjunction with the adaptive gradient clipping method described above, it has been found that using a subset of the batch provides equivalent performance to using all of the training data items in the batch for the ascent step. Thus, the same benefits can be realized at a much lower computational expense. When used in a distributed training system, the gradients in the gradient ascent step do not require synchronization between replicas on different processing units. The gradient ascent step and the generated modified parameters can be kept local to the processing unit, and the gradient descent step can be performed on the local modified parameters. The same effect can be achieved via gradient accumulation for distributed systems with fewer processing units, or for single processing unit systems.Further details regarding sharpness-aware minimization can be found in Foret et al., "Sharpness-aware minimization for efficiently improving generalization," 9th International Conference on Learning Representations, ICLR, 2021, available at https: / / openreview.net / forum?id=6Tm1mposlrM, which is incorporated by reference in its entirety.

[0047] The training data set may be augmented using data augmentation techniques such as RandAugment. The enhanced stability provided by the adaptive gradient clipping method allows powerful augmentation to be used without degrading task performance. For image data, RandAugment offers a selection of image transformations including identity, auto-contrast, equalization, rotation, solarization, colorization, posterization, contrast, brightness, sharpness, shear, and translation. Modified versions of the training data items may be generated by randomly selecting one or more transformations. Further details regarding RandAugment can be found in Cubuk et al., “Randaugment: Practical automated data augmentation with a reduced search space,” Proceedings of the IEEE / CVF Conference on Computer Vision and Pattern Recognition Workshops, pp. 702-703, 2020, which is incorporated herein by reference in its entirety. It will be appreciated that other sets of transformations may be used as appropriate, depending on the modality of the training data items.

[0048] Additionally or alternatively, other data augmentation techniques may be used. For example, a modified training data item may be generated by selecting a portion of a first training data item and replacing a corresponding portion in a second training data item with the selected portion from the first training data item to generate the modified training data item. The location and size of the selected portion may be selected randomly. Multiple portions may be selected and used for replacement to generate the modified training data item. In the case of image data, the portion may be an image patch. The modified training data item may be assigned a label based on the proportion of the first training data item and the second training data item present in the modified training data item. For example, if the selected portion of the first training data item constitutes 40% of the modified training data item and the second training data item constitutes the remaining 60%, the label for the modified training data item may be 0.4 for the class associated with the first training data item and 0.6 for the class associated with the second training data item. In a similar data augmentation technique, a selected portion of a first training data item may be blanked, i.e., pixel values ​​may be set to zero values ​​or to values ​​representing black, or replaced with random noise.

[0049] Another exemplary data augmentation technique includes generating a modified training data item by interpolating a first training data item and a second training data item. The interpolation may be a linear interpolation. The modified training data item may be assigned a label based on an interpolation weighting of the first training data item and the second training data item.

[0050] In one implementation, for a batch of training data items, RandAugment may be applied to all of the training data items in the batch, a partial selection / replacement technique may be applied to half of the training data items in the batch, and an interpolation technique may be applied to the remaining half of the training data items to generate the augmented training data items for the batch. As mentioned above, the enhanced stability provided by the adaptive gradient clipping method allows strong augmentation to be used without degrading task performance. Thus, a combination of different data augmentation techniques may be beneficial to improve task performance, which progressively improves with stronger data augmentation. A typical batch normalized neural network does not benefit from using stronger data augmentation, and in some cases, it may hurt performance.

[0051] The method may be performed by a parallel or distributed processing system comprising multiple processing units. The method may further include receiving a training dataset comprising multiple training data items, generating multiple batches of training data items, each batch comprising a subset of training data items of the training dataset, distributing the multiple batches of training data items to the multiple processing units, and training the neural network based on the distributed multiple batches of training data items using the multiple processing units in parallel. The multiple processing units may be part of different physical computing devices and / or may be located in different physical locations.

[0052] The method may be performed by one or more tensor processing units, or one or more graphics processing units, or other types of accelerator hardware. A parallel or distributed processing system may include one or more graphics processing units or tensor processing units.

[0053] According to another aspect, a system is provided that includes one or more computers and one or more storage devices that store instructions that, when executed by the one or more computers, cause the one or more computers to perform operations of the respective methods described above.

[0054] The system may be a parallel processing system or a distributed processing system. The system may include one or more tensor processing units or one or more graphics processing units.

[0055] According to a further aspect, one or more computer storage media are provided that store instructions that, when executed by one or more computers, cause the one or more computers to perform the operations of each of the methods described above.

[0056] The subject matter described herein can be implemented in particular embodiments to realize one or more of the following advantages.

[0057] Batch normalization has been an important technique for enabling the training of very deep neural networks, e.g., neural networks with hundreds or even thousands of layers. Batch normalization improves training stability and allows large batch sizes to be used during training, which can significantly reduce the overall training time. However, batch normalization is a computationally expensive operation, both in terms of computation and memory, which negates some of the benefits of using larger batch sizes. For example, batch normalization has been estimated to account for approximately one-quarter of the training time for the ResNet-50 architecture on ImageNet using Titan X Pascal GPUs.

[0058] Furthermore, batch normalization introduces dependencies between training data items within a batch, which increases the difficulty of performing training on parallel or distributed processing systems and using accelerator hardware, such as tensor processing units and graphics processing units, that may be required to efficiently train very deep neural networks. Also, batch normalization is particularly sensitive to the underlying hardware used to perform the training, and results may be difficult to replicate on other hardware systems.

[0059] Previous work replicating batch normalization has resulted in networks that enable comparable accuracy on benchmark datasets such as ImageNet. However, at large batch sizes, e.g., batch sizes greater than 1024 on ImageNet, task performance begins to degrade in these "normalizer-free" networks.

[0060] As mentioned above, the inventors have observed a large difference in the ratio of gradient norm to parameter norm between batch normalized and normalizer-free networks during training. Therefore, the beneficial effect of batch normalization can be replicated in normalizer-free networks using the adaptive gradient clipping technique described herein to ensure that the ratio of gradient norm to parameter norm remains within an acceptable range during training, resulting in more stable parameter updates. This stability allows training in large batch sizes to improve training efficiency relative to normalizer-free networks while maintaining high task performance. For example, neural networks trained using the adaptive gradient clipping technique that are comparable to the test accuracy of the state-of-the-art EfficientNet-B7 network on ImageNet train up to 8.7× faster.

[0061] Moreover, the computational and memory costs of gradient clipping are much lower than batch normalization. Moreover, since there are no dependencies on training data items within a batch, training can be more easily performed on parallel and distributed processing systems. There is also no need for special consideration of how training data items are allocated to batch or parallel computation of batch statistics. This makes the training method particularly suited to parallel and distributed processing systems, as well as accelerator hardware.

[0062] At the other extreme, the adaptive gradient clipping method is as effective at small batch sizes as it is at large batch sizes, whereas batch normalized optimizers and other normalized optimizers tend to perform worse at these tasks. Thus, the adaptive gradient clipping method is effective even when computational resources are limited.

[0063] The enhanced stability provided by the adaptive gradient clipping method also enables training with powerful data augmentation such as RandAugment, which further improves the network's generalization ability and task performance. [Brief description of the drawings]

[0064] [Figure 1] FIG. 1 illustrates an exemplary neural network training system. [Diagram 2] FIG. 1 is a schematic diagram showing a neural network. [Diagram 3] 1 is a flow chart illustrating a process for training a neural network. [Figure 4] FIG. 1 is a schematic diagram illustrating a residual neural network architecture. [Diagram 5] FIG. 2 is a schematic diagram illustrating a bottleneck residual block; [Figure 6]1 is a graph showing plots of training latency versus image recognition accuracy for an exemplary embodiment and various prior art neural network models. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0065] Like reference numbers and designations in the various drawings indicate like elements.

[0066] FIG. 1 illustrates an exemplary neural network training system 100 for training a neural network. A set of neural network parameters 105 of a neural network and a training dataset 110 may be provided as input to the neural network training system 100. The neural network training system 100 is configured to process the neural network parameters 105 and the training dataset 110 to result in updated neural network parameters 115. That is, the values ​​of the input neural network parameters 105 may be changed in an attempt to improve the performance of the neural network for a particular predefined task. In particular, the neural network training system 100 is configured to use an adaptive gradient clipping technique to update the neural network parameters 105. In the adaptive gradient clipping technique, a gradient associated with the parameters 105 of the neural network is determined. A ratio of the gradient norm to the parameter norm is determined and compared to a threshold. In response to determining that the ratio exceeds the threshold, the value of the gradient is reduced such that the ratio is less than or equal to the threshold, and the value of the parameter is updated based on the reduced gradient value. Further details relating to the adaptive gradient clipping technique are provided below with reference to Figure 3. The neural network training system 100 may be configured to provide updated neural network parameters 115 as an output.

[0067] The neural network training system 100 may alternatively retrieve the input neural network parameters 105 and / or the training data set 110 from a data store 120 or memory 125 local to the system 100. The neural network training system 100 may also be configured to generate an initial set of values ​​for the neural network's parameters. The neural network training system 100 may also be configured to iteratively update the neural network parameters 105 until a predefined stopping criterion is reached, and a final set of updated neural network parameters 140 may be provided as output.

[0068] The training data set 110 may include a number of training data items appropriate for the task, and may optionally include a set of labels corresponding to a target output that the neural network should yield when processing the training data items. For example, the training data set 110 may include image data, video data, audio data, voice data, sensor data, data characterizing the state of the environment, and other types of data that are described in more detail below. The tasks may include image recognition, object detection, image segmentation, speech recognition, machine translation, generating actions for controlling robots / mechanical / electrical agents, and other tasks that are described in more detail below.

[0069] In general, the neural network training system 100 may comprise multiple processing units 130A...N, with each processing unit comprising a local memory 135A...N. Thus, the neural network training system 100 in FIG. 1 may be considered to be a parallel processing system or a distributed processing system. It will be appreciated that the processing units 130A...N may be arranged in a variety of different architectures and configurations as deemed appropriate by those skilled in the art. For example, the neural network training system 100 may be implemented using a graphics processing unit (GPU) or a tensor processing unit (TPU), or other type of neural network accelerator hardware. It will be appreciated that the processing units 130A...N may be distributed across multiple separate hardware devices in different physical locations communicating via a suitable computer network, and need not be located on a single hardware device.

[0070] The neural network training system 100 may be configured to generate multiple batches of training data items, each batch including a subset of the training data items of the training data set 110. Alternatively, the received training data set 110 may be pre-split into batches. The neural network training system 100 may be configured to distribute the multiple batches of training data items to the multiple processing units 130A...N. The neural network system 100 may be configured to train the neural network using the parallel processing capabilities of the multiple processing units 130A...N based on the multiple batches of training data items distributed to each processing unit 130A...N. The use of the term "batch" in this context is intended to cover any grouping of training data items for distribution to the processing units 130A...N. For example, when using stochastic gradient descent to train a neural network, gradients may be calculated based on "mini-batches" of training data items. This "mini-batch" of training data items may be further subdivided for distribution to multiple of the processing units 130A...N. For example, each processing unit 130A...N may be configured to process 32 training data items each. The term "batch" is intended to include such further subdivision in the context of distributing training data items to the processing units 130A...N. When "batch size" is mentioned in this disclosure, this may be the number of training data items used to determine gradients and update values. Thus, this can refer to the size of the "mini-batch" in the stochastic gradient descent prior to the subdivision of the mini-batch and distribution to the processing units 130A...N.

[0071] Each of the multiple processing units 130A...N may be configured to calculate corresponding network outputs for training data items allocated to that processing unit in parallel according to the current values ​​of the neural network parameters 105. As will be explained in more detail below, the adaptive gradient clipping technique does not have any dependencies between training data items when calculating the network output, and thus, calculating the network output may be performed in parallel and independently by each processing unit 130A...N. This is in contrast to neural networks that include batch normalization layers, which may require communication between the processing units 130A...N to perform batch normalization operations or alternatively introduce data shuffling operations, which introduce dependencies between training data items and thus incur additional overhead. The adaptive gradient clipping technique allows neural networks without batch normalization layers to achieve comparable, or in some cases even better, task performance while also being easier to implement and more efficient to perform on parallel and distributed systems compared to neural networks that include batch normalization layers.

[0072] Each processing unit 130A...N may be configured to calculate an error value, or other learning signal, based on the determined network output and the particular loss function being used to train the neural network. The error value may be back-propagated through the network to calculate gradient values ​​on the particular batches allocated to the processing units 130A...N in parallel. The calculated gradient values ​​determined by each of the processing units 130A...N may be combined to determine a ratio of the gradient norm to the parameter norm and an update to the value of the parameter by the adaptive gradient clipping technique. The update to the parameter value may be sent to each of the processing units 130A...N to apply the update to a local copy of the parameter, or the updated value itself may be sent to each of the processing units 130A...N if further training is required. It will be appreciated that other parallel implementations may be suitable for implementing the adaptive gradient clipping technique. For example, an asynchronous parallel implementation may be used in which the local copies of the parameters of the neural network used by the processing units 130A...N are allowed to be different. Determining the ratio of the gradient norm to the parameter norm, comparing the ratio to a threshold, and updating the parameter values ​​may be performed in parallel and independently based on batches of training data items distributed to the processing units. Updating the parameter values ​​and distributing the updated parameter values ​​to the processing units 130A...N may be performed, for example, by a suitable asynchronous stochastic gradient descent method.

[0073] Although FIG. 1 illustrates a parallel / distributed processing system, it should be appreciated that the neural network training system 100 need not be implemented as a parallel or distributed system, but may be implemented using a single processing unit.

[0074] 2 illustrates an example neural network 200 with multiple hidden layers 205A...N. The neural network 200 processes an input 210 through the multiple hidden layers 205A...N to produce an output 215. Typically, the neural network 200 is trained to perform a particular task. For example, the neural network 200 may be trained to perform an image recognition task. The input 210 may be an image including pixel values ​​(or other image data), and the output 215 may be a set of scores representing the likelihood that a particular object is present in the image.

[0075] The neural network 200 may be trained using conventional techniques such as stochastic gradient descent or other gradient-based methods, but modified to use an adaptive gradient clipping technique as described below. In general, for gradient-based training methods, one or more training data items are provided as inputs to the neural network 200 to generate corresponding outputs. A loss function, such as cross-entropy loss, may be constructed that compares the generated outputs with corresponding target outputs. An error value or other learning signal calculated from that loss function may be "backpropagated" through the network, starting from the outputs, through the multiple hidden layers 205A...N in reverse order, and back to the inputs. In this manner, the gradient of the loss function with respect to each parameter of the neural network may be calculated and used to update the parameter values.

[0076] In adaptive gradient clipping techniques, the gradient associated with the neural network parameters is calculated as normal. However, the gradient may be modified prior to using the gradient to update the parameters. In particular, as shown in the process of FIG. 3, after the gradient associated with the neural network parameters is determined in step 301, the ratio of the gradient norm to the parameter norm is determined in step 305. The ratio may be defined as the gradient norm divided by the parameter norm. In step 310, the determined ratio is compared to a threshold. In step 315, in response to determining that the ratio exceeds the threshold, the value of the gradient is reduced so that the ratio is equal to or less than the threshold, thereby "clipping" the gradient. In step 320, the value of the parameter is updated based on the reduced gradient value. If the ratio does not exceed the threshold in step 325, the value of the gradient may be maintained, and the value of the parameter may be updated in step 330 based on the maintained gradient value. In either case, the updating of parameter values ​​may be performed according to the particular parameter update rules of the particular gradient-based training method used.

[0077] The adaptive gradient clipping technique ensures stable parameter updates in that the parameter updates are limited to a certain size taking into account the scale of the parameters. In some neural networks, for example very deep neural networks with tens, hundreds, or even thousands of layers, batch normalization has been required for effective training. The present adaptive gradient clipping technique allows such neural networks to be effectively trained without the need for a batch normalization layer. A neural network without a batch normalization layer is referred to herein as a "normalizer-free" neural network.

[0078] A batch normalization layer takes as input the output of a hidden layer in a neural network and recenters and rescales the input. Initially, the input is modified so that the data has a mean of approximately 0 and a variance of approximately 1. If the initial normalization proves to be suboptimal, further scaling and shifting based on learnable parameters may be applied.

[0079] The mean and variance for batch normalization are calculated on the basis of the batch of training data items used for a particular parameter update step. Thus, batch normalization introduces dependencies between training data items within a batch, which makes implementation on a parallel or distributed processing system more difficult, since communication between processing units may be required to calculate the mean and variance of a batch of data if the batch of data is divided among the processing units when calculating the output of the neural network. Without batch normalization, the processing units can independently calculate the network output for each input data item, and communication between the processing units is not required. Thus, replacing batch normalization with an adaptive gradient clipping technique removes the dependency of training data items within a batch and restores the ability of the processing units to independently calculate the network output. This allows training to be more easily implemented on a parallel or distributed processing system, and the amount of communication required between processing units in a parallel or distributed system is reduced, thereby improving the efficiency of the parallel implementation. In some prior art implementations, as an alternative to communicating batch normalization statistics between processing units, the training data items in a batch can be shuffled each time batch normalization is performed, so that the likelihood that a processing unit is assigned a different subset of the batch in each run is increased. However, this shuffling operation also incurs additional overhead that reduces the efficiency of parallel / distributed implementations. Using an adaptive gradient clipping technique avoids the need for a shuffling operation and reduces overhead in parallel / distributed implementations.

[0080] Normalizer-free neural networks trained using adaptive gradient clipping techniques yield comparable, or in some cases, better, task performance than neural networks using batch normalization. The higher stability achieved via adaptive gradient clipping techniques allows training on large batch sizes that reduce overall training time while maintaining task performance. Batch normalization is also a computationally expensive operation, and replacing batch normalization also contributes to reducing the computational requirements of training large neural networks.

[0081] Conventional gradient clipping methods only consider the size of the gradient, and not the size of the parameters themselves, and the ratio of the gradient norm to the parameter norm. Using conventional gradient clipping methods in normalizer-free networks does not provide the full benefits provided by using adaptive gradient clipping techniques. In particular, when training using conventional gradient clipping, the clipping threshold depends on the depth, batch size, and learning rate, requiring fine-grained tuning when varying any of these factors. Diminishing returns are also observed for larger networks when using conventional gradient clipping. Using ratios for gradient clipping provides improved stability of parameter updates that replicate the properties and benefits of batch normalization that conventional gradient clipping lacks to do so.

[0082] Further details of the adaptive gradient technique are now provided. The gradient value may be reduced by multiplying the gradient value by a scale factor. In one embodiment, the scale factor is based on a threshold. In another embodiment, the scale factor may be based on the ratio, or on the inverse of the ratio. The scale factor may be based on a combination of a threshold and a ratio, for example, the scale factor may be based on a threshold multiplied by the inverse of the ratio.

[0083] The gradient norm and parameter norm may be based on the Frobenius norm. The Frobenius norm of a matrix A is defined as the square root of the sum of the squares of each individual element of that matrix, i.e.

[0084]

number

[0085] The norm may be a unitary norm, i.e., the norm may be calculated based on gradient / parameter values ​​associated with one particular neuron of the neural network in one particular layer. For example, the norm may be calculated based on the parameters associated with the incoming connections to the neuron and the gradients corresponding to those connections. Alternatively, the outgoing connections may be used, if appropriate.

[0086] In one implementation, the value of the gradient may be reduced and updated based on the following formula:

[0087]

number

[0088] Here, W l is the weight matrix for the lth layer, i is the index of the neuron in the lth layer (so, if the norm is computed with respect to unity, W l , which may be a row vector of

[0089]

number

[0090] is a parameter

[0091]

number

[0092] is the gradient corresponding to ||.||, and λ is a scalar threshold. F is the Frobenius norm. Also,

[0093]

number

[0094] teeth,

[0095]

number

[0096] ε may be calculated as ε = 10, which can prevent the parameters initialized to 0 from clipping the gradient to 0. -3 or any other small value, as appropriate.

[0097] In one embodiment, the threshold may be a value in the range of 0.01 to 0.16. It will be appreciated that other thresholds may be selected as appropriate depending on the type of network and the batch size of training data items being processed in one particular parameter update step. The value of the threshold may be based on the batch size. For example, for larger batch sizes, a smaller value for the threshold may be selected (which results in stronger gradient clipping).

[0098] Updating the parameter values ​​may be based on a batch size of at least 1024 training data items. In previous work involving normalizer-free neural networks, training on large batch sizes, such as 1024 on ImageNet, was unstable. As mentioned above, using an adaptive gradient clipping technique provides improved stability and enables training with batch sizes of at least 1024. For example, a batch size of 4096 may be used.

[0099] The adaptive gradient clipping technique is as effective at small batch sizes as it is at large batch sizes. Task performance of batch normalized optimizers and other normalized optimizers tends to be poor at small batch sizes. For this reason, the adaptive gradient clipping method is also effective when computational resources are limited and small batch sizes must be used.

[0100] The adaptive gradient clipping technique may be used in combination with regularization methods such as dropout depth and stochastic depth. The dropout rate may increase with depth; that is, the dropout rate may be larger for networks with a larger number of layers. The dropout rate may be in the range of 0.2 to 0.5. The adaptive gradient clipping technique may also be used in combination with momentum-based update rules such as Nesterov's momentum. The adaptive gradient clipping technique also allows the use of large learning rates, which speeds up training due to the improved stability of the training method.

[0101] The determination of the gradient may be based on a sharpness-aware minimization technique. In the sharpness-aware minimization technique, the loss function may include a traditional loss based on the training task and an additional loss based on the shape of the minima. The additional loss seeks parameters in a neighborhood with uniformly low loss values. In other words, flatter minima are sought, which are believed to provide better generalization compared to sharply shaped minima. The determination of the gradient may include performing a gradient ascent step to determine modified versions of the parameters, and performing a gradient descent step based on the modified versions of the parameters to determine gradients associated with the parameters. The gradient ascent step may be performed based on a subset of the current batch of training data items. For example, 1 / 5 of the training data items in the current batch may be used. When used in conjunction with an adaptive gradient clipping technique, it has been found that using a subset of the batch provides equivalent performance to using all of the training data items in the batch for the ascent step. Thus, the same benefits can be realized at a much lower computational cost. When used in a distributed training system, the gradients in the gradient ascent step do not require synchronization between replicas on different processing units. The gradient ascent step and the generated modified parameters can be kept local to the processing unit, and the gradient descent step can be performed on the local modified parameters. The same effect can be achieved via gradient accumulation for distributed systems with fewer processing units, or for single processing unit systems.Further details regarding sharpness-aware minimization can be found in Foret et al., "Sharpness-aware minimization for efficiently improving generalization," 9th International Conference on Learning Representations, ICLR, 2021, available at https: / / openreview.net / forum?id=6Tm1mposlrM, which is incorporated by reference in its entirety.

[0102] 1, the neural network training system 100 may be configured to augment the training dataset 110 to generate additional training data items. Additionally or alternatively, the received training dataset 110 may be an augmented training dataset that includes a set of unaltered training data items together with modified training data items.

[0103] The enhanced stability provided by the adaptive gradient clipping technique allows powerful augmentation to be used without degrading task performance. One exemplary data augmentation technique that may be used is called "RandAugment." More information on RandAugment can be found in Cubuk et al., "Randaugment: Practical automated data augmentation with a reduced search space," Proceedings of the IEEE / CVF Conference on Computer Vision and Pattern Recognition Workshops, pp. 702-703, 2020, which is incorporated by reference in its entirety. However, briefly, for image data, RandAugment provides a selection of image transformations including identity, auto-contrast, equalization, rotation, solarization, colorization, posterization, contrast, brightness, sharpness, shear, and translation. It will be appreciated that other sets of transformations may be used as appropriate, depending on the modality of the training data items. Modified versions of the training data items may be generated by randomly selecting one or more transformations. In one embodiment, four transformations are randomly selected to be applied sequentially to the training data items to generate modified training data items for use in training the neural network using an adaptive gradient clipping technique.

[0104] Additionally or alternatively, other data augmentation techniques may be used. For example, the modified training data item may be generated by selecting a portion of the first training data item and replacing the corresponding portion in the second training data item with the selected portion from the first training data item to generate the modified training data item. The location and size of the selected portion may be selected randomly. Instead of a single portion, multiple portions may be selected and used to replace to generate the modified training data item. In the case of image data, the portion may be an image patch.

[0105] The training data items modified in this manner may be assigned a label based on the proportion of the first and second training data items present in the modified training data items. For example, if the selected portion of the first training data items constitutes 40% of the modified training data items and the second training data items constitute the remaining 60%, the label for the modified training data items may be 0.4 for the class associated with the first training data items and 0.6 for the class associated with the second training data items. In a similar data augmentation technique, the selected portion of the first training data items may be blanked, i.e., pixel values ​​may be set to zero values ​​or to values ​​representing black, or replaced with random noise.

[0106] Another exemplary data augmentation technique suitable for use with the adaptive gradient clipping technique includes generating a modified training data item by interpolating a first training data item and a second training data item. The interpolation may be a linear interpolation. The modified training data item may be assigned a label based on an interpolation weighting of the first training data item and the second training data item.

[0107] In one implementation, for a batch of training data items, RandAugment may be applied to all of the training data items in the batch, a partial selection / replacement technique may be applied to half of the training data items in the batch, and an interpolation technique may be applied to the remaining half of the training data items to generate further training data items for the batch. As mentioned above, the enhanced stability provided by the adaptive gradient clipping method allows strong augmentation to be used without degrading task performance. Thus, a combination of different data augmentation techniques may be beneficial to improve task performance. It has been observed that task performance can be improved progressively with stronger data augmentation. A typical batch normalized neural network does not benefit from using stronger data augmentation and may in some cases impair performance.

[0108] The received neural network parameters 105 may be parameters of a pre-trained neural network, and the neural network training system 100 may be used to further train the neural network. For example, the neural network may have been trained on a different dataset and / or for a different training purpose prior to further training on a particular task of interest and / or with a particular dataset of interest. Thus, the neural network training system 100 may be used in the context of transfer learning. In one embodiment, the neural network is pre-trained on a dataset containing approximately 300 million labeled images from 18,000 classes. The neural network is then fine-tuned for image recognition on the ImageNet dataset. Both the pre-training and fine-tuning stages may be performed using the neural network training system 100 and adaptive gradient clipping techniques.

[0109] The adaptive gradient clipping technique may be applied to a neural network having a deep residual neural network architecture. The residual neural network architecture comprises a residual block, and as described above, using the adaptive gradient clipping technique, the residual block may be without a normalization layer. The residual block may include operations such as convolution operations, pooling operations, and / or other linear and nonlinear operations, but without including a batch normalization operation.

[0110] In the convolutional layers, the gradient norm and parameter norm may be calculated over a fan-in range that includes the channel dimension and the spatial dimension. The adaptive gradient clipping technique may be applied to all layers of the network. However, the final output layer may be excluded, and the first convolutional layer may also be excluded.

[0111] 4 presents a schematic diagram of a residual neural network architecture 400, which may be a normalizer-free neural network. The residual neural network 400 comprises an initial set of one or more hidden layers called the "stem" 405. Following the stem, the residual neural network 400 comprises another set of hidden layers called the "backbone" 410. Finally, the residual neural network 400 comprises a further set of one or more layers 415, which may be specific to the task being performed, such as a classification layer.

[0112] The backbone 410 of the residual neural network 400 may comprise multiple repeating residual blocks. Each residual block may contain the same sequence of operations (sequence of neural network layers) and there may be multiple types of residual blocks. The residual blocks may be ordered such that each stage comprises a sequence of residual blocks with a certain width and resolution. In FIG. 4, the backbone 410 comprises a first stage 410A with one residual block, a second stage 410B with two residual blocks, a third stage 410C with six residual blocks, and a fourth stage 410D with three residual blocks. The backbone 410 may comprise a certain number of residual blocks in a ratio of 1:2:6:3 starting from the first stage to the fourth stage. Deeper neural networks may be built by increasing the number of residual blocks in each stage while keeping the specified ratio. For example, a neural network may have 5 residual blocks in the first stage, 10 residual blocks in the second stage, 30 residual blocks in the third stage, and 15 residual blocks in the fourth stage.

[0113] The width of each stage may be twice the width of the previous stage. For example, the width may be 256 in the first stage, 512 in the second stage, 1024 in the third stage, and 2048 in the fourth stage. In an alternative configuration, the width of the third and fourth stages may be 1536. For example, the width may be 256 in the first stage, 512 in the second stage, and 1536 in both the third and fourth stages. In another embodiment, the width may be 256 in the first stage, 1024 in the second stage, and 1536 in both the third and fourth stages. Transition blocks (not shown in FIG. 4) may be used between stages to accommodate the changes in width.

[0114] As mentioned above, the residual block may include a nonlinearity. The nonlinearity may be a Gaussian Error Linear Unit (GELU) or a Rectified Linear Unit (ReLU), or other suitable nonlinear operation. The convolution operation may be a grouped convolution. For example, the group width of a 3×3 convolution may be 128.

[0115] The residual block may be a bottleneck residual block. An exemplary bottleneck residual block 500 is shown in FIG. 5. The bottleneck residual block 500 comprises a 1×1 convolutional layer 505 that reduces the number of channels to form a bottleneck. For example, the number of channels may be halved. A first grouped convolutional layer 510 and a second grouped convolutional layer 515 are present in the bottleneck. A typical bottleneck consists of only one convolutional layer in the bottleneck. It has been found that including a second convolutional layer in the bottleneck can improve task performance with little impact on training time. In FIG. 5, the bottleneck comprises two 3×3 grouped convolutional layers 510, 515. An additional 1×1 convolutional layer 520 is provided that restores the number of channels. A nonlinearity (not shown in FIG. 5) may follow one or more of the convolutional operations.

[0116] The residual block 500 also includes two scaling parameters, β 525 and α 530. The β parameter 525 downscales the input of the residual block 500 and may be based on the variance of the input. The variance may be determined analytically. The final activations of the residual branch of the residual block 500 (the path containing the bottleneck) may be scaled by the α scalar parameter 530.

[0117] Using the scaling parameters 525 and 530, the residual block 500 is i+1 =h i +αf i (h i / β i ), where h irepresents the input to the i-th residual block 500, and f i () represents the function computed by the i-th residual branch. The function is Var(f i The scalar α 530 may be parameterized to be the variance that preserves the initial setting, such that Var(z)=Var(z). The scalar α 530 may be 0.2. The scalar β i 525 may be determined by predicting the standard deviation of the input to the i-th residual block,

[0118]

number

[0119] where Var(h i+1 )=Var(h i )+α 2 and for the transition block, the skip path is i / β i ) and the expected variance is h i+1 =1+α 2 Further details can be found in Brock et al., “Characterizing signal propagation to close the performance gap in unnormalized resnets,” 9th International Conference on Learning Representations, ICLR, 2021, which is incorporated by reference in its entirety.

[0120] The weights of the convolutional layers of the residual block 500 may undergo scaled weight standardization, i.e., the weights may be reparameterized based on the mean and standard deviation of the weights in that layer. Further details related to scaled weight standardization can be found in Brock et al., “Characterizing signal propagation to close the performance gap in unnormalized resnets,” 9th International Conference on Learning Representations, ICLR, 2021, which is incorporated by reference in its entirety.

[0121] The residual block may further comprise a squeeze-and-exite layer. The squeeze-and-exite layer may process the input activations according to the following sequence of functions: global average pooling, fully connected linear function, scaled nonlinear function, second fully connected linear function, sigmoid function, and linear scaling. For example, the output of the layer may be 2σ(FC(GELU(FC(pool(h)))))×h, where σ is the sigmoid function, FC is the fully connected linear function, pool is the global average pooling, and h is the input activations. A scalar multiplier of 2 may be used to maintain signal variance. In one embodiment, the squeeze-and-exite layer is included after the final 1×1 convolutional layer 520 and prior to scaling with α 530.

[0122] The residual block may further comprise a learnable scalar gain at the end of the residual branch of the residual block. The learnable scalar may be initialized with a value of 0. The learnable scalar may be in addition to the scalar α 530 described above.

[0123] As mentioned above, the residual neural network may include transition blocks between the stages of the backbone. The transition blocks may have a form similar to the bottleneck residual block 500 shown in FIG. 5. However, the first 3×3 grouped convolutional layer 510 may be modified to increase the stride value, e.g., the convolution operation may use a stride of 2 to vary the width of the output activations. Furthermore, the skip path (a path that bypasses the bottleneck layer) may include a pooling layer and a 1×1 convolutional layer of varying width. Also, the skip path may be modified to branch after β-scaling 525 instead of before β-scaling 525 as in the residual block 500.

[0124] Referring now to FIG. 6, a plot of training latency versus image recognition accuracy is shown comparing an exemplary normalizer-free neural network (solid line) trained using the techniques described above compared to a representative sample of the best performing image recognition neural network models based on residual neural networks (dashed line). More specifically, exemplary normalizer-free neural networks trained using the techniques described above, labeled NFNet-F0 through NFNet-F5, comprise bottleneck residual blocks as shown in FIG. 5. Each exemplary neural network has a 4-stage backbone with a ratio of 1:2:6:3 as described above. The F0 neural network is the base network with the fewest number of residual blocks, i.e., 1, 2, 6, and 3 residual blocks in each stage. Each subsequent network has the next integer value in the ratio, i.e., the F1 neural network has 2, 4, 12, and 6 residual blocks in each stage, the F2 neural network has 3, 6, 18, and 9 residual blocks in each stage, and so on. The width of each row is [256, 512, 1536, 1536] starting from the 1st row to the 4th row.

[0125] The plot in Figure 6 shows the training latency, measured as the median over 5000 training steps of the observed wall-clock time required to execute a single training step using a TPUv3 with 32 devices and a batch size of 32 training data items on each device. The neural networks are evaluated using the ImageNet top-1 accuracy benchmark.

[0126] As can be seen from FIG. 6, the exemplary normalizer-free neural network results in higher image recognition accuracy while also being more efficient to train.

[0127] As previously mentioned, adaptive gradient clipping techniques may be used to train neural networks to perform specific tasks, examples of which are described below.

[0128] A neural network can be configured to receive any type of digital data input and generate any type of scoring, classification, or regression output based on the input.

[0129] For example, if the input to a neural network is an image, or features extracted from the image, the output generated by the neural network for a given image may be a score for each category of a set of object categories, where each score represents an estimated likelihood that the image contains an image of an object belonging to that category. That is, the neural network may perform an image / object recognition task. The neural network may also provide as output an indication of the location in the image of detected objects, and thus perform image segmentation.

[0130] As another example, if the input to a neural network is a sequence of text in one language, the output generated by the neural network may be a score for each set of sets of text in another language, where each score represents the estimated likelihood that that text in that other language is an appropriate translation of the input text into that other language.

[0131] As another example, if the input to a neural network is a sequence representing a verbal utterance, the output generated by the neural network may be a score for each text in a set of texts, where each score represents an estimated likelihood that that text is a correct transcription for that utterance.

[0132] More generally, neural networks may be used in language modeling systems, image processing systems, or action selection systems. Neural networks may be used for supervised and unsupervised learning tasks. For example, supervised learning tasks may include classification tasks, such as image processing tasks, speech recognition tasks, natural language processing tasks, word recognition tasks, or optical character recognition tasks. Unsupervised learning tasks may include reinforcement learning tasks in which an agent interacts with one or more real or simulated environments to achieve one or more goals.

[0133] Input data to the neural network may include, for example, one or more of image data, motion / video data, motion data, voice data, audio data, electronic documents, data representing a state of an environment, and / or data representing an action. For example, image data may include color pixel value data or monochrome pixel value data. Such image data may be captured from an image sensor, such as a camera or a LIDAR sensor. Audio data may include data defining an audio waveform, such as a series of values ​​in the time domain and / or frequency domain defining a waveform, which may represent a speech in a natural language. Electronic document data may include text data representing words in a natural language. Data representing a state of an environment may include any kind of sensor data, including, for example, data characterizing a state of a robot or vehicle, such as pose data and / or position / velocity / acceleration data, or data characterizing a state of an industrial plant or data center, such as sensed electronic signals, such as sensed current signals and / or temperature signals. The data representing the action may include, for example, position control data, velocity control data, acceleration control data, and / or torque control data, or data for controlling the operation of one or more items of equipment in an industrial plant or a data center. These data may generally relate to a real environment or a virtual, e.g., simulated, environment.

[0134] The output data of the neural network may likewise include any kind of data. For example, in a classification system, the output data may include class labels for the input data items. In a regression task, the output data may predict the value of a continuous variable, e.g., a control variable for controlling an electronic or electromechanical system, such as a robot, a vehicle, a data center or a plant. In another example of a regression task operating on image or audio data, the output data may define one or more locations in the data, e.g., the location of an object, or the location of one or more corners of an object's bounding box, or the time location of a sound feature in an audio waveform. In a reinforcement learning system, the output data may include, for example, data representing an action, which, as previously described, is to be performed by an agent operating in an environment, e.g., a mechanical agent, such as a robot or a vehicle.

[0135] Data representing actions may include, for example, data defining an action value (Q-value) for an action, or data parameterizing a probability distribution where the probability distribution is sampled to determine an action, or data directly defining an action, for example, in a continuous action space. Thus, in a reinforcement learning system, a neural network may directly parameterize a probability distribution for an action selection policy, or the neural network may be trained to estimate values ​​of an action value function (Q-value). In the case where a neural network is trained to estimate values ​​of an action value function (Q-value), multiple memories and respective output networks may share a common embedding network to yield a Q-value for each available action.

[0136] A Transformer Neural Network is a kind of self-attentional feed-forward sequence model. It comprises an encoder and a decoder. The encoder maps an input sequence to an encoding. The decoder processes the encoding to yield an output sequence. Examples of input and output sequences are given below. Both the encoder and the decoder use self-attention to guide the encoder / decoder to focus on the most relevant parts of the sequence with respect to the current time step, replacing the need for recurrent connections. Further details of the Transformer model can be found in Vaswani et al., "Attention Is All You Need," 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA, available at https: / / papers.nips.cc / paper / 7181-attention-is-all-you-need.pdf, which is incorporated herein by reference in its entirety.

[0137] A transformer neural network may be configured to receive an input sequence (i.e., a sequence of inputs each having a respective input at each of a plurality of input positions) and process the input sequence to generate an output or a sequence of outputs.

[0138] For example, a transformer neural network may be part of a reinforcement learning system that selects an action to be performed by a reinforcement learning agent interacting with an environment. It will be appreciated that other types of neural networks may be used in conjunction with a reinforcement learning system. For an agent to interact with an environment, a reinforcement learning system may receive an input sequence including a sequence of observations that characterize various states of the environment. The system may generate an output that specifies one or more actions to be performed by the agent in response to the received input sequence, i.e., in response to the last observation in the sequence. That is, the sequence of observations includes a current observation that characterizes the current state of the environment and one or more historical observations that characterize past states of the environment.

[0139] In some implementations, the environment is a real-world environment and the agent is a machine agent that interacts with the real-world environment. For example, the agent may be a robot that interacts with the environment to accomplish a particular task, such as to locate an object of interest in the environment, or to move an object of interest to a specified location in the environment, or to navigate to a specified destination in the environment, or the agent may be an autonomous or semi-autonomous land, air, or sea vehicle that moves within the environment.

[0140] In these implementations, the observations may include, for example, one or more of images, object position data, and sensor data, e.g., from image sensors, distance sensors, or position sensors, or from actuators, to capture the observations as the agent interacts with the environment.

[0141] For example, in the case of a robot, the observations may include data characterizing the current state of the robot, such as one or more of joint positions, joint velocities, joint forces, torques or accelerations, e.g., gravity compensated torque feedback, and a global or relative pose of an item held by the robot.

[0142] In the case of a robot or other mechanical agent or vehicle, the observations may similarly include one or more of the position, linear or angular velocity, force, torque or acceleration, and global or relative pose of one or more parts of the agent. The observations may be defined in one, two, or three dimensions and may be absolute and / or relative observations.

[0143] The observations may also include sensed electronic signals, such as, for example, motor current or temperature signals, and / or image data or video data, for example, from a camera or LIDAR sensor, such as data from sensors on the agent or from sensors located separately from the agent in the environment.

[0144] In the case of electronic agents, the observations may include data from one or more sensors monitoring portions of a plant or service facility, such as current sensors, voltage sensors, power sensors, temperature sensors, and other sensors, and / or electronic signals representing the functioning of electronic and / or mechanical items of equipment.

[0145] In these implementations, an action may be a control input or higher level control command that controls a robot, e.g., torque on the robot's joints, or an autonomous or semi-autonomous land, air, or sea vehicle, e.g., control input or higher level control command that controls torque on a control surface or other control element of the vehicle.

[0146] In other words, an action can include, for example, position data, velocity data, or force / torque / acceleration data for one or more joints of a robot or part of another mechanical agent. Action data may also or alternatively include electronic control data, such as motor control data, or, more generally, data for controlling one or more electronic devices in the environment, whose control affects the observed state of the environment. For example, in the case of an autonomous or semi-autonomous land, air, or sea vehicle, actions may include actions that control navigation, such as steering, and motion, e.g., braking and / or acceleration, of the vehicle.

[0147] In some implementations, the environment is a simulated environment and the agent is implemented as one or more computers that interact with the simulated environment. Training an agent in a simulated environment may allow the agent to learn from large amounts of simulated training data while avoiding risks associated with training an agent in a real-world environment, such as damage to the agent due to performing a poorly selected action. Agents trained in a simulated environment may then be deployed in a real-world environment.

[0148] For example, the simulated environment may be a simulation of a robot or vehicle, and the reinforcement learning system may be trained on the simulation. For example, the simulated environment may be a motion simulation environment, such as a driving simulation or a flight simulation, and the agent is a simulated vehicle that moves through the motion simulation. In these implementations, the actions may be control inputs that control a simulated user or a simulated vehicle.

[0149] In another embodiment, the simulated environment may be a video game and the agent may be a simulated user playing the video game.

[0150] In a further example, the environment may be a chemical synthesis environment or a protein folding environment, with each state being a respective state of a protein chain or of one or more intermediate or precursor chemicals, and the agent is a computer system for determining how to fold a protein chain or how to synthesize a chemical. In this example, the actions are possible folding actions for folding a protein chain or actions for assembling precursor chemicals / intermediates, and the results to be achieved may include, for example, folding a protein so that it is stable and that it achieves a particular biological function, or resulting in a plausible synthetic route for a chemical. As another example, the agent may be a machine agent that executes or controls protein folding actions selected by the system automatically without human interaction. The observations may include direct or indirect observations of protein states and / or may be derived from simulations.

[0151] Similarly, the environment may be a drug design environment, where each state is a respective state of a potential chemical industrial chemical, and the agent is a computer system for determining elements of the chemical industrial chemical and / or synthetic pathways for the chemical industrial chemical. The drug / synthesis may be designed based on rewards derived from goals for the drug, for example, in a simulation. As another example, the agent may be a machine agent that executes or controls the synthesis of the drug.

[0152] In some applications, the agents may be stationary or mobile software agents, i.e., computer programs, configured to operate autonomously and / or together with other software agents or people to perform tasks. For example, the environment may be an integrated circuit routing environment, and the system may be configured to learn to perform a routing task for routing interconnect lines of an integrated circuit, such as an ASIC. In that case, the reward (or cost) may depend on one or more routing metrics, such as interconnect resistance, capacitance, impedance, loss, speed, or propagation delay, physical line parameters, such as width, thickness, or shape, and design rules. The observations may be observations of component positions and component interconnects, and the actions may include, for example, component placement actions that define component positions or component orientations, and / or interconnect routing actions, e.g., interconnect selection actions and / or interconnect placement actions. Thus, the routing task may include placing components, i.e., determining the positions and / or orientations of components of an integrated circuit, and / or determining the routing of interconnects between components. Once the routing task is completed, an integrated circuit, e.g., an ASIC, may be manufactured with the determined placement and / or routing. Alternatively, the environment may be a data packet communication network environment and the agent may be a router that routes packets of data across the communication network based on observations of the network.

[0153] In general, in the case of a simulated environment, the observations may include simulated versions of the observations described above, or one or more of the types of observations described above, and the actions may include simulated versions of the actions described above, or one or more of the types of actions described above.

[0154] In some other applications, the agent may control actions in a real-world environment including items of equipment, for example in a data center, or in an electrical or water grid system, or in a manufacturing plant or service facility. The observations may then relate to the operation of the plant or facility. For example, the observations may include observations of power or water usage by the facility, or may include observations of power generation or distribution control, or may include observations of resource usage or waste production. The agent may control actions in the environment to increase efficiency, for example by reducing resource usage, and / or to reduce the environmental impact of the operation in the environment, for example by reducing waste. The actions may include actions that control or impose operating conditions on items of equipment of the plant / facility, and / or actions that result in changes in settings in the operation of the plant / facility, for example to adjust or turn on / off components of the plant / facility.

[0155] In some further applications, the environment is a real-world environment and the agent manages the distribution of tasks across computational resources, for example on mobile devices and / or in a data center. In these implementations, the actions may include assigning a task to a particular computational resource.

[0156] In general, in the aforementioned applications where the environment is a simulated version of a real-world environment, once the system / method has been trained in the simulation, the system / method may then be applied to the real-world environment. That is, control signals generated by the system / method may be used to control an agent to perform a task in the real-world environment in response to observations from the real-world environment. Optionally, the system / method may continue training in the real-world environment based on one or more rewards from the real-world environment.

[0157] Optionally, in any of the aforementioned implementations, the observations at any given time step may include data from previous time steps that may be useful in characterizing the environment, such as actions performed in the previous time step, rewards received in the previous time step, etc.

[0158] In another example, the Transformer Neural Network may be part of a neural machine translation system: if the input sequence is a sequence of words in a source language, e.g., a sentence or a phrase, the output may be a translation of the input sequence into a target language, i.e., a sequence of words in the target language that represents the sequence of words in the source language.

[0159] As another example, a transformer neural network may be part of a speech recognition system. That is, if the input sequence is a sequence of audio data representing an oral utterance, the output may be a sequence of graphemes, characters, or words representing the utterance, i.e., a transcription of the input sequence. As another example, if the input to the neural network is a sequence representing an oral utterance, the output generated by the neural network may indicate whether a particular word or phrase (a "hot word") was spoken in the utterance. As another example, if the input to the neural network is a sequence representing an oral utterance, the output generated by the neural network may identify the natural language in which the utterance was spoken. Thus, in general, the network input may include audio data for performing an audio processing task, and the network output may provide the result of the audio processing task, for example, identifying words or phrases or converting audio to text.

[0160] As another example, the transform neural network may be part of a natural language processing system. For example, if the input sequence is a sequence of words in a source language, e.g., a sentence or phrase, the output may be a summary of the input sequence in the source language, i.e., a sequence that has fewer words but preserves the basic meaning of the input sequence. As another example, if the input sequence is a sequence of words forming a question, the output may be / be defined as a sequence of words forming an answer to the question. As another example, the task may be a natural language understanding task that operates on a sequence of text in some natural language to generate an output that predicts some property of the text, e.g., an entailment task, a paraphrase task, a text similarity task, a sentiment analysis task, a sentence completion task, a grammaticality task, etc. Or, automatic code generation from natural language (automatic generation of TensorFlow code snippets from natural language). As another example, the task can be a text-to-speech task where the input is text in a natural language, or features of text in a natural language, and the network output includes data defining a spectrogram or other data defining the audio of the text being spoken in the natural language.

[0161] As another example, the task may be a text generation task where the input is a sequence of text and the output is another sequence of text, e.g., a completion of the input sequence of text, a response to a question asked in the input sequence, or a sequence of text on a topic specified by the first sequence of text. As another example, the input to a text generation task may be input other than text, e.g., an image, and the output sequence may be text describing the input.

[0162] As another example, the Transformer Neural Network may be part of a computer-aided medical diagnosis system, for example, the input sequences may be sequences of data from an electronic medical record, and the output may be a predicted sequence of treatments.

[0163] As another example, the transformer neural network may be part of an image processing system. For example, the input sequence may be images, i.e., a sequence of color values ​​from the images, and the output may be a sequence of text describing the images or videos. As another example, the input sequence may be a sequence of text, or different contexts, and the output may be images describing the contexts.

[0164] A generative adversarial network (GAN) is a generative model trained using an adversarial process in which a generator network and a discriminator network are trained simultaneously. During training, the generator network generates samples that the discriminator network attempts to recognize as having been generated by the generator network versus being real training data items. The results of the discriminator network's decisions are used as learning signals for the generator network to improve its generating ability with the goal that the generated samples cannot be distinguished from real training data items. At the same time, the discriminator network is also trained to improve its detection ability, so that the two networks work in tandem to improve the capabilities of the generator network. Further details can be found in Goodfellow et al., "Generative Adversarial Networks," arXiv preprint arXiv: 1406.2661, 2014, available at https: / / arxiv.org / pdf / 1406.2661.pdf, which is incorporated herein by reference in its entirety.

[0165] The generator may generate data items that may be data representing still images or video, where the individual numerical values ​​contained in the data items may represent pixel values, e.g., values ​​of one or more color channels of a pixel. The training images used to train the discriminator network (and thus to train the generator network jointly with the discriminator network) may be real-world images captured by a camera.

[0166] For example, in one implementation, a user may use a trained generator network to generate images (still images or video) from an image stream (e.g., a stream that reflects real-world images, e.g., that reflects the database of training images from which the generator network was generated).

[0167] Alternatively, the data items may be data representing an acoustic signal, e.g. amplitude values ​​of an audio waveform (e.g. a natural language, where the training examples in this case may be samples of the natural language, e.g. recorded by a microphone from the speech of a human speaker). In another possibility, the data items may be text data, e.g. text strings in a machine translation task, or other representations of words and / or sub-word units (terms). Thus, the data items may be one-, two- or higher-dimensional.

[0168] The generator network may generate data items conditioned on a condition vector (target data) input to the generator network, which represents a target for generating the data items. The target data may represent data of the same type or modality as the generated data items, or of a different type or modality. For example, when trained to generate image data, the target data may define a label or class of one of the images, in which case the generated data items may include an example image of that type (e.g., an African elephant). Alternatively, the target data may include an image, or an encoding of an image, and the generated data items may define another image that is similar, for example, when trained on images of faces, the target data may include an encoding of an individual's face, in which case the generator network may generate data items representing similar faces in different poses / lighting conditions. In another example, the target data may include data indicating an image of a subject and defining a movement / change in viewpoint, and the generator network can generate an image of the subject from the new viewpoint.

[0169] Alternatively, the target data may include text strings or spoken sentences, or encodings thereof, and the generator network may generate images corresponding to the text or audio (text-image synthesis), or vice versa. Alternatively, the target data may include text strings or spoken sentences, or encodings thereof, in which case the generator network may generate corresponding text strings or spoken sentences in different languages. The system may also autoregressively generate video, particularly given one or more previous video frames.

[0170] In another implementation, the generator network may generate acoustic data, e.g., speech, in a similar manner. This may be conditioned on other data, such as audio data and / or text data. In general, the target data may define local and / or global features of the generated data items. For example, in the case of audio data, the generator network may generate a sequence of outputs based on a set of target data values. For example, the target data may include global features (which are identical if the generator network is to generate a sequence of data items) that may include information defining the acoustics of a particular individual's voice, or a speech style, or a speaker's identity, or a language specificity. The target data may also or alternatively include local features (i.e., not identical for a sequence of data items) that may include linguistic features derived from the input text, optionally accompanied by intonation data.

[0171] In another example, the goal data may define the movement or state of a physical object, e.g., the action and / or state of a robotic arm. The generator network may then be used to generate data items that predict future image or video sequences seen by a real or virtual camera associated with the physical object. In such an example, the goal data may include one or more previous image or video frames seen by the camera. This data may be useful for reinforcement learning, e.g., to facilitate planning in a visual environment. More generally, the system learns to encode probability densities (i.e., distributions) that may be used directly for probabilistic planning / exploration.

[0172] In further embodiments, the generator network may be used for image processing tasks such as denoising, deblurring, image completion, etc. by using target data defining a noisy or incomplete image, for image modification tasks by using target data defining a modified image, and for image compression, for example when the generator network is used in an autoencoder. The system may be used to process signals representing other than images as well.

[0173] The input target data and the output data items may generally be any kind of digital data. Thus, in another embodiment, the input target data and the output data items may each comprise tokens defining sentences in a natural language. The generator network may then be used in a system, for example, for machine translation or to generate sentences expressing concepts expressed in the latent values ​​and / or further data. The latent values ​​may additionally or alternatively be used to control the style or emotion of the generated text. In a further embodiment, the input and output data items may generally comprise audio data, video data, or time series data.

[0174] In another embodiment, the generator network may be used to generate further examples of data items for training another machine learning system. For example, the generator network and the discriminator network may be jointly trained on a set of data items, and then the generator network is used to generate new data items similar to the data items in the training dataset. The set of potential values ​​may be determined by sampling from a potential distribution of potential values. If the generator network is trained conditional on further data, e.g., labels, new data items may be generated conditional on the further data, e.g., labels provided to the generator network. In this way, further labeled data items may be generated, e.g., to supplement the scarce unlabeled training data items.

[0175] To say that one or more computer systems are configured to perform a particular operation or action means that software, firmware, hardware, or a combination thereof is installed on the system that, when activated, causes the system to perform that operation or action. To say that one or more computer programs are configured to perform a particular operation or action means that the one or more programs contain instructions that, when executed by a data processing device, cause the device to perform that operation or action.

[0176] The subject matter and functional operations described herein may be implemented in digital electronic circuitry, in tangibly embodied computer software or firmware, in computer hardware, including the structures disclosed herein and their structural equivalents, or a combination of one or more of these. The subject matter described herein may be implemented as one or more computer programs, i.e., as one or more modules of computer program instructions encoded on a tangible, non-transitory program medium to be executed by or to control the operation of a data processing device. Alternatively, or in addition, the program instructions may be encoded on an artificially generated propagated signal, e.g., a machine-generated electrical, optical, or electromagnetic signal, generated to encode information for transmission to an appropriate receiving device to be executed by the data processing device. The computer storage medium may be a machine-readable storage device, a machine-readable storage substrate, a random access or serial access memory device, or a combination of one or more of these storage media. However, the computer storage medium is not a propagated signal.

[0177] The term "data processing apparatus" encompasses all kinds of apparatus, devices, machines for processing data, including, by way of example, a programmable processor, a computer, or multiple processors or multiple computers. The apparatus may include special purpose 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 program in question, 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 these.

[0178] A computer program (which may be referred to or described as a program, software, software application, module, software module, script, or code) may be written in any form of programming language, including compiled or interpreted, or declarative or procedural, and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment. A computer program may or may not correspond to a file in a file system. A program may be stored in a portion of a file that holds other programs or other data, in one or more scripts stored in a markup language document, in a single file dedicated to the program, or in multiple cooperating files, e.g., files that store one or more modules, subprograms, or portions of code. A computer program may be deployed to be executed on one computer or on multiple computers located at one site or distributed across multiple sites and connected together by a communication network.

[0179] As used herein, "engine" or "software engine" refers to a software-implemented input / output system that results in an output that is distinct from the input. An engine can be an encoded block of functionality, such as a library, a platform, a software development kit ("SDK"), or an object. Each engine can be implemented on any suitable type of computing device that includes one or more processors and a computer-readable medium, such as a server, a mobile phone, a tablet computer, a notebook computer, a music player, an e-reader, a laptop or desktop computer, a PDA, a smartphone, or other fixed or portable device. Furthermore, two or more of the engines may be implemented on the same computing device or on different computing devices.

[0180] The processes and logic flows described herein may be performed by one or more programmable computers executing one or more computer programs to perform functions by manipulating input data and generating output. The processes and logic flows may also be performed by, and an apparatus may be implemented as, a special purpose logic circuit, such as an FPGA (field programmable gate array) or an ASIC (application specific integrated circuit). For example, the processes and logic flows may be performed by, and an apparatus may be implemented as, a graphics processing unit (GPU).

[0181] Computers suitable for executing computer programs include those that can be based on, for example, general-purpose or dedicated microprocessors, or both, or any other type of central processing unit. In general, the central processing unit receives instructions and data from a read-only memory or a random access memory, or both. The essential elements of a computer are a central processing unit for executing or executing instructions, and one or more memory devices for storing instructions and data. In general, a computer also includes one or more mass storage devices, such as magnetic disks, magneto-optical disks, or optical disks, for storing data, or is operatively coupled to receive data from or transfer data to such mass storage devices, or both. However, a computer need not have such devices. Furthermore, a computer can be embedded in another device, such as 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, such as a universal serial bus (USB) flash drive, to name just a few.

[0182] Computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, non-volatile media, and non-volatile memory devices, including, by way of 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, and CD ROM and DVD-ROM disks. The processor and memory can be supplemented by, or incorporated in, dedicated logic circuitry.

[0183] To enable interaction with a user, embodiments of the subject matter described herein can be implemented on a computer having a display device, e.g., a CRT (cathode ray tube) monitor or LCD (liquid crystal display) monitor, for displaying information to the user, and a keyboard and pointing device, e.g., a mouse or trackball, by which the user can provide input to the computer. Other types of devices can also be used to enable interaction with the user, e.g., feedback provided to the user can be any form of sensory feedback, e.g., visual feedback, auditory feedback, or tactile feedback, and input from the user can be received in any form, including acoustic input, speech input, or tactile input. Additionally, the computer can interact with the user by sending documents to and receiving documents from devices used by the user, e.g., by sending web pages to a web browser on the user's client device in response to requests received from the web browser.

[0184] Embodiments of the subject matter described herein can be implemented in a computing system including back-end components, e.g., as a data server, or in a computing system including middleware components, e.g., as an application server, or in a computing system including front-end components, e.g., as a client computer having a graphical user interface or web browser through which a user can interact with an implementation of the subject matter described herein, or in a computing system including any combination of one or more such back-end, middleware, or front-end components. The components of the system can be connected to each other by any form or medium of digital data communication, e.g., a communications network. Examples of communications networks include local area networks ("LANs") and wide area networks ("WANs"), e.g., the Internet.

[0185] 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 clients and servers arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.

[0186] Although the specification includes many specific implementation details, these should not be construed as limitations on the scope of the invention or on the scope of what may be claimed, but rather as descriptions of features that may be specific to certain embodiments of a particular invention. Also, some features described in the context of separate embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented in multiple embodiments separately or in any suitable subcombination. Furthermore, although features may be described above as acting in a certain combination, and may even be initially claimed as such, one or more features from a claimed combination may in some cases be removed from the combination, and the claimed combination may be directed to a subcombination or a variation of the subcombination.

[0187] Similarly, although operations are depicted in the figures 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 of the illustrated operations be performed, to achieve desirable results. In some situations, multitasking and parallel processing may be advantageous. Furthermore, the separation of various system modules and system components in the embodiments described above should not be understood as requiring such separation in all embodiments, and it should be understood that the program components and systems described are generally capable of being integrated together as a single software product or packaged as multiple software products.

[0188] Specific embodiments of the subject matter have been described. Other embodiments are within the scope of the appended claims. For example, the actions recited in the claims can be performed in a different order and still achieve desirable results. As an example, the processes depicted in the appended figures do not necessarily require the particular order shown, nor sequential order, to achieve desirable results. In some implementations, multitasking and parallel processing may be advantageous. [Explanation of symbols]

[0189] 100 Neural Network Training System 105 Neural Network Parameters 110 Training Dataset 115 Neural Network Parameters 120 Datastore 125 Memory 130A, 130B, 130N Processing Unit 135A, 135B, 135N Local Memory 205A, 205B, 205N Hidden layer 210 Input 215 Output 405 stem 410A, 410B, 410C, 410D, 500 Residual Blocks 415 Classification layer 510, 515, 520 convolutional layers 525, 530 Scaling parameters

Claims

1. A computer-implemented method comprising: receiving image data including pixel values ​​for a plurality of pixels; and processing the image using a neural network to perform an image processing task. The neural network comprises: determining gradients associated with parameters of the neural network; determining a ratio of a gradient norm to a parameter norm; comparing said ratio to a threshold; in response to determining that the ratio exceeds the threshold, reducing a value of the slope such that the ratio is less than or equal to the threshold; updating the value of the parameter based on the value of the reduced gradient; The method includes:

2. The method of claim 1, wherein the image processing tasks include one or more of object recognition, image segmentation, image captioning, image denoising, image deblurring, image completion, and image compression.

3. The method of claim 1, wherein the image data is an image patch from a larger image.

4. A method according to any one of claims 1 to 3, wherein the image processing task comprises object recognition and the neural network generates an output having a set of scores including a respective score for each object category in a set of object categories, each score representing an estimated likelihood that an object of the corresponding object category is present in the image represented by the image data.

5. A method according to any one of claims 1 to 4, wherein the image processing task comprises image segmentation and the neural network generates an output indicating the location of an object detected in an image represented by the image data.

6. A method according to any one of claims 1 to 5, wherein the image processing task comprises image captioning and the neural network generates an output comprising a sequence of text describing the image represented by the image data.

7. A method according to any one of claims 1 to 6, wherein the image data is captured by a camera or a LIDAR sensor.

8. The method of claim 1, wherein the image data represents a moving image.

9. The training comprises: maintaining a value of the gradient in response to determining that the ratio is below the threshold value, and updating a value of the parameter based on the maintained value of the gradient. The method of any one of claims 1 to 8, further comprising:

10. 10. The method of claim 1, wherein reducing the value of the gradient comprises multiplying the value of the gradient by a scale factor based on the threshold to reduce the value of the gradient.

11. 11. The method of claim 1, wherein reducing the value of the gradient comprises multiplying the value of the gradient by a scale factor based on the ratio to reduce the value of the gradient.

12. A method according to any one of claims 1 to 11, wherein the training includes a step of determining the gradient norm and the parameter norm based on the parameters associated with one neuron of the neural network.

13. 13. The method of claim 12, wherein the parameters of the neural network are weights associated with the neurons of the neural network, and the training comprises determining the gradient norm based on a gradient associated with each weight associated with the neurons, and determining the parameter norm based on a weight value of each weight associated with the neurons.

14. The method of claim 13, wherein the training further comprises the steps of calculating the gradient norm as a Frobenius norm over the gradients associated with each of the weights associated with the neuron, and calculating the parameter norm as a Frobenius norm over each of the weights associated with the neuron.

15. The step of reducing the value of the gradient may be performed using the following formula: [0010] Based on this, where W l is the weight matrix for the lth layer, where i is the index of the neuron in the lth layer, [0025] is a parameter [0030] is the gradient corresponding to ||.||, λ is a scalar threshold, F 15. The method of claim 1, wherein:

16. 16. The method of claim 1, wherein the neural network comprises a residual block, the residual block being without a normalization layer.

17. 17. The method of claim 1, wherein the neural network is a deep residual neural network with a four-stage backbone.

18. The method of claim 17 , wherein the backbone comprises residual blocks in a ratio of 1:2:6:3 starting from the first stage through the fourth stage.

19. 19. The method of claim 17 or 18, wherein the width of each step is twice the width of the previous step.

20. 16. The method according to claim 1, wherein the neural network is a transformer neural network.

21. 20. The method of claim 1, wherein updating the values ​​of the parameters is based on a batch size of at least 1024 training data items.

22. A method according to any one of claims 1 to 21, wherein the training further comprises a step of receiving a training dataset including image data, and the step of determining a gradient is based on a loss function for measuring performance of the neural network on an image processing task.

23. The training is performed by a parallel processing system or a distributed processing system having a plurality of processing units, the training comprising: receiving a training data set comprising a plurality of training data items; generating a plurality of batches of training data items, each batch comprising a subset of the training data items of the training dataset; distributing the batches of training data items to the processing units; training the neural network based on the distributed batches of training data items using the multiple processing units in parallel; 18. The method of any one of claims 1 to 17, further comprising:

24. 24. The method of claim 23, wherein the parallel or distributed processing system comprises one or more tensor processing units or one or more graphics processing units.

25. A system comprising one or more computers and one or more storage devices storing instructions that, when executed by the one or more computers, cause the one or more computers to perform the operations of the respective methods described in any one of claims 1 to 24.

26. 26. The system of claim 25, which is a parallel processing system or a distributed processing system.

27. 27. The system of claim 26, comprising one or more tensor processing units or one or more graphics processing units.

28. One or more computer readable storage media storing instructions that, when executed by one or more computers, cause the one or more computers to perform the respective method operations of any one of claims 1 to 24.