System and method for evaluating a loss function or a gradient of a loss function via dual decomposition

By dividing the weight matrix and dual decomposition technology, the efficiency problem of loss function and gradient evaluation in large output spaces is solved, efficient gradient approximation and parallel computing are achieved, and the training speed and accuracy of the machine learning model are improved.

CN112368697BActive Publication Date: 2024-09-06GOOGLE LLC
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN201980044631.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2018-06-07
Filing Date
2019-06-07
Publication Date
2024-09-06
Estimated Expiration
2039-06-07

AI Technical Summary

Technical Problem

In machine learning problems with large output spaces, the computational cost of evaluating the loss function and its gradient is high, especially linear time required in terms of the size of the output space, resulting in an efficiency bottleneck in training the model.

Method used

By splitting the weight matrix into multiple blocks and constructing scoring vectors based on sparse approximations in the blocks, dual decomposition and greedy message passing algorithms are utilized to evaluate the loss function and gradient, reducing computational complexity and improving efficiency.

Benefits of technology

It achieves reduced computational costs in high-dimensional search problems, improves the accuracy of gradient approximation methods, outperforms sampling-based methods, and can process lower-dimensional search problems in parallel to reduce computing time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112368697B_ABST
    Figure CN112368697B_ABST
Patent Text Reader

Abstract

Systems and methods for evaluating a loss function or a gradient of the loss function. In an example embodiment, a computer-implemented method includes: partitioning a weight matrix into a plurality of blocks. The method includes: identifying, for each of the plurality of blocks, a first set of labels having a score greater than a first threshold. The method includes: constructing a sparse approximation of a score vector for each of the plurality of blocks based on the first set of labels. The method includes: determining a correction value for each sparse approximation of the score vector. The method includes: determining an approximation of a loss or a gradient of the loss associated with the score function based on each sparse approximation of the score vector and the correction value associated with the sparse approximation of the score vector.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure generally relates to evaluating a loss function or a gradient of a loss function. More specifically, the present disclosure relates to a computer system and method for efficiently evaluating a loss function and / or its gradient for problems with large output spaces via a dual decomposition of the loss function. Background Art

[0002] Large output spaces are ubiquitous in several machine learning problems today. Such machine learning problems may include, for example, extreme multi-class or multi-label classification problems with many classes, language modeling with a large vocabulary, or metric learning with a large number of pairwise distance constraints. In all such problems, the main bottleneck in the training model is the evaluation of the loss function and its gradient. The loss function used for such problems usually needs to list all possible outputs and may require a linear running time in the number of outputs used for evaluation. This can be a significant bottleneck in iterative methods (such as gradient descent for training the model) because each step may require a large number of operations. Summary of the invention

[0003] Aspects and advantages of embodiments of the present disclosure will be set forth in part in the following description, or may be learned from the description, or may be learned through practice of the embodiments.

[0004] An example aspect of the present disclosure relates to a computer-implemented method for evaluating a loss function or a gradient of a loss function. The method includes: partitioning a weight matrix into a plurality of blocks by a computing system including one or more computing devices, the weight matrix corresponding to a scoring function. The method includes: identifying, by the computing system, a first set of labels for each of the plurality of blocks, the first set of labels being associated with a score greater than a first threshold. The method includes: constructing, by the computing system, a sparse approximation of a scoring vector for each of the plurality of blocks based at least in part on the first set of labels. The method includes: determining, by the computing system, a correction value for each sparse approximation of a scoring vector for each of the plurality of blocks. The method includes: determining, by the computing system, an approximation of a loss or a gradient of a loss associated with the scoring function by evaluating a decomposed loss function or a gradient of the decomposed loss function based at least in part on a sparse approximation of a scoring vector for each of the plurality of blocks and a correction value associated with the sparse approximation of the scoring vector.

[0005] The computing system may determine an approximation of the loss or a gradient of the loss for each of a plurality of training examples.

[0006] The computing system may modify one or more parameters of the weight matrix or the scoring function based at least in part on the determined approximation of the loss or the gradient of the loss associated with the scoring function.

[0007] Identifying a first set of labels for each of the plurality of blocks may include querying, by the computing system, each of a plurality of maximum inner product search data structures respectively associated with the plurality of blocks of the weight matrix.

[0008] Constructing a sparse approximation of the score vector for each of the plurality of chunks may include setting, by the computing system, for each of the plurality of chunks, a corresponding approximation score for each of a plurality of labels that is neither included in the first set of labels for the chunk nor in the positive labels that are equal to zero.

[0009] Constructing a sparse approximation of a score vector for each of the plurality of chunks may include setting, by the computing system, for each of the plurality of chunks, a corresponding approximation score for each of a plurality of labels, each of the plurality of labels being neither included in a first set of labels for the chunk nor included in a positive label equal to a true score determined according to a maximum inner search product search query.

[0010] Determining a correction value for each sparse approximation of a score vector for each of a plurality of blocks may include: identifying, by the computing system, a second set of labels based at least in part on a first set of labels for each of the plurality of blocks, the second set of labels being associated with a gradient greater than a second threshold; determining, by the computing system, an average approximation score for each label in the second set of labels across the plurality of blocks; determining, by the computing system, an approximation score for each label in the second set of labels in each of the plurality of blocks; determining, by the computing system, a difference between the average approximation score and the approximation score for each of the plurality of blocks for each combination of a label in the second set of labels and a block in the plurality of blocks; and updating, by the computing system, the correction value for each sparse approximation of a score vector for each of the plurality of blocks based at least in part on the determined difference for each combination of a label in the second set of labels and a block in the plurality of blocks.

[0011] Determining an approximation of a loss or a gradient of a loss associated with a scoring function may include minimizing, by the computing system across multiple blocks, an average of a corresponding loss for each block evaluated by a corresponding approximate scoring vector for such block plus a correction value vector for each block such that a sum of the correction value vectors across multiple blocks equals zero.

[0012] The decomposed loss function may include a plurality of parts, each part corresponding to a loss associated with a respective sparse approximation of a score vector for each of the plurality of blocks.

[0013] The computing system may perform a smoothing technique on the loss function to construct a surrogate loss function having a continuous gradient; and determine a decomposed loss function based at least in part on the surrogate loss function.

[0014] Each of the plurality of blocks may include one or more columns of a weight matrix.

[0015] Querying each of the multiple maximum inner product search data structures corresponding to the multiple blocks of the weight matrix may include: obtaining a feature map corresponding to the weight matrix and the scoring function through a computing system; dividing the feature map into multiple blocks corresponding to the multiple blocks of the weight matrix through a computing system; and querying each of the multiple maximum inner product search data structures corresponding to the multiple blocks of the weight matrix through the computing system, wherein the output of the divided feature map corresponds to the blocks of the weight matrix and the first threshold.

[0016] Another exemplary aspect of the present disclosure relates to a computer system, which includes: one or more processors; and one or more non-transitory computer-readable media, which, when executed by the one or more processors, cause the computer system to perform the method described above.

[0017] Another example aspect of the present disclosure relates to a computer system. The computer system includes: one or more processors; and one or more non-transitory computer-readable media, which, when executed by the one or more processors, cause the computer system to perform operations. The operations include: identifying a first subset of multiple labels for each of multiple block partitions of a weight matrix, the first subset having a score greater than a first threshold. The operations include: for each of the multiple block partitions, constructing a sparse approximation of a score vector for such block partition based at least in part on the first subset of multiple labels identified for such block partition. The operations include: iteratively optimizing a decomposed loss function by updating correction values ​​for at least some of the multiple labels through one or more iterations. The operations include: after iteratively optimizing the decomposed loss function, returning an evaluation of the decomposed loss function or the gradient of the decomposed loss function.

