Atotti commited on
Commit
6e88e9b
·
verified ·
1 Parent(s): 36e20ed

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +71 -9
README.md CHANGED
@@ -5,24 +5,29 @@ license: gemma
5
 
6
  # google-usm: Extracted Gemma-3n Audio Encoder (USM)
7
 
8
- ## モデル概要 (Model Description)
 
 
 
9
 
10
- このモデルは、Googleのマルチモーダルモデル [`google/gemma-3n-e2b-it`](https://huggingface.co/google/gemma-3n-e2b-it) から、**音声エンコーダー部分 (`audio_tower`) のみ**を抽出したものです。
11
 
12
- アーキテクチャは、論文 [Universal Speech Model](https://arxiv.org/abs/2303.01037) に基づく**Gemma3nAudioEncoder**です。
 
 
13
 
14
  このエンコーダーは、音声波形データを受け取り、その内容を表現する高次元の特徴量(エンコーディング)のシーケンスに変換する役割を果たします。
15
 
16
- ## 主な用途 (Intended Use)
17
 
18
  このモデルは単体で音声認識(文字起こし)などを行うものではなく、より大きなモデルのコンポーネントとして使用されることを想定しています。
19
 
20
- * **マルチモーダルモデルの音声入力部として**: 生成AIに音声情報を与えるための特徴量を抽出します。
21
- * **音声分類**: このモデルの出力に分類ヘッドを追加して、特定の音声(例:笑い声、拍手、特定の単語)を分類するタスクでファインチューニングします。
22
- * **音声類似度検索**: 音声のエンコーディングをベクトルとして扱い、意味的に似た音声を検索します。
23
- * **話者認識**: 音声から話者を識別するタスクのベースモデルとして利用します。
24
 
25
- ## 使用方法 (How to Use)
26
 
27
  このモデル(音声エンコーダー)と、元モデルの`Feature Extractor`を組み合わせて使用します。
28
 
@@ -74,3 +79,60 @@ print(audio_encodings[0, :5, :10])
74
  # -0.0080, -0.0233]], device='cuda:0')
75
 
76
  ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
 
6
  # google-usm: Extracted Gemma-3n Audio Encoder (USM)
7
 
8
+ > [!Note]
9
+ > このモデルの実態は不明確です。[Introducing Gemma 3n: The developer guide](https://developers.googleblog.com/en/introducing-gemma-3n-developer-guide/#:~:text=Gemma%203n%20uses%20an%20advanced%20audio%20encoder%20based%20on%20the%20Universal%20Speech%20Model%20(USM).)には、USMに基づくエンコーダーが使用されていると記述されていますが、USMの論文とこのモデルはいくつかの異なる点が存在します。
10
+ > このモデルは0.6Bですが、USMの論文の0.6Bモデルとは層の数と隠れ層の数が異なります。
11
+ > このモデルは Gemma 3n の AudioEncoder であり、本来の USM とは異なる可能性があります。
12
 
13
+ ## Model Description
14
 
15
+ このモデルは、Googleのマルチモーダルモデル [google/gemma-3n-e2b-it](https://huggingface.co/google/gemma-3n-e2b-it) から、音声エンコーダー部分 (`audio_tower`) のみを抽出したものです。
16
+
17
+ アーキテクチャは、論文 [Universal Speech Model](https://arxiv.org/abs/2303.01037) に基づくGemma3nAudioEncoderです。
18
 
19
  このエンコーダーは、音声波形データを受け取り、その内容を表現する高次元の特徴量(エンコーディング)のシーケンスに変換する役割を果たします。
20
 
21
+ ## Intended Use
22
 
23
  このモデルは単体で音声認識(文字起こし)などを行うものではなく、より大きなモデルのコンポーネントとして使用されることを想定しています。
24
 
25
+ * マルチモーダルモデルの音声入力部として: 生成AIに音声情報を与えるための特徴量を抽出します。
26
+ * 音声分類: このモデルの出力に分類ヘッドを追加して、特定の音声(例:笑い声、拍手、特定の単語)を分類するタスクでファインチューニングします。
27
+ * 音声類似度検索: 音声のエンコーディングをベクトルとして扱い、意味的に似た音声を検索します。
28
+ * 話者認識: 音声から話者を識別するタスクのベースモデルとして利用します。
29
 
30
+ ## How to Use
31
 
32
  このモデル(音声エンコーダー)と、元モデルの`Feature Extractor`を組み合わせて使用します。
33
 
 
79
  # -0.0080, -0.0233]], device='cuda:0')
80
 
81
  ```
82
+
83
+ ## Model Architecture
84
+ ```
85
+ Gemma3nAudioEncoder(
86
+ (subsample_conv_projection): Gemma3nAudioSubSampleConvProjection(
87
+ (conv_0): Gemma3nAudioSSCPConvBlock(
88
+ (conv): Conv2d(1, 128, kernel_size=(3, 3), stride=(2, 2), bias=False)
89
+ (norm): Gemma3nAudioCumulativeGroupNorm()
90
+ (activation): ReLU()
91
+ )
92
+ (conv_1): Gemma3nAudioSSCPConvBlock(
93
+ (conv): Conv2d(128, 32, kernel_size=(3, 3), stride=(2, 2), bias=False)
94
+ (norm): Gemma3nAudioCumulativeGroupNorm()
95
+ (activation): ReLU()
96
+ )
97
+ (input_proj_linear): Linear(in_features=1024, out_features=1536, bias=False)
98
+ )
99
+ (conformer): ModuleList(
100
+ (0-11): 12 x Gemma3nAudioConformerBlock(
101
+ (ffw_layer_start): Gemma3nAudioConformerFeedForward(
102
+ (pre_layer_norm): Gemma3nRMSNorm((1536,), eps=1e-06)
103
+ (ffw_layer_1): Linear(in_features=1536, out_features=6144, bias=False)
104
+ (ffw_layer_2): Linear(in_features=6144, out_features=1536, bias=False)
105
+ (post_layer_norm): Gemma3nRMSNorm((1536,), eps=1e-06)
106
+ )
107
+ (attention): Gemma3nAudioConformerAttention(
108
+ (pre_attn_norm): Gemma3nRMSNorm((1536,), eps=1e-06)
109
+ (attn): Gemma3nAudioAttention(
110
+ (relative_position_embedding): Gemma3nAudioRelativePositionEmbedding(
111
+ (pos_proj): Linear(in_features=1536, out_features=1536, bias=False)
112
+ )
113
+ (q_proj): Linear(in_features=1536, out_features=1536, bias=False)
114
+ (k_proj): Linear(in_features=1536, out_features=1536, bias=False)
115
+ (v_proj): Linear(in_features=1536, out_features=1536, bias=False)
116
+ )
117
+ (post): Linear(in_features=1536, out_features=1536, bias=False)
118
+ (post_norm): Gemma3nRMSNorm((1536,), eps=1e-06)
119
+ )
120
+ (lconv1d): Gemma3nAudioConformerLightConv1d(
121
+ (pre_layer_norm): Gemma3nRMSNorm((1536,), eps=1e-06)
122
+ (linear_start): Linear(in_features=1536, out_features=3072, bias=False)
123
+ (depthwise_conv1d): Conv1d(1536, 1536, kernel_size=(5,), stride=(1,), groups=1536, bias=False)
124
+ (conv_norm): Gemma3nRMSNorm((1536,), eps=1e-06)
125
+ (linear_end): Linear(in_features=1536, out_features=1536, bias=False)
126
+ )
127
+ (ffw_layer_end): Gemma3nAudioConformerFeedForward(
128
+ (pre_layer_norm): Gemma3nRMSNorm((1536,), eps=1e-06)
129
+ (ffw_layer_1): Linear(in_features=1536, out_features=6144, bias=False)
130
+ (ffw_layer_2): Linear(in_features=6144, out_features=1536, bias=False)
131
+ (post_layer_norm): Gemma3nRMSNorm((1536,), eps=1e-06)
132
+ )
133
+ (norm): Gemma3nRMSNorm((1536,), eps=1e-06)
134
+ )
135
+ )
136
+ )
137
+ ```
138
+