Why algorithm analysis?
The analysis algorithm can provide the performance of the pre-Attention algorithm, which is better than that of the embedding algorithm, ensure the correctness of the algorithm, and understand the theoretical basis of the algorithm.
Example of successful Algorithms
Discrete Fourier transformation. If the brute force method is used, the complexity of the algorithm is n ^ 2. If FFT is used, the complexity of O (n logn) can be realized.
N-body simulation: the complexity can be reduced to n logn using the Barnes-hut algorithm.
By the way, we will send a dazzling figure of N-body simulation.
Barnes-hut Algorithm
Algorithm Analysis Steps
Observe the characteristics of the problem and the expected results
Based on the observed results, if
Use cases that may occur if pre-commit is used
Check whether the pre-Attention result is consistent with the observed features.
Verify it repeatedly until it is consistent with the observed feature
Algorithm analysis principles