[0018] Another example aspect of the present disclosure relates to a computer-implemented method for training a classifier. The method includes: training the classifier using a loss function or a gradient of a loss function obtained from the method described above. For example, an approximation of the loss function and / or the gradient can be obtained by using the above method when training the classifier. The classifier can be configured for extreme multi-class or multi-label classification problems. The classifier can provide classification of any suitable data item.

[0019] Other aspects of the disclosure relate to various systems, apparatus, non-transitory computer-readable media, user interfaces, and electronic devices.

[0020] These and other features, aspects and advantages of various embodiments of the present disclosure will be better understood by reference to the following description and the appended claims. The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate example embodiments of the present disclosure and, together with the description, are used to illustrate the relevant principles. Optional features of one aspect may be combined with other aspects where appropriate. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] A detailed discussion of embodiments for one of ordinary skill in the art is set forth in this specification, which refers to the accompanying drawings, in which:

[0022] Figure 1 depicts a block diagram of an example computing device according to some implementations of the present disclosure;

[0023] Figure 2 A plot depicting multi-class classification results on the Megaface dataset according to some embodiments of the present disclosure;

[0024] Figure 3 A plot depicting multi-label classification results on the WikiLSHTC dataset according to some embodiments of the present disclosure;

[0025] Figure 4 a plot depicting results on word embeddings with a skip meta-grammar objective according to some embodiments of the present disclosure; and

[0026] Figure 5 Depicted is a flow chart of an example method for evaluating a loss function or a gradient of a loss function, according to some embodiments of the present disclosure.

[0027] Reference numbers repeated across multiple drawings are intended to identify like components or features in the various embodiments. DETAILED DESCRIPTION

[0028] In general, the present disclosure relates to systems and methods for evaluating a loss function or the gradient of a loss function. For problems with large output spaces, evaluating the loss function and its gradient can be computationally expensive, typically taking linear time in the size of the output space. Recently, methods have been developed to accelerate learning via efficient data structures for nearest neighbor search (NNS) or maximum inner product search (MIPS). However, the performance of such data structures typically degrades in high dimensions. The present disclosure provides systems and methods for reducing difficult high-dimensional search problems to several much easier to solve lower-dimensional search problems via a dual decomposition of the loss function. The present disclosure further provides a greedy message passing technique that guarantees convergence of the original loss. In this way, the systems and methods of the present disclosure can significantly improve the accuracy of search-based gradient approximation methods and outperform sampling-based gradient approximation methods. Specifically, aspects of the present disclosure provide methods for internal functionalization that are particularly suitable for one or more computers.

[0029] Many schemes have been proposed to alleviate the evaluation of the loss function and its gradient as a bottleneck in training models for machine learning problems with large output spaces. One scheme imposes a structure on the output space. The structure can include, for example, a low-level structure, a tree structure, a local low-level structure, or a hierarchical factorization structure. However, the structural assumption can be violated in many cases. For example, while the low-level structure is generally reasonable in recommendation problems, it is generally not true in multi-class classification because there is exactly one correct answer for each case (i.e., the categories may not be related to each other). In addition, even for valid structural assumptions, it is difficult to construct the correct structure based on the data, and in practice, heuristics or manual annotations are required.

[0030] Another approach is the sampling approximation, which computes an estimate of the gradient based on only a small fraction of the negative output classes and also based on a small set of classes that are labeled positive. However, the approximation has a large variance when the loss has a skewed distribution over the classes. For example, in extreme multi-class or multi-label classification, the loss is often concentrated on only a few confused classes that have a small probability of being sampled. Variance in the gradient estimate often leads to slow progress of the learning algorithm.

[0031] For machine learning problems with a large output space but with a relatively small correct output set, the learning goal usually focuses its gradient on a relatively small number of categories, and therefore, a highly efficient learning method is to search for categories with significant gradient magnitudes. The proposed strategy for efficiently searching for categories is to maintain a sparse model during training. However, this method is only applicable to problems with high input dimensions. Another strategy is to utilize data structures to efficiently find categories by maximum inner product search (MIPS) or nearest neighbor search (NNS). The main challenge here is that, as the dimension grows, it becomes difficult to perform MIPS or NNS with high recall and high precision at the same time, and therefore, the gradient approximation performed by MIPS or NNS usually sacrifices accuracy to achieve efficiency.

[0032] Aspects of the present disclosure provide an algorithm based on applying a dual decomposition to a convex conjugate representation of a loss function. It can be viewed as a complementary technique for applying search data structures to learning problems. The algorithm replaces a high-dimensional search problem with several lower-dimensional searches by decoupling the dimensions via a dual decomposition. Lower-dimensional searches can be performed more efficiently, and then different searches are coupled together via a greedy message passing algorithm. The greedy message passing algorithm is guaranteed to converge, and therefore, can be used to obtain a good approximation to the loss and its gradient.

[0033] The systems and methods described herein provide many technical effects and benefits. Systems and methods for implementing the technology of reducing a high-dimensional search problem to several lower-dimensional search problems can have the technical effect of improving efficiency by reducing the computational cost associated with the high-dimensional search problem. For example, the high-dimensional search problem can be solved in fewer cycles by one or more processors with smaller memory requirements, and / or the lower-dimensional search problem can be distributed on several processors and solved in parallel, thereby reducing the computational time associated with the high-dimensional search problem. The recently developed method of using efficient data structures for nearest neighbor search (NNS) or maximum inner product search (MIPS) speeds up learning, but the performance of such data structures degrades in high dimensions. The technology disclosed in the present invention improves the accuracy of search-based gradient approximation methods and outperforms sampling-based gradient approximation methods.

[0034] Therefore, the system and method for implementing the greedy message passing technique can have the technical effect of ensuring that the approximate loss converges to the original loss. The technique can make it possible to decouple variables into lower-dimensional blocks that can be optimized accordingly, and iteratively perform greedy descent on the optimal solution. Therefore, the system and method of the present disclosure improves the use of processors or memories (especially parallel processing systems).

[0035] The systems and methods of the present disclosure also provide improvements to computational techniques such as data matching and retrieval computational techniques. For example, the systems and methods herein enable the efficient evaluation of losses or gradients of losses.

[0036] 1. Problem Setup

[0037] According to aspects of the present disclosure, let X represent the input space and Y represent the output space, and let K := |Y|, where K is large (e.g., on the order of one hundred thousand or greater). The learning objective of a machine learning problem can include learning a scoring function for a large output space y from a given class F of such functions. The labeled sample is x ∈ X and the pair (x, P), which represents the set of correct labels for the input point x. The notation N := Y \ P can be used to represent the set of negative labels. Given a training sample from the class set, the learning objective takes the following form:

[0038]

[0039] where, is a loss function such that L(z, P) penalizes the difference between the score vector and the set of positive labels The cost of evaluating the loss function and its gradient with respect to the score vector typically grows linearly with the size of the output space K and is thus expensive for problems with a large output space.

[0040] To reduce the complexity of loss and gradient evaluation, a linear structure assumption can be imposed on the class F of scoring functions: there exists an embedding dimension parameter such that for each f ∈ F, there exists an associated weight matrix and a feature map such that for all x ∈ X,

[0041] f(x) = Wφ(x), (1)

[0042] where D << K (e.g., on the order of a few hundred or a few thousand) such that φ(x) can be evaluated explicitly.

[0043] Thus, given f and a batch of samples the empirical loss and an approximation of its gradient can be determined.

[0044] To determine the loss f(x i , P i) and good approximations of its gradients, a data structure can be constructed for preprocessing the matrix W. Given an appropriate data structure, such an approximation can be computed in sub-linear (in terms of K) time.

[0045] A first example of a problem with a large output space that is suitable for the framework discussed above includes extreme classification. In an extreme classification problem, popular classification loss functions include cross-entropy loss

[0046]

[0047] and maximum margin loss

[0048]

