ZHANGYUXUAN-zR commited on
Commit
4fc23df
·
verified ·
1 Parent(s): 46536f7

Add files using upload-large-folder tool

Browse files
md/dev/G2Q2Mh3avow/G2Q2Mh3avow.md CHANGED
@@ -94,7 +94,7 @@ Tab. 3: On generating contextual image captions and descriptions (CIDEr) from Co
94
 
95
  Method. We also address video-to-text retrieval, a common video understanding task, by using both audio and visual data. We improve on a prior approach (Portillo-Quintero et al., 2021) which computes a CLIP-based video-and-text similarity measure for one-to-many nearest neighbor matching. Adding in audio information, our system transcribes audio with speech-to-text ALMs (Bapna et al., 2022) for automatic speech recognition (ASR e.g., via Google Cloud speech-to-text API (gcl)), then summarizes the transcripts with an LLM using the following prompt:
96
 
97
- We compute similarity scores of the generated summary to the set of captions with a masked LLM (e.g., with sentence similarity from RoBERTa (Liu et al., 2019b)), and use those scores to re-weight the CLIP-based ranking from Portillo-Quintero et al. (2021). For videos with sufficientlylong transcripts ${ \geq } 1 4 5$ characters), the matching score is: CLIP (caption) · CLIP (video0) $\times$ RoBERTa (caption) · RoBERTa (GPT-3(prompt, Speech2Text (audio0))), where $\cdot$ represents normalized dot product of embeddings, and $\times$ represents scalar multiplication. If there is no audio or the transcript is too short, we default to Portillo-Quintero et al. i.e., the dot product of CLIP text embeddings and averaged CLIP image embeddings of all video frames $C L I P ( \mathrm { c a p t i o n } ) \cdot C L I P ( \mathrm { v i d e o } ^ { \prime } )$ .
98
 
99
  Results. We evaluate on MSR-VTT (Xu et al., 2016), noted in other recent works (Gao et al., 2021; Cheng et al., 2021) as a popular benchmark for video-to-text retrieval. We compare our method with zero-shot methods, as well as finetuned methods specifically trained on MSR-VTT. Results show that our method outperforms zero-shot state-of-the-art (Tab.4). Since our system uses Portillo-Quintero et al. (2021) to process CLIP features but additionally incorporates LLM reasoning on speech-to-text transcripts,
100
 
 
94
 
95
  Method. We also address video-to-text retrieval, a common video understanding task, by using both audio and visual data. We improve on a prior approach (Portillo-Quintero et al., 2021) which computes a CLIP-based video-and-text similarity measure for one-to-many nearest neighbor matching. Adding in audio information, our system transcribes audio with speech-to-text ALMs (Bapna et al., 2022) for automatic speech recognition (ASR e.g., via Google Cloud speech-to-text API (gcl)), then summarizes the transcripts with an LLM using the following prompt:
96
 
97
+ We compute similarity scores of the generated summary to the set of captions with a masked LLM (e.g., with sentence similarity from RoBERTa (Liu et al., 2019b)), and use those scores to re-weight the CLIP-based ranking from Portillo-Quintero et al. (2021). For videos with sufficientlylong transcripts ${ \geq } 1 4 5$ characters), the matching score is: CLIP (caption) · CLIP (video0) $\times$ RoBERTa (caption) · RoBERTa (GPT-3(prompt, Speech2Text (audio0))), where $\cdot$ represents normalized dot product of embeddings, and $\times$ represents scalar multiplication. If there is no audio or the transcript is too short, we default to Portillo-Quintero et al. i.e., the dot product of CLIP text embeddings and averaged CLIP image embeddings of all video frames $C L I P ( \mathrm { c a p t i o n } ) \cdot C L I P ( \mathrm { v i d e o } ^ { \prime } )$ .
98
 
