File size: 634 Bytes
835424e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import torch
import torch.nn as nn
import torch.nn.functional as F
class simple_sd_model (nn.Module):
    def __init__(self):
        super(simple_sd_model, self).__init__()
        self.fc1 = nn.Linear (1,1)
        self.fc2 = nn.Linear (1,6)
        self.fc3 = nn.Linear (6,7)
        self.fc4 = nn.Linear (7,4)

    def forward(self, x):
        x = F.relu (self.fc1(x))
        x = F.relu (self.fc2(x))
        x = self.fc3(x)
        x = self.fc4(x)
        return x

model = simple_sd_model()
input_data = torch.rand (10, 1, requires_grad= True)
output_data = model(input_data)
print (output_data)