[0049] For multi-class problems, |P| = 1, while for multi-label problems, typically |P| << K. A typical scoring function takes the following form

[0050] f(x) := φ(x). (4)

[0051] Here, φ(x) is a feature map constructed either based on domain knowledge or via learning (such as a neural network). Both domain knowledge and learning are suitable for the structural assumption (1).

[0052] A second example of a problem with a large output space that is suitable for the framework includes metric learning. In a metric learning problem, the object of learning during training includes: learning a function

[0053]

[0054] that represents the dissimilarity between a point x and the class set of a point y ∈ Y. Common choices for the dissimilarity function include the squared Euclidean distance parameterized by a non-linear transformation for some and more generally include the squared Mahalanobis distance d(x, y) = (ψ(x) - ψ(y)) parameterized by ψ and a positive definite matrix M and parameterized by ψ and a positive definite matrix M, d(x, y) = (ψ(x) - ψ(y)) M(ψ(x) - ψ(y)). The candidate set Y can be the entire set of training samples T or can be the class set of potential proxies For each sample (x, P), the goal is to learn a distance function such that positive candidates P are closer to x than negative candidates. A common loss function for the task is the Nearest Neighbor Component Analysis (NCA) loss and the triplet loss

[0055]

[0056] and the triplet loss

[0057]

[0058] This scoring function satisfies the structural assumption (1): for a scoring function f given by the squared Mahalanobis distance parameterized by ψ and M, the matrix W consists of rows <-ψ(y) for each y∈Y T Mψ(y), 2ψ(y) T M, -1> and φ(x)=<1, ψ(x) T ,ψ(x) T Mψ(x)> T Therefore, the embedding dimension D = d + 2.

[0059] A third example of a problem with a large output space that is suitable for the described framework includes word embeddings. In standard word2vec training, the input space X is the vocabulary set, and the output space Y = X; thus K is the vocabulary size. The skip meta-grammar objective learns a scoring function f of the form:

[0060]

[0061] where φ(·) is the latent word embedding. This clearly fits the structural assumption (1): the rows of the matrix W are the embeddings φ(y) for all y∈X.

[0062] Then, given a text corpus D, the loss function for a sample (x, P) (where P is the set of words in the corpus that appear within a window of a certain size around the input word x) is given by:

[0063]

[0064] Among them, q x is the empirical unigram frequency of x, and q y|x is the empirical frequency of observing y within a window of x in the corpus D.

[0065] 1.1 Loss and Gradient Approximation via Search

[0066] The loss functions considered in the above examples share a key feature: their values ​​can be well approximated by the scores of positive labels and the maximum score of negative labels. Similarly, their gradients are dominated by the coordinates corresponding to the positive labels and the negative labels with the maximum scores. For example, the maximum margin loss (3) is completely determined by the maximum score of negative labels and the minimum score of positive labels, and its gradient is non-zero only on the negative label with the maximum score and the positive label with the minimum score. Similarly, for the cross entropy loss (2), the coordinates of the gradients corresponding to the negative classes are dominated by those with the highest scores, and the gradient coordinates decrease exponentially as the scores decrease.

[0067] According to aspects of the present disclosure, since the score function f satisfies the linear structure property (1), the maximum score can be efficiently calculated via a maximum inner product search (MIPS) data structure. This data structure stores the vector v 1 、v 2 ,……, and supports the following forms of queries: given a target vector and threshold τ, the data structure returns the vector v stored in it i , which satisfies in time This time is typically sublinear in K. Therefore, the matrix W can be preprocessed by storing its rows in an efficient MIPS data structure. Then, for each sample x, the highest score can be computed by querying this data structure with the target vector φ(x) and some reasonable threshold τ, computing an approximation of the loss and gradient based on the returned vector (and treating all other scores as 0). This approach is depicted in Algorithm 1.

[0068] Algorithm 1 Loss and gradient approximation via search

[0069] Input sample (x, P), accuracy parameter τ>0, and access the MIPS data structure T for the row of W.

[0070] Output L(f(x),P), Approximation of .

[0071] 1: Query T with φ(x) and threshold τ to find

[0072] 2: By setting k∈S∪P And for set up To construct a sparse approximation of f(x)

[0073] 3: Return and

[0074] The error in this approximation is given by τ multiplied by of Lipschitz constant defines. For most of the loss functions considered, The Lipschitz constant is quite small: 2 for the maximum margin loss and O(P) for the cross entropy loss. max log(K))(here, for any example, P max is the maximum number of positive labels), and so on.

[0075] The main difficulty in applying this scheme in practice is the curse of dimensionality: the dependence on D is exponential for exact methods, and even for approximate methods (such as locality sensitive hashing), the cost still implicitly depends on the dimensionality because points are farther apart when the intrinsic dimension is higher.

[0076] The present disclosure enables a search technique based on dual decomposition to cope with the curse of dimensionality. This technique and its analysis are further discussed below.

[0077] In order to apply and analyze the described techniques, the loss function must be smooth (e.g., have a Lipschitz continuous gradient). For non-smooth losses (such as the maximum margin loss (3)), smoothing techniques (e.g., the Nesterov smoothing technique) can be applied to construct an alternative loss function with guaranteed approximation quality by adding a strongly convex term to the Fenchel conjugate of the loss:

[0078]

[0079] Here, μ is a smoothing parameter that ensures that the surrogate loss has Continuous gradient, while approximating the original loss function to within O(μ). This smoothed maximum boundary loss has a gradient

[0080]

[0081] Among them, 1 N represents a vector containing 0 for index k∈P and 1 for k∈N, and Represents the projection on the dual simplex method The largest few scores can again be used to compute the smoothed maximum boundary loss and its gradient.

[0082] 2. Loss decomposition

[0083] According to aspects of the present disclosure, the loss can be decomposed into several parts. Recall the linear structure assumption (1): for all x∈X, f(x)=Wφ(x). In the following description, (x,P) is fixed, and the dependence on P in L is discarded for convenience to simply use the notation L(f(x)) and

[0084] Because the MIPS on the D-dimensional rows of W are computationally expensive, we can instead decompose W by exploiting the linear structure of f. Specifically, we can decompose W by The D coordinates of the vectors in W are divided into blocks of size B (the size of each block is D / B). Here, is an integer, and a larger B leads to an easier MIPS problem, but reduces the accuracy of the resulting approximation. (1) , W (2) ,……,W (B) is the corresponding block partition of W obtained by grouping together the columns corresponding to the coordinates in each block. Similarly, let φ (1) (x),φ (2) (x), ..., φ (B) (x) is the conformal partitioning of the coordinates of φ(x).

[0085] If we define a total score vector z:=f(x)=Wφ(x), and for j∈[B], we define each block score vector z j =W (j) φ (i) (x), then It is a decomposition of the score vector. The following theorem states that the loss of a decomposable score vector can itself be decomposed into several parts connected by a set of message variables. This theorem is key to decoupling the variables into lower dimensional chunks that can be optimized accordingly via efficient MIPS data structures. While this theorem can be derived by applying the dual decomposition to the convex conjugate of the loss function, a simpler direct construction proof is provided below.

[0086] Theorem 1 makes is a convex function, and Decomposed into the sum of B vectors, as follows: Then, L(z) is equal to the optimal value of the following convex minimization problem:

[0087]

[0088] Proof. First, for any λ 1 , 2 ,……, So that by applying to the convex function Jensen's inequality, On the other hand, if for all j∈[B], So

[0089] 2.1 Loss Decomposition Guided Search (LDGS)

[0090] Theorem 1 is the basis for the approximation of the loss and its gradient. This approximation is obtained by j The variables are computed using a form of descent method (e.g., “message passing”) by approximately solving the convex minimization problem (12) without computing the entire score vector z. The gradient computation required at each step can be done by using the memory used to store W (j) The details of the loss decomposition guided search are given in Algorithm 2.