99
  Results. We evaluate on MSR-VTT (Xu et al., 2016), noted in other recent works (Gao et al., 2021; Cheng et al., 2021) as a popular benchmark for video-to-text retrieval. We compare our method with zero-shot methods, as well as finetuned methods specifically trained on MSR-VTT. Results show that our method outperforms zero-shot state-of-the-art (Tab.4). Since our system uses Portillo-Quintero et al. (2021) to process CLIP features but additionally incorporates LLM reasoning on speech-to-text transcripts,
100
 
md/dev/zGvRdBW06F5/zGvRdBW06F5.md CHANGED
@@ -70,7 +70,7 @@ $$
70
  \tilde { \bf G } _ { \bar { \bf W } } = { \bf G } _ { \bar { \bf W } } \cdot s _ { \bf W } ^ { - 2 } , \quad \tilde { \bf G } _ { \bar { \bf b } } = { \bf G } _ { \bar { \bf b } } \cdot s _ { \bf W } ^ { - 2 } \cdot s _ { \bf x } ^ { - 2 } = { \bf G } _ { \bar { \bf b } } \cdot s ^ { - 2 }
71
  $$
72
 
73
- where s2X is the scaling factor for quantizing input $\mathbf { x }$ (a scalar following [34], note that $s = s _ { \mathbf { W } } \cdot s _ { \mathbf { x } }$ in Equation 1). We plot the $\lVert \mathbf { W } \rVert / \lVert \mathbf { G } \rVert$ curve with QAS in Figure 3 ( $\mathrm { i n t } 8 { + }$ scale). After scaling, the gradient ratios match the floating-point counterpart. QAS enables fully quantized training (int8 for both forward and backward) while matching the accuracy of the floating-point training (Table 1).
74
 
75
  # 2.2 Memory-Efficient Sparse Update
76
 
@@ -82,7 +82,7 @@ However, finding the right sparse update scheme under a memory budget is challen
82
 
83
  ![](images/b73d7eea96e91e24b83597fc49f898c04a88bfd9648656f4adafa4743d487f36.jpg)
84
 
85
- Figure C ribu on analysis o pdating ses and wei a) For as update, the accuracy generally goes higher as more layers are updated, but plateaus soon. (b) For updating the weight of a specific layer, the laterbackward & update layers appear to be more important; the first point-wise conv (pw1) in an inverted bottleneck block [60] appears(a) backward graph gen (b) graph pruning (c) graph reordering (d) deploy to be more important; and the gains are bigger with more channels updated. (c) The automated selection based on contribution analysis is effective: the actual downstream accuracy shows a positive correlation with $\scriptstyle \sum$ acc.
86
 
87
  ![](images/439dc735f635b7565c542442e4ae34148ae9b001b5fe0108411ff379933e52be.jpg)
88
  Figure 6. The workflow of our Tiny Training Engine (TTE). (a,b) Our engine traces the forward graph for a given model and derives the corresponding backward graph at compile time. The red cycles denote the gradient descent operators. (c) To reduce memory requirements, nodes related with frozen weights (colored in light blue) are pruned from backward computation. (d) To minimize memory footprint, the gradient descent operators are re-ordered to be interlaced with backward computations (colored in yellow). (e) TTE compiles forward and backward graphs using code generation and deploys training on tiny IoT devices (best viewed in colors).
@@ -153,7 +153,7 @@ Tiny Training Engine: faster training. We further measure the training latency p
153
 
154
  Dissecting update schedules. We visualize the update schedule of the MCUNet [47] model searched under 100KB extra memory (analytic) in Figure 11 (lower subfigure (b), with 10 classes). It updates the biases of the last 22 layers, and sparsely updates the weights of 6 layers (some are sub-tensor update). The initial 20 layers are frozen and run forward only. To understand why this scheme makes sense, we also plot the memory cost from activation and weight when updating each layer in the upper subfigure (a). We see a clear pattern: the activation cost is high for the initial layers; the weight cost is high for the ending layers; while the total memory cost is low when we update the middle layers (layer index 18-30). The update scheme matches the memory pattern: to skip the initial stage of high activation memory, we only update biases of the later stage of the network; we update the weights of 4 intermediate layers due to low overall memory cost; we also update the partial weights of two later layers (1/8 and 1/4 weights) due to their high contribution to the downstream accuracy (Figure 5). Interestingly, all the updated weights are from the first point-wise convolution in each inverted residual block [60] as they generally have a higher contribution to accuracy (the peak points on the zigzag curve in Figure 5(b)).
