-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add config for transformer encoder as backbone of time series embedder
- Loading branch information
1 parent
0a88530
commit 63a3bfc
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
didactic/config/task/img_tokenizer/model/time-series-transformer.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
_target_: torch.nn.Sequential | ||
_args_: | ||
- _target_: collections.OrderedDict | ||
|
||
expand_feat_dim: | ||
_target_: vital.models.layers.Lambda | ||
fn: | ||
_target_: torch.unsqueeze | ||
_partial_: True | ||
dim: -1 | ||
|
||
upsampling: | ||
_target_: torch.nn.Linear | ||
in_features: 1 | ||
out_features: ${task.embed_dim} | ||
|
||
positional_encoding: | ||
_target_: didactic.models.layers.PositionalEncoding | ||
sequence_len: ${task.img_tokenizer.resample_dim} | ||
d_model: ${task.embed_dim} | ||
|
||
transformer_encoder: | ||
_target_: torch.nn.TransformerEncoder | ||
num_layers: 2 | ||
|
||
norm: | ||
_target_: torch.nn.LayerNorm | ||
normalized_shape: ${task.embed_dim} | ||
|
||
encoder_layer: | ||
_target_: torch.nn.TransformerEncoderLayer | ||
d_model: ${task.embed_dim} | ||
nhead: 2 | ||
dim_feedforward: ${op.mul:1.5,${task.embed_dim},int} | ||
dropout: 0.1 | ||
activation: relu | ||
batch_first: True | ||
norm_first: True | ||
|
||
sequential_pooling: | ||
_target_: didactic.models.layers.SequentialPooling | ||
d_model: ${task.embed_dim} |