[0091] Algorithm 2 Greedy Message Passing

[0092] Input sample x, threshold parameter τ 1 , τ 2 > 0, and for j∈[B], access is used to store W (j) B MIPS data structure T of the row j

[0093] Output L(f(x)) and Approximation of .

[0094] 1: Use φ (j) (x) and threshold τ to query T j To discover

[0095] 2: By targeting k∈S j ∪P setting And for set up To build Z j Sparse approximation of

[0096] 3: For t = 1, 2, ... (until convergence), perform

[0097] 4: Calculate the set

[0098]

[0099] 5: For all k∈A and all j∈[B], calculate

[0100] 6: Calculate step length

[0101] 7: For all k∈A and all j∈[B], update

[0102]

[0103] 8: End of loop

[0104] 9: Return and

[0105] The sublinearity in the K-time implementation of step 5 in the algorithm depends on and λ j Both are sparse vectors, which in turn relies on the fact that the gradient of the loss function of interest is either sparse or concentrated on a few coordinates. Step 9 in the algorithm moves the current solution towards the optimal solution. Move, for which there is a closed form formula based on the constructive proof of Theorem 1. This move is done only for the set of coordinates of high magnitude gradients identified in step 5 of the algorithm, thus ensuring that only a few coordinates are updated. In this way, the algorithm is performing a greedy descent towards the optimal solution.

[0106] 2.2 Error analysis

[0107] definition Notice, Therefore, in using The error in approximating L(z) is at most Bτ 1 Multiply by L The Lipschitz constant, as explained previously, is usually small. The algorithm essentially runs a Frank-Wolfe type method to converge to In the following, the greedy message passing algorithm (Algorithm 2) is analyzed for The convergence rate of the loss function is given by . The analysis relies on the smoothness of the loss function. A function is called 1 / μ smooth if its gradient is Lipschitz continuous with a constant 1 / μ. For the cross entropy loss (2) μ=1, and for the smooth maximum margin loss (10), μ is a tunable parameter. In experiments, it was found that the setting of μ∈[1,5] works well.

[0108] To analyze the algorithm, let Λ denote the BK-dimensional vector 〈λ in any given step of the algorithm loop. 1 , 2 , ..., λ B 〉. Similarly, let Λ * Indicated by The BK-dimensional vector composed of. Definition That is, the objective function in (12).

[0109] Theorem 2 (Greedy Message Passing) Assume that the loss function L is 1 / μ smooth. Then, the suboptimal gap of Λ in the t-th step of the cycle can be defined as follows:

[0110]

[0111] Proof. Since the loss function L is 1 / μ smooth, it is easy to check whether G is B / μ smooth. Therefore, if ΔΛ is the change in Λ at a given step in the algorithm loop, then

[0112]

[0113] Note that for all j∈[B], except for In all coordinates except the corresponding coordinates, ΔΛ is equal to Λ * -Λ, and the magnitude of the gradient in these coordinates is at most τ 2 . Therefore, based on the fact that each coordinate of Λ lies between 0 and the corresponding coordinate of Λ*, Next, by the convexity of G, Putting all the boundaries together and doing some algebra:

[0114]

[0115] Here, the bound ||ΔΛ|| can be obtained using the fact that each coordinate of Λ lies between 0 and the corresponding coordinate of Λ*. 2 ≤||Λ * || 2 By using , a simple induction on t implies the required bound on G(Λ)-G(Λ*). Therefore, to ensure that the suboptimal gap is at most ε, for of step, it is sufficient to run the greedy process.

[0116] While this theorem provides a proof that the algorithm converges to any desired error level, the bounds it provides are rather weak. In practice, running just one step of the loop is sufficient to improve the performance of methods based on direct search. If, in addition to being smooth, the loss function is also strongly convex (e.g., this can be achieved by adding some Regularization is used to achieve this), then the convergence of the gradient can also be shown. This is because for strongly convex functions, the convergence of the gradient can be defined according to the convergence of the loss value.

[0117] Cost Analysis. The exact gradient evaluation for a single example can be computed in O(DK) time. The cost of directly applying the search-based gradient approximation (Algorithm 1) is O(DQD (K)), where Q D (K) is the number of classes to be searched in the MIPS data structure in order to find all classes with significant gradients. The query cost Q D (K) has a strong dependence on dimension D. The exact MIPS has a cost Q exponential in D D (K). For approximate search methods such as Locality Sensitive Hashing (LSH), the cost Q D (K) usually depends only implicitly on the dimensionality. The method in Algorithm 2 partitions D into B subproblems of dimension D / B, where the cost of each message passing iteration is O(DQ D / B (K)+DB|A|), where A is the set calculated in step 4 of Algorithm 2. Note that Q D / B (K) decreases rapidly (exponentially in the exact case) as B, and therefore, one can choose B so that Q D / B (K)< D (K) and balance the two terms stO(DQ D / B (K)+DB|A|)< <DK。

[0118] 3. Practical considerations

[0119] MIPS query. In practice, when using the MIPS data structure, instead of retrieving the 1 For all categories with the same score, it is more efficient to retrieve the top Q categories with the highest scores. In some embodiments, spherical clustering can be used as the MIPS data structure, where the number of clusters C is selected such that K / C≤Q and C≤Q. Note that this requires to cause Similarly, to calculate the active set A in step 4 of Algorithm 2, an appropriate threshold τ can be calculated by using the properties of the loss function 2 In the case of the boundary-based losses (3) and (7) and their smoothed versions (10), the gradients are sparse, so τ can be 2 Set to 0 or some very small value. Loss functions (such as (2), (6)) usually have exponentially decaying gradient magnitudes on non-confused negative classes. For these losses, it is possible to use a partitioning function Z = ∑ k exp(z k ) to retrieve categories in descending order of gradient magnitude in order to decide whether more categories need to be retrieved.

[0120] Update of data structure. During training, the model parameters used to determine f will change, and the data structure T needs to be updated j ​These data structures store the rows of W and treat φ(x) as a query. For loss functions with sparse gradients, such as (3), (7), and their smoothed versions (10), the number of updated rows k of W is r is much smaller than K and Q (the number of categories retrieved for the query). Therefore, the cost of reindexing the rows of W is k r C(D / B)B=k r CD (where C is the number of inner products required to index each row) is much smaller than the cost of queries and updates. r ≈Q), the method is effective for larger mini-batch size N b is still efficient. The query and update costs increase with N b As it grows, the number of rows to be reindexed is bounded by K, and the cost of maintaining the data structure becomes insignificant.

[0121] Sampling for initialization. For a randomly initialized model, the early iterations of learning have gradients that are uniformly distributed across classes since the scores of all classes are close to each other. Therefore, there is no need to search for candidates with significant gradient magnitudes in the early stages. In practice, one can switch from sampling-based gradient approximation to search-based gradient approximation after several mini-batch updates.

[0122] The systems and methods described herein provide many technical effects and benefits. Systems and methods for implementing the technology of reducing high-dimensional search problems to several lower-dimensional search problems can have the technical effect of improving efficiency by reducing the computational cost associated with high-dimensional search problems. For example, high-dimensional search problems can be solved by one or more processors in fewer cycles with smaller memory requirements, and / or lower-dimensional search problems can be distributed on several processors and solved in parallel, thereby reducing the computational time associated with high-dimensional search problems. The recently developed method of using efficient data structures for nearest neighbor search (NNS) or maximum inner product search (MIPS) speeds up learning, but the performance of such data structures degrades in high dimensions. The technology disclosed in the present invention improves the accuracy of search-based gradient approximation methods and outperforms sampling-based gradient approximation methods.

[0123] In addition, the system and method for implementing the greedy message passing technique can have the technical effect of ensuring that the approximate loss converges to the original loss. The technique can enable the variables to be decoupled into lower dimensional blocks that can be optimized accordingly, and greedy descent is iteratively performed towards the optimal solution.

