fixed definition of layers
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import torch.nn as nn
|
from torch import nn
|
||||||
|
|
||||||
|
|
||||||
class FullyConnectedModel(nn.Module):
|
class FullyConnectedModel(nn.Module):
|
||||||
@@ -8,11 +8,11 @@ class FullyConnectedModel(nn.Module):
|
|||||||
def __init__(self, num_out_features: int):
|
def __init__(self, num_out_features: int):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
# define layers
|
# define layers
|
||||||
self.fc2 = nn.Linear(in_features=512, out_features=128)
|
self.fc1 = nn.Linear(in_features=512, out_features=128)
|
||||||
|
self.af1 = nn.ReLU()
|
||||||
|
self.fc2 = nn.Linear(in_features=128, out_features=32)
|
||||||
self.af2 = nn.ReLU()
|
self.af2 = nn.ReLU()
|
||||||
self.fc3 = nn.Linear(in_features=128, out_features=32)
|
self.fc3 = nn.Linear(in_features=32, out_features=num_out_features)
|
||||||
self.af3 = nn.ReLU()
|
|
||||||
self.fc4 = nn.Linear(in_features=32, out_features=num_out_features)
|
|
||||||
|
|
||||||
def forward(self, x):
|
def forward(self, x):
|
||||||
"""Pass input through model."""
|
"""Pass input through model."""
|
||||||
@@ -21,6 +21,4 @@ class FullyConnectedModel(nn.Module):
|
|||||||
x = self.fc2(x)
|
x = self.fc2(x)
|
||||||
x = self.af2(x)
|
x = self.af2(x)
|
||||||
x = self.fc3(x)
|
x = self.fc3(x)
|
||||||
x = self.af3(x)
|
|
||||||
x = self.fc4(x)
|
|
||||||
return x
|
return x
|
||||||
|
|||||||
Reference in New Issue
Block a user