155
 
156
- Effectiveness of contribution analysis. We verify if the update scheme search based on contribution analysis is effective. We collect several data points during the search process (the update scheme and the search criteria, i.e., the sum of acc). We train the model with each update scheme to get the average accuracy on the downstream datasets (the real optimization target) and plot the comparison in Figure 5(c). We observe a positive correlation, indicating the effectiveness of the search.
157
 
158
  Sub-channel selection. Similar to weight pruning, we need to select the subset of channels for sub-tensor update. We update the last two blocks of the MCUNet [47] model and only 1/4 of the weights for each layer to compare the accuracy of different channel selection methods (larger magnitude, smaller magnitude, and random). The results are quite similar (within $0 . 2 \%$ accuracy difference). Channel selection is not very important for transfer learning (unlike pruning). We choose to update the channels with a larger weight magnitude since it has slightly higher accuracy.
159
 
 
70
  \tilde { \bf G } _ { \bar { \bf W } } = { \bf G } _ { \bar { \bf W } } \cdot s _ { \bf W } ^ { - 2 } , \quad \tilde { \bf G } _ { \bar { \bf b } } = { \bf G } _ { \bar { \bf b } } \cdot s _ { \bf W } ^ { - 2 } \cdot s _ { \bf x } ^ { - 2 } = { \bf G } _ { \bar { \bf b } } \cdot s ^ { - 2 }
71
  $$
72
 
73
+ where s2X is the scaling factor for quantizing input $\mathbf { x }$ (a scalar following [34], note that $s = s _ { \mathbf { W } } \cdot s _ { \mathbf { x } }$ in Equation 1). We plot the $\lVert \mathbf { W } \rVert / \lVert \mathbf { G } \rVert$ curve with QAS in Figure 3 ( $\mathrm { i n t } 8 { + }$ scale). After scaling, the gradient ratios match the floating-point counterpart. QAS enables fully quantized training (int8 for both forward and backward) while matching the accuracy of the floating-point training (Table 1).
74
 
75
  # 2.2 Memory-Efficient Sparse Update
76
 
 
82
 
83
  ![](images/b73d7eea96e91e24b83597fc49f898c04a88bfd9648656f4adafa4743d487f36.jpg)
84
 
85
+ Figure C ribu on analysis o pdating ses and wei a) For as update, the accuracy generally goes higher as more layers are updated, but plateaus soon. (b) For updating the weight of a specific layer, the laterbackward & update layers appear to be more important; the first point-wise conv (pw1) in an inverted bottleneck block [60] appears(a) backward graph gen (b) graph pruning (c) graph reordering (d) deploy to be more important; and the gains are bigger with more channels updated. (c) The automated selection based on contribution analysis is effective: the actual downstream accuracy shows a positive correlation with $\scriptstyle \sum$ acc.
86
 
87
  ![](images/439dc735f635b7565c542442e4ae34148ae9b001b5fe0108411ff379933e52be.jpg)
88
  Figure 6. The workflow of our Tiny Training Engine (TTE). (a,b) Our engine traces the forward graph for a given model and derives the corresponding backward graph at compile time. The red cycles denote the gradient descent operators. (c) To reduce memory requirements, nodes related with frozen weights (colored in light blue) are pruned from backward computation. (d) To minimize memory footprint, the gradient descent operators are re-ordered to be interlaced with backward computations (colored in yellow). (e) TTE compiles forward and backward graphs using code generation and deploys training on tiny IoT devices (best viewed in colors).
 
153
 