[0124] The systems and methods of the present disclosure also provide improvements to computing techniques, such as data matching and retrieval computing techniques. For example, the systems and methods herein enable efficient evaluation of the loss or the gradient of the loss.

[0125] Example Embodiments

[0126] Referring now to the drawings, example embodiments of the present disclosure will be discussed in further detail.

[0127] Figure 1 A block diagram of an example computing system 100 that can evaluate a loss function and / or a gradient of a loss function according to an example embodiment of the present disclosure is depicted. System 100 includes a user computing device 102, a server computing system 130, and a training computing system 150 that are communicatively coupled via a network 180.

[0128] The user computing device 102 may be any type of computing device, such as, for example, a personal computing device (e.g., a laptop or desktop computer), a mobile computing device (e.g., a smartphone or tablet), a gaming console or controller, a wearable computing device, an embedded computing device, or any other type of computing device.

[0129] The user computing device 102 includes one or more processors 112 and memory 114. The one or more processors 112 may be any suitable processing device (e.g., a processor core, a microprocessor, an ASIC, an FPGA, a controller, a microcontroller, etc.), and may be one processor or a plurality of processors operably connected. The memory 114 may include one or more non-transitory computer-readable storage media, such as RAM, ROM, EEPROM, EPROM, flash memory devices, magnetic disks, etc., and combinations thereof. The memory 114 may store data 116 and instructions 118 that, when executed by the processor 112, cause the user computing device 102 to perform operations.

[0130] In some implementations, the user computing device 102 may store or include one or more machine learning models 120. For example, the machine learning model 120 may be or may additionally include various machine learning models, such as a neural network (e.g., a deep neural network) or other types of machine learning models, including nonlinear models and / or linear models. The neural network may include a feedforward neural network, a recursive neural network (e.g., a long short-term memory recursive neural network), a convolutional neural network, or other forms of neural networks.

[0131] More specifically, the machine learning model 120 can be associated with a large output space, such as, for example, an extreme multi-class or multi-label classification problem with many classes, language modeling with a large vocabulary, and / or metric learning with a large number of pairwise distance constraints. In some embodiments, the machine learning model 120 can be associated with a class F of scoring functions such that for each f∈F, there is an embedding dimension parameter The associated weight matrix and feature map So that for all x∈X, f(x)=Wφ(x).

[0132] Additionally or alternatively, one or more machine learning models 140 may be included in or otherwise stored and implemented by a server computing system 130 that communicates with the user computing device 102 according to a client-server relationship. For example, the machine learning model 140 may be implemented by the server computing system 140 as part of a web service (e.g., an extreme multi-class or multi-label classification service, a language modeling service, a metric learning service, etc.). Thus, one or more models 120 may be stored and implemented at the user computing device 102, and / or one or more models 140 may be stored and implemented at the server computing system 130.

[0133] The user computing device 102 may also include one or more user input components 122 for receiving user input. For example, the user input component 122 may be a touch-sensitive component (e.g., a touch-sensitive display or touchpad) that is sensitive to the touch of a user input object (e.g., a finger or a stylus). The touch-sensitive component may be used to implement a virtual keyboard. Other example user input components include a microphone, a traditional keyboard, or other means by which a user may provide user input.

[0134] The server computing system 130 includes one or more processors 132 and memory 134. The one or more processors 132 may be any suitable processing device (e.g., a processor core, a microprocessor, an ASIC, an FPGA, a controller, a microcontroller, etc.), and may be one processor or a plurality of processors operably connected. The memory 134 may include one or more non-transitory computer-readable storage media, such as RAM, ROM, EEPROM, EPROM, flash memory devices, magnetic disks, etc., and combinations thereof. The memory 134 may store data 136 and instructions 138 that, when executed by the processor 132, cause the server computing system 130 to perform operations.

[0135] In some implementations, server computing system 130 includes or is otherwise implemented by one or more server computing devices. Where server computing system 130 includes multiple server computing devices, such server computing devices may operate according to a sequential computing architecture, a parallel computing architecture, or some combination thereof.

[0136] As described above, the server computing system 130 may store or otherwise include one or more machine-learned recursive super-resolution models 140. For example, the model 140 may be or may otherwise include various machine-learned models. Example machine-learning models include neural networks or other multi-layer nonlinear models. Example neural networks include feedforward neural networks, deep neural networks, recursive neural networks, and convolutional neural networks. Figure 2 An example model 140 is discussed through FIG. 7 .

[0137] User computing device 102 and / or server computing system 130 may train models 120 and / or 140 via interaction with training computing system 150 communicatively coupled via network 180. Training computing system 150 may be separate from server computing system 130 or may be part of server computing system 130.

[0138] The training computing system 150 includes one or more processors 152 and memory 154. The one or more processors 152 can be any suitable processing device (e.g., a processor core, a microprocessor, an ASIC, an FPGA, a controller, a microcontroller, etc.), and can be one processor or multiple processors that are operably connected. The memory 154 can include one or more non-transitory computer-readable storage media, such as RAM, ROM, EEPROM, EPROM, flash memory devices, disks, etc. and combinations thereof. The memory 154 can store data 156 and instructions 158 that, when executed by the processor 152, cause the training computing system 150 to perform operations. In some embodiments, the training computing system 150 includes or is otherwise implemented by one or more server computing devices.

[0139] The training computing system 150 may include a model trainer 160 that trains the machine learning models 120 and / or 140 stored at the user computing device 102 and / or the server computing system 130 by using various training or learning techniques, such as, for example, evaluating the loss function and / or the gradient of the loss function associated with the machine learning model 120 and / or 140, and back propagation of errors. In some embodiments, performing back propagation of errors may include performing truncated back propagation through time. The model trainer 160 may perform a number of inductive techniques (e.g., weight decay, information dropout, etc.) to improve the inductive ability of the trained model.

[0140] More specifically, the model trainer 160 may apply a dual decomposition to a convex conjugate representation of the loss function. In addition to applying a search data structure (e.g., a MIPS data structure) to the learning problem, the machine trainer 160 may also apply a dual decomposition. The model trainer 160 may replace a high-dimensional search problem with several lower-dimensional searches by decoupling the dimensions via a dual decomposition. The model trainer 160 may couple different lower-dimensional searches via greedy message passing, which may guarantee convergence to obtain a good approximation to the loss and its gradient.

[0141] In some embodiments, the model trainer 160 may partition a weight matrix corresponding to a scoring function associated with the machine learning model 120 and / or 140. The model trainer 160 may partition the weight matrix into a plurality of blocks and store the plurality of blocks in a plurality of corresponding MIPS data structures. For example, the model trainer 160 may store a row of each of the plurality of blocks in a MIPS data structure corresponding to the block. The model trainer 160 may query each of the plurality of MIPS data structures with a first threshold to identify a first set of labels associated with a score greater than the first threshold. The model trainer 160 may construct a sparse approximation of a scoring vector for each of the plurality of blocks based at least in part on the first set of labels, determining a correction value for each sparse approximation. The model trainer 160 may iteratively optimize the decomposed loss function by updating the correction values ​​of at least some of the first set of labels. After optimizing the decomposed loss function, the model trainer 160 can evaluate the decomposed loss function or the gradient of the decomposed loss function based at least in part on the sparse approximation of the score vector for each of the plurality of blocks and the correction value associated with the sparse approximation of the score vector. In this way, the model trainer 160 can determine an approximation of the loss associated with the score function or the gradient of the loss.

[0142] Model trainer 160 can train machine learning models 120 and / or 140 based on training data set 162. Training data 162 can include, for example, The labeled sample pairs (x, P) of , where X represents the input space, Y represents the output space, and P represents the correct label set of the input point x.

