@@ -24,13 +24,13 @@ feature tokens -> RowColTransformer -> pooling -> optional norm -> MLPhead
2424
2525## Main Building Blocks
2626
27- | Component | DeepTab implementation | Role |
28- | --- | --- | --- |
29- | Tokenizer | ` EmbeddingLayer ` | Converts each input feature to a token. |
30- | Column attention | ` nn.MultiheadAttention ` inside ` RowColTransformer ` | Models feature interactions within a row. |
31- | Row attention | Flattened row representation inside ` RowColTransformer ` | Mixes sample-level context within a batch. |
32- | Feed-forward blocks | LayerNorm + Linear + activation + dropout | Adds nonlinear token updates. |
33- | Prediction head | ` MLPhead ` | Produces final outputs. |
27+ | Component | DeepTab implementation | Role |
28+ | ------------------- | ------------------------------------------------------- | --------------------------------------- --- |
29+ | Tokenizer | ` EmbeddingLayer ` | Converts each input feature to a token. |
30+ | Column attention | ` nn.MultiheadAttention ` inside ` RowColTransformer ` | Models feature interactions within a row. |
31+ | Row attention | Flattened row representation inside ` RowColTransformer ` | Mixes sample-level context within a batch. |
32+ | Feed-forward blocks | LayerNorm + Linear + activation + dropout | Adds nonlinear token updates. |
33+ | Prediction head | ` MLPhead ` | Produces final outputs. |
3434
3535## Implementation Notes
3636
@@ -62,13 +62,13 @@ model = SAINTClassifier(
6262
6363Key settings:
6464
65- | Setting | Typical range | Effect |
66- | --- | --- | --- |
67- | ` d_model ` | ` 64 ` to ` 192 ` | Token width. |
68- | ` n_layers ` | ` 1 ` to ` 4 ` | Row/column attention depth. |
69- | ` n_heads ` | ` 2 ` to ` 8 ` | Number of attention heads. |
70- | ` attn_dropout ` , ` ff_dropout ` | ` 0.0 ` to ` 0.3 ` | Regularization. |
71- | ` pooling_method ` , ` use_cls ` | ` "cls" ` /` True ` or ` "avg" ` /` False ` | Token aggregation behavior. |
65+ | Setting | Typical range | Effect |
66+ | ---------------------------- | --------------------------------- | ------------------------ --- |
67+ | ` d_model ` | ` 64 ` to ` 192 ` | Token width. |
68+ | ` n_layers ` | ` 1 ` to ` 4 ` | Row/column attention depth. |
69+ | ` n_heads ` | ` 2 ` to ` 8 ` | Number of attention heads. |
70+ | ` attn_dropout ` , ` ff_dropout ` | ` 0.0 ` to ` 0.3 ` | Regularization. |
71+ | ` pooling_method ` , ` use_cls ` | ` "cls" ` /` True ` or ` "avg" ` /` False ` | Token aggregation behavior. |
7272
7373## When To Use
7474
0 commit comments