File size: 1,645 Bytes
55ff87e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
from transformers import PretrainedConfig

class EEGViTConfig(PretrainedConfig):
    model_type = "eegvit"

    def __init__(
        self,
        conv1_out_channels=256,
        conv1_kernel_size=(1, 36),
        conv1_stride=(1, 36),
        conv1_padding=(0, 2),
        num_channels=256,
        image_size=(129, 14),
        patch_size=(8, 1),
        hidden_size=768,
        num_hidden_layers=12,
        num_attention_heads=12,
        intermediate_size=3072,
        hidden_dropout_prob=0.1,
        attention_probs_dropout_prob=0.1,
        initializer_range=0.02,
        layer_norm_eps=1e-12,
        classifier_dropout=0.1,
        num_labels=2,
        **kwargs
    ):
        super().__init__(**kwargs)
        
        # Conv1 settings
        self.conv1_out_channels = conv1_out_channels
        self.conv1_kernel_size = conv1_kernel_size
        self.conv1_stride = conv1_stride
        self.conv1_padding = conv1_padding
        
        # ViT specific settings
        self.num_channels = num_channels
        self.image_size = image_size
        self.patch_size = patch_size
        self.hidden_size = hidden_size
        self.num_hidden_layers = num_hidden_layers
        self.num_attention_heads = num_attention_heads
        self.intermediate_size = intermediate_size
        self.hidden_dropout_prob = hidden_dropout_prob
        self.attention_probs_dropout_prob = attention_probs_dropout_prob
        self.initializer_range = initializer_range
        self.layer_norm_eps = layer_norm_eps
        
        # Classifier settings
        self.classifier_dropout = classifier_dropout
        self.num_labels = num_labels