[0143] In some implementations, if the user has provided consent, the training examples may be provided by the user computing device 102. Thus, in such implementations, the model 120 provided to the user computing device 102 may be trained by training the computing system 150 based on user-specific data received from the user computing device 102. In some cases, this process may be referred to as personalizing the model.

[0144] The model trainer 160 includes computer logic for providing the desired functionality. The model trainer 160 can be implemented in hardware, firmware, and / or software that controls a general purpose processor. For example, in some embodiments, the model trainer 160 includes a program file stored on a storage device, loaded into a memory, and executed by one or more processors. In other embodiments, the model trainer 160 includes one or more computer executable instruction sets stored in a tangible computer readable storage medium such as a RAM hard disk or an optical or magnetic medium.

[0145] The network 180 may be any type of communication network, such as a local area network (e.g., an intranet), a wide area network (e.g., the Internet), or some combination thereof, and may include any number of wired links or wireless links. In general, communications through the network 180 may be performed via any type of wired connection and / or wireless connection using a variety of communication protocols (e.g., TCP / IP, HTTP, SMTP, FTP), encodings or formats (e.g., HTML, XML), and / or protection schemes (e.g., VPN, secure HTTP, SSL).

[0146] Figure 1 An example computing system that can be used to implement the present disclosure is illustrated. Other computing systems may also be used. For example, in some embodiments, the user computing device 102 may include a model trainer 160 and a training data set 162. In such embodiments, the model 120 may be both trained and used locally at the user computing device 102. In some such embodiments, the user computing device 102 may implement the model trainer 160 to personalize the model 120 based on user-specific data.

[0147] Figure 2 A plot depicting multi-class classification results on the Megaface dataset according to some embodiments of the present disclosure.

[0148] Figure 3A plot depicting multi-label classification results on the WikiLSHTC dataset according to some embodiments of the present disclosure.

[0149] Figure 4 A plot depicting results on word embeddings with a skip meta-grammar objective according to some embodiments of the present disclosure.

[0150] therefore, Figures 2 to 4 Depicted are plots illustrating comparisons of different loss functions and gradient estimation methods according to example embodiments of the present disclosure. Specifically, Figure 2 Corresponding to a multi-class classification problem (e.g., face recognition) and depicting plots illustrating multi-class classification results on the MegaFace dataset: test accuracy versus training time (left), training accuracy versus training time (middle), and training accuracy versus number of epochs (right), where the x-axis is in logarithmic scale. Figure 3 Corresponding to multi-label classification problems (e.g., document tagging) and depicting plots illustrating multi-label classification results on the WikiLSHTC dataset: test accuracy versus training time (left), training accuracy versus training time (middle), and training accuracy versus number of epochs (right), where the x-axis is in logarithmic scale. Figure 4 Corresponding to the unsupervised word embedding problem, we depict the results on word embedding with the skip meta-grammar objective (9), where GD-Exact, GD-MIPS, and GD-Decomp-MIPS are initialized with models trained with one epoch of Word2vec-Neg.

[0151] about Figure 2 and Figure 3 , using the stochastic gradient descent (SGD) optimization algorithm, where the initial step size is selected from {1, 0.1, 0.01} to achieve the best performance for each method, and a 1 / (1+t) cooling scheme, where t is the iteration counter. The mini-batch size is 10, and all methods are processed in parallel with 10 CPU cores in a shared memory architecture running on a dedicated computer. All implementations are in C++. The following loss functions and gradient evaluation methods are compared:

[0152] Softmax: The exact gradient evaluation of the cross entropy loss (2), where for Figure 2 In the multi-class, |P|=1, and for Figure 3 Multi-label in |P|< <K;

[0153] Sampled-Softmax: A sampling strategy that includes all positive classes of the instance and uniformly subsamples from the remaining negative classes with a sample size of K / 100;

[0154] Margin: The exact gradient evaluation of the smoothed maximum margin loss (10), where Figure 2 In the multi-class, μ = 1, and for Figure 3 The multi-label in , μ = 5. The double simplex projection (11) is computed using O(Klog(K)). For this loss, gradient updates are faster than cross entropy updates because the loss gradients are very sparse, making the backward pass faster;

[0155] MIPS: Search-based gradient evaluation of the smoothed maximum margin loss (10) (e.g., Algorithm 1), where for Figure 2 In the multi-class, μ = 1, and for Figure 3 Multi-label in , μ = 5. Spherical clusters with 100 centroids are used as the MIPS data structure with batch queries of size K / 100; and

[0156] Decomp-MIPS: Gradient evaluation via decomposition search (e.g., Algorithm 2, T=1 iterations). Figure 2 The inner product is divided into B = 8 factors, and for Figure 3 Multi-label in , B = 4. Spherical clusters with 100 centroids are used as the MIPS data structure with batch queries of size K / 100.

[0157] for Figure 2 ,Multi-class classification experiments are conducted on the largest publicly available face recognition dataset, MegaFace, where each identity is considered as a class and each sample is an image cropped by a face detector. The MegaFace dataset statistics are shown in Table 1. The FaceNet architecture is pre-trained on the MS-Celeb-1M dataset, and the last layer of the FaceNet architecture is fine-tuned on the MegaFace dataset. The input to the last layer is an embedding of size 128, which is partitioned into B=8 factors, each of dimension 16, in the Decomp-MIPS method.

[0158] #identity #image Embedding Dimension 672K 4.7M 128

[0159] Table 1: Statistics of the MegaFace dataset

[0160] Figure 2 The comparison method in takes more than one day to run, and Figure 2The results are shown in . A comparison of the methods (Decomp-MIPS, MIPS, and Margin) for optimizing the (smoothed) maximum boundary loss shows that both Decomp-MIPS and MIPS can speed up iterations by 1 to 2 orders of magnitude. However, MIPS converges with much lower accuracy than Decomp-MIPS, and the gap becomes larger when more iterations are run. Note that time and epochs are on a logarithmic scale. In addition, Softmax has much slower progress than Margin. After one day, neither Softmax nor Margin completed an epoch (4.7M samples). Margin's progress is much better, probably because it focuses on confusing identities. In addition, Sampled-Softmax has much faster iterations than the MIPS-based approach, but the progress of each iteration is smaller, resulting in slower overall progress.

[0161] for Figure 3 , multi-label classification experiments are conducted on WikiLSHTC (a benchmark dataset in the extreme classification repository), where each category is a directory tag in Wikipedia and each sample is a document with a bag-of-words representation. WikiLSHTC data statistics are shown in Table 2. On average, each sample has 3.19 positive labels, and each category appears as a positive category in 17.46 samples. A single hidden layer fully connected feedforward network is trained for multi-label classification tasks. The first layer has an input dimension equal to the vocabulary size (1.6M) and an output of dimension 100. The second layer has an output size equal to the number of categories (325K) and approximations of different loss functions and different comparison methods. The training results also produce document and word embeddings as by-products. For Decomp-MIPS, the input of the last layer is divided into B=4 factors, each with a dimension of 25.

[0162] Figure 3 The comparison method in takes more than one day to run, and Figure 3The results are shown in . As shown, Softmax has very good progress per iteration, significantly exceeding the progress of the other three schemes (Margin, MIPS, Decomp-MIPS) based on the maximum margin loss of smoothness. However, the iteration of Softmax is much slower than the other iterations, because it has dense loss gradients and therefore has a slower back propagation, so that when comparing training time, Softmax performs similarly to Margin. On the other hand, when Margin, Decomp-MIPS and MIPS are compared in terms of progress per period, the update of Decomp-MIPS almost achieves the same progress as the exact gradient calculation of Margin, while the training accuracy of MIPS is significantly reduced compared to Margin and Decomp-MIPS, because it runs more iterations. Overall, the MIPS-based method leads to an order of magnitude acceleration, while Decomp-MIPS retains the accuracy of the exact method. On the other hand, although Sampled-Softmax's iteration is faster, it has extremely slow progress per iteration, and even after one day, Sampled-Softmax cannot reach accuracy comparable to other methods.

