File size: 978 Bytes
4c53a91
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import os
import torch
import torch.nn as nn
import pytorch_lightning as pl
from sklearn import metrics
from transformers import AutoModelForAudioClassification
import numpy as np

class FeedforwardModel(nn.Module):
    def __init__(self, input_size, output_size):
        super(FeedforwardModel, self).__init__()
        self.model = nn.Sequential(
            nn.Linear(input_size, 1024),  
            nn.BatchNorm1d(1024), 
            nn.ReLU(),
            nn.Dropout(0.3),  

            nn.Linear(1024, 512),
            nn.BatchNorm1d(512), 
            nn.ReLU(),
            nn.Dropout(0.3),

            nn.Linear(512, 256),
            nn.BatchNorm1d(256), 
            nn.ReLU(),
            nn.Dropout(0.3),

            nn.Linear(256, 128),
            nn.BatchNorm1d(128), 
            nn.ReLU(),
            nn.Dropout(0.3),

            nn.Linear(128, output_size),
        )

    def forward(self, x):
        logit = self.model(x)
        return logit