154
  Dissecting update schedules. We visualize the update schedule of the MCUNet [47] model searched under 100KB extra memory (analytic) in Figure 11 (lower subfigure (b), with 10 classes). It updates the biases of the last 22 layers, and sparsely updates the weights of 6 layers (some are sub-tensor update). The initial 20 layers are frozen and run forward only. To understand why this scheme makes sense, we also plot the memory cost from activation and weight when updating each layer in the upper subfigure (a). We see a clear pattern: the activation cost is high for the initial layers; the weight cost is high for the ending layers; while the total memory cost is low when we update the middle layers (layer index 18-30). The update scheme matches the memory pattern: to skip the initial stage of high activation memory, we only update biases of the later stage of the network; we update the weights of 4 intermediate layers due to low overall memory cost; we also update the partial weights of two later layers (1/8 and 1/4 weights) due to their high contribution to the downstream accuracy (Figure 5). Interestingly, all the updated weights are from the first point-wise convolution in each inverted residual block [60] as they generally have a higher contribution to accuracy (the peak points on the zigzag curve in Figure 5(b)).
155
 
156
+ Effectiveness of contribution analysis. We verify if the update scheme search based on contribution analysis is effective. We collect several data points during the search process (the update scheme and the search criteria, i.e., the sum of acc). We train the model with each update scheme to get the average accuracy on the downstream datasets (the real optimization target) and plot the comparison in Figure 5(c). We observe a positive correlation, indicating the effectiveness of the search.
157
 
158
  Sub-channel selection. Similar to weight pruning, we need to select the subset of channels for sub-tensor update. We update the last two blocks of the MCUNet [47] model and only 1/4 of the weights for each layer to compare the accuracy of different channel selection methods (larger magnitude, smaller magnitude, and random). The results are quite similar (within $0 . 2 \%$ accuracy difference). Channel selection is not very important for transfer learning (unlike pruning). We choose to update the channels with a larger weight magnitude since it has slightly higher accuracy.
159
 
md/train/HJBhEMbRb/HJBhEMbRb.md CHANGED
@@ -69,7 +69,7 @@ which we call the Fourier $\ell _ { 1 }$ -norm of $f$ . Fourier $\ell _ { 1 }$ -
69
 
70
  # 4 A FOURIER-BASED GENERALIZATION BOUND
71
 
72
- Consider a supervised learning task with n training samples xi, yini=1 and function space $\mathcal { F }$ . We are interested in uniform convergence bounds on the generalization risk. A standard approach to bound the generalization risk is based on the notion of Rademacher complexity. Given samples $\left( \mathbf { x } _ { i } , y _ { i } \right) _ { i = 1 } ^ { n }$ , the empirical Rademacher complexity of $\mathcal { F }$ is defined as
73
 
74
  $$
75
  \mathcal { R } _ { n } ^ { \mathrm { e m p } } ( \mathcal { F } ) : = \mathbb { E } _ { \pmb { \sigma } } \bigg [ \operatorname* { s u p } _ { f \in \mathcal { F } } \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \sigma _ { i } f ( \mathbf { x } _ { i } ) \bigg ]
 
69
 
70
  # 4 A FOURIER-BASED GENERALIZATION BOUND
71
 
72
+ Consider a supervised learning task with n training samples xi, yini=1 and function space $\mathcal { F }$ . We are interested in uniform convergence bounds on the generalization risk. A standard approach to bound the generalization risk is based on the notion of Rademacher complexity. Given samples $\left( \mathbf { x } _ { i } , y _ { i } \right) _ { i = 1 } ^ { n }$ , the empirical Rademacher complexity of $\mathcal { F }$ is defined as
73
 
74
  $$
75
  \mathcal { R } _ { n } ^ { \mathrm { e m p } } ( \mathcal { F } ) : = \mathbb { E } _ { \pmb { \sigma } } \bigg [ \operatorname* { s u p } _ { f \in \mathcal { F } } \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \sigma _ { i } f ( \mathbf { x } _ { i } ) \bigg ]