[0163] #Label #sample Embedding Dimension Vocabulary size 325K 1.8M 100 1.6M

[0164] Table 2: Statistics of the WikiLSHTC dataset

[0165] about Figure 4 The gradient approximation method of the present invention is evaluated on the word embedding task with a skip meta-grammar learning objective (9) and compared with two widely used gradient approximation methods: Hierarchical Softmax (Word2vec-HS) and Negative Sampling (Word2vec-Neg) implemented in the word2vec package. The sample size for Word2vec-Neg is selected from {5, 10, 15, 20, 25}.

[0166] We use a benchmark dataset BillonW consisting of a vocabulary size of nearly half a million words. The data statistics are provided in Table 3. A window size of 8 is used, and common words in the corpus are subsampled. Each word w is represented by a probability Decline, where f w is the relative frequency of the word in the corpus, and t=10 -4 is the threshold parameter.

[0167] Vocabulary size #word Embedding Dimension Window size ≈451K ≈680M 100 8

[0168] Table 3: Statistics of the BillionW dataset

[0169] Note that the skip meta-grammar objective (9) is presented in a collapsed form. Here, all entries of the same input-output pair are grouped together and weighted by frequency. By applying the empirical input-output distribution q in (9) x ,q y|x Then, alternatively, for the input word {φ(x)} x∈X and the output word {φ(y)} y∈X Gradient descent (GD) updates are performed on the parameters of . GD, GD-MIPS, and GD-Decomp-MIPS are used to represent algorithms with different loss approximation strategies. Since in early iterations, the model has fairly evenly distributed gradients for candidates, GD, GD-MIPS, and GD-Decomp-MIPS are initialized using 1 epoch of Word2vec-Neg. For this task, there are many more negative categories with significant gradient magnitudes than in multi-label and multi-class experiments. For the MIPS architecture, batch queries of size K / 20 are used instead of K / 100.

[0170] Figure 4 The comparison method in is processed in parallel with 24 CPU cores, and Figure 4 The results are shown in . After the first epoch, the method based on alternating gradient descent (GD) with the folding objective (9) has faster convergence per epoch, and the iterations of GD-Deomp-MIPS are 5 times faster than those of GD, while having significantly better objective values ​​than GD-MIPS within the same training time.

[0171] Figure 5 A diagram of a method 500 for evaluating a loss function or a gradient of a loss function is depicted. In (502), the method 500 includes: partitioning a weight matrix into blocks. For example, the training computing system 150 may partition a weight matrix corresponding to a scoring function. The training computing system 150 may partition the weight matrix into a plurality of blocks. Each of the plurality of blocks may include one or more columns of the weight matrix.

[0172] At (504), method 500 includes: identifying a first set of labels for each block. For example, training computing system 150 may identify a first set of labels for each of the plurality of blocks. The first set of labels may be associated with a score greater than a first threshold. Training computing system 150 may query each of a plurality of maximum inner product search data structures correspondingly associated with the plurality of blocks of the weight matrix. Specifically, training computing system 150 may obtain a feature map corresponding to a weight matrix and a scoring function; segment the feature map into a plurality of blocks corresponding to the plurality of blocks of the weight matrix; and query each of a plurality of maximum inner product search data structures correspondingly associated with the plurality of blocks of the weight matrix, wherein an output of the segmented feature map corresponds to a block of the weight matrix and a first threshold.

[0173] At (506), method 500 includes: constructing a sparse approximation of the score vector for each block. For example, training computing system 150 may construct a sparse approximation of the score vector for each of the plurality of blocks based at least in part on the first set of labels. Training computing system 150 may set, for each of the plurality of blocks, a corresponding approximation score for each of the plurality of labels that is neither included in the first set of labels for the block nor in the positive labels that are equal to zero; and set, for each of the plurality of blocks, a corresponding approximation score for each of the plurality of labels that is neither included in the first set of labels for the block nor in the positive labels that are equal to the true score determined according to the maximum inner search product search query.

[0174] At (508), method 500 includes determining a correction value for each score vector. For example, training computing system 150 determines a correction value for each sparse approximation of a score vector for each of the plurality of blocks. Specifically, training computing system 150 may identify a second set of labels based at least in part on a first set of labels for each of the plurality of blocks, the second set of labels being associated with a gradient greater than a second threshold. Training computing system 150 may determine an average approximation score for each label in the second set of labels across the plurality of blocks. Training computing system 150 may determine an approximation score for each label in the second set of labels for each of the plurality of blocks. Training computing system 150 may determine a difference between an average approximation score and an approximation score for each of the plurality of blocks for each combination of a label in the second set of labels and a block in the plurality of blocks. Training computing system 150 may update the correction value for each sparse approximation of a score vector for each of the plurality of blocks based at least in part on the determined difference for each combination of a label in the second set of labels and a block in the plurality of blocks.

[0175] At (510), method 500 includes approximating a loss or a gradient of the loss. For example, the training computing system 150 may determine an approximation of the loss or the gradient of the loss associated with the scoring function by evaluating the decomposed loss function or the gradient of the decomposed loss function based at least in part on a sparse approximation of the scoring vector for each of the plurality of blocks and a correction value associated with the sparse approximation of the scoring vector. The decomposed loss function may include a plurality of parts, each part corresponding to a loss associated with a respective sparse approximation of the scoring vector for each of the plurality of blocks.

[0176] The training computing system 105 may perform a smoothing technique on the loss function to construct a surrogate loss function having a continuous gradient; and determine a decomposed loss function based at least in part on the surrogate loss function.

[0177] Training computing system 150 may minimize, across multiple blocks, the average of each block's respective losses evaluated by such block's respective approximate score vector plus each block's correction value vector such that the sum of the correction value vectors across the multiple blocks equals zero.

[0178] Training computing system 150 may determine an approximation of the loss or a gradient of the loss for each of a plurality of training examples.

[0179] The training computing system 150 may modify one or more parameters of a weight matrix or a scoring function based at least in part on the determined approximation of a loss associated with the scoring function or a gradient of the loss.

[0180] Method 500 can be used when training a classifier. The classifier can be used in extreme multi-class or multi-label classification problems. The classifier can provide classification of any suitable data items, and can be used, for example, to classify or discover audio clips, images, or videos based on an input sequence that can represent one or more images or videos. The data items can be data representing still images or moving images, in which case the individual numerical values ​​contained in the data items can represent pixel values, such as the values ​​of one or more color channels of a pixel. The training images used to train the model can be real-world images captured by a camera.

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

[0182] The techniques discussed herein refer to servers, databases, software applications, and other computer-based systems and the actions taken and the information sent to and from such systems. The inherent flexibility of computer-based systems allows for multiple possible configurations, combinations, and divisions of tasks and functionality between and among components. For example, the processes discussed herein can be implemented using a single device or component or multiple devices or components working in combination. Databases and applications can be implemented on a single system or distributed on multiple systems. Distributed components can run sequentially or in parallel.

[0183] Although the subject matter has been described in detail with respect to various specific example embodiments of the subject matter, each example is provided by way of illustration rather than limitation of the present disclosure. Those skilled in the art can easily produce changes, modifications and equivalents to such embodiments after obtaining an understanding of the foregoing. Therefore, the subject matter disclosure does not exclude such modifications, modifications and / or additions of the subject matter as will be readily apparent to those of ordinary skill in the art. For example, a feature illustrated or described as part of one embodiment can be used together with another embodiment to produce yet another embodiment. Therefore, the present disclosure is intended to cover such changes, modifications and equivalents.

Claims

1. A computer-implemented method for evaluating a loss function or a gradient of the loss function, the method comprising: Splitting a weight matrix into a plurality of blocks by a computing system including one or more computing devices, the weight matrix corresponding to the scoring function; identifying, by the computing system, a first set of tags for each of the plurality of chunks, the first set of tags being associated with a score greater than a first threshold; constructing, by the computing system, a sparse approximation of a score vector for each of the plurality of chunks based at least in part on the first set of labels; determining, by the computing system, a correction value for each sparse approximation of the score vector for each of the plurality of blocks; as well as Determining, by the computing system, a loss associated with the scoring function or an approximation of a gradient of the loss by evaluating the decomposed loss function or a gradient of the decomposed loss function based at least in part on the sparse approximation of the scoring vector for each of the plurality of blocks and the correction value associated with the sparse approximation of the scoring vector.

2. The computer-implemented method of claim 1 , further comprising: An approximation of the loss or a gradient of the loss is determined, by the computing system, for each of a plurality of training examples.

3. The computer-implemented method of claim 1 , further comprising: The weight matrix or one or more parameters of the scoring function are modified, by the computing system, based at least in part on the determined approximation of the loss or the gradient of the loss associated with the scoring function.

4. The computer-implemented method of claim 1 , wherein: Identifying the first set of tags for each of the plurality of blocks includes: Each of a plurality of maximum inner product search data structures respectively associated with the plurality of blocks of the weight matrix is ​​queried, by the computing system.

5. The computer-implemented method of claim 1 , wherein: Constructing the sparse approximation of the score vector for each of the plurality of blocks comprises: A respective proximity score for each of the plurality of labels is set, by the computing system, for each of the plurality of blocks, each of the plurality of labels being neither included in the first set of labels for the block nor in the positive labels equal to zero.

6. The computer-implemented method of claim 1, wherein: Constructing the sparse approximation of the score vector for each of the plurality of blocks comprises: By means of the computing system, a corresponding approximation score for each of the plurality of tags is set for each of the plurality of blocks, wherein each of the plurality of tags is neither included in the first tag set for the block nor in a positive tag, wherein the positive tag is equal to a true score determined according to a maximum inner search product search query.

7. The computer-implemented method of claim 1 , wherein: Determining the correction value for each sparse approximation of the score vector for each of the plurality of blocks comprises: identifying, by the computing system, a second set of labels based at least in part on the first set of labels for each of the plurality of blocks, the second set of labels being associated with gradients greater than a second threshold; determining, by the computing system, an average proximity score for each tag in the second set of tags across the plurality of blocks; determining, by the computing system, a similarity score for each label in the second set of labels for each of the plurality of blocks; determining, by the computing system, for each combination of a tag in the second tag set and a block in the plurality of blocks, a difference between the average proximity score and the proximity score for each block in the plurality of blocks; and The correction value of each sparse approximation of the score vector for each of the plurality of blocks is updated, by the computing system, based at least in part on a difference determined for each combination of a label in the second label set and a block in the plurality of blocks.

8. The computer-implemented method of claim 1, wherein: Determining the loss associated with the scoring function or an approximation of the gradient of the loss includes: Minimizing, by the computing system, across the plurality of blocks, an average of a respective loss for each block evaluated at the block's respective approximation score vector plus a correction value vector for each block such that a sum of the correction value vectors across the plurality of blocks equals zero.

9. The computer-implemented method of claim 1, wherein: The decomposed loss function includes a plurality of parts, each part corresponding to a loss associated with a respective sparse approximation of the score vector for each of the plurality of blocks.

10. The computer-implemented method of claim 1 , further comprising: performing, by the computing system, a smoothing technique on the loss function to construct a surrogate loss function having a continuous gradient; as well as The decomposed loss function is determined, by the computing system, based at least in part on the surrogate loss function.

11. The computer-implemented method of any one of claims 1 to 10, wherein: Each of the plurality of blocks includes one or more columns of the weight matrix.

12. The computer-implemented method of claim 4, wherein: Querying each of the plurality of maximum inner product search data structures respectively associated with the plurality of blocks of the weight matrix comprises: Obtaining, by means of the computing system, a feature map corresponding to the weight matrix and the scoring function; Splitting, by the computing system, the feature map into a plurality of blocks corresponding to the plurality of blocks of the weight matrix; and Each of the plurality of maximum inner product search data structures correspondingly associated with the plurality of blocks of the weight matrix is ​​queried, by the computing system, wherein the output of the segmented feature map corresponds to the block of the weight matrix and the first threshold.

13. A computing system comprising: one or more processors; as well as One or more non-transitory computer-readable media storing instructions that, when executed by the one or more processors, cause the computing system to perform operations comprising: identifying a first subset of the plurality of labels for each of the plurality of blocks of the weight matrix, wherein each label in the first subset has a score greater than a first threshold; constructing, for each of the plurality of chunks, a sparse approximation of a score vector for the chunk based at least in part on the first subset of the plurality of labels identified for the chunk; determining correction values ​​for at least some of the plurality of labels, wherein the correction values ​​are updated at each of one or more iterations to iteratively optimize a decomposed loss function; and After iteratively optimizing the decomposed loss function, an evaluation of the decomposed loss function or a gradient of the decomposed loss function is determined.

14. The computing system of claim 13, the operations further comprising: The operations of identifying, constructing, iteratively optimizing, and returning are performed for each of a plurality of training examples.

15. The computing system of claim 13, the operations further comprising: Based at least in part on the evaluation of the decomposed loss function or the gradient of the decomposed loss function, modifying one or more parameters of the weight matrix or a machine learning scoring model approximated by the weight matrix.

16. The computing system of claim 13, wherein identifying the first subset of the plurality of labels for each of the plurality of blocks of the weight matrix comprises: Each of a plurality of maximum inner product search data structures respectively associated with the plurality of blocks of the weight matrix is ​​queried.

17. The computing system of claim 13, wherein: Constructing the sparse approximation of the score vector for each of the plurality of blocks comprises: A respective proximity score is set for each of the plurality of labels for each of the plurality of labels, wherein each of the plurality of labels is neither included in the first subset of the block nor included in the positive labels equal to zero.

18. The computing system of claim 13, wherein: Constructing the sparse approximation of the score vector for each of the plurality of blocks comprises: A respective approximation score is set for each of the plurality of tags for each of the plurality of tags, wherein each of the plurality of tags is neither included in the first subset of the block nor in a positive tag having a true score equal to that determined according to a maximum inner search product search query.

19. The computing system of any one of claims 13 to 18, wherein: Iteratively optimizing the decomposed loss function includes: For each of the one or more iterations: identifying a second subset of the plurality of tags, the second subset having corresponding subgradients greater than a second threshold; for each combination of label and block included in the second subset, determining a difference between an average of the proximity scores for the label across the plurality of blocks and the proximity score for the label for the block; and Based at least in part on a difference between the approximation score for the label across the plurality of labels and the approximation score for the label for the label, for each combination of label and label included in the second subset, a respective correction value for the combination of label and label is updated.

20. The computing system of any one of claims 13 to 18, wherein: Iteratively optimizing the decomposed loss function includes: Across the plurality of blocks, an average of a respective loss for each block evaluated at the block's respective approximation score vector plus a correction value vector for each block is minimized such that a sum of the correction value vectors across the plurality of blocks equals zero.

21. A computing system, the computing system comprising: one or more processors; as well as One or more non-transitory computer-readable media storing instructions which, when executed by one or more processors, cause the computing system to perform the method of any one of claims 1 to 12.

22. A computer-implemented method for training a classifier, the method comprising: The classifier is trained using the decomposed loss function or the gradient of the decomposed loss function obtained from the method according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • L21 norm based method for improving convolutional neural network generalization capability

    CN105160400A

  • Accelerated proximal gradient PCA-based time sequence score abnormal value detection method

    CN106250917A

  • Systems and methods for large-scale randomized optimization for problems with decomposable loss functions

    US20120331025A1