-
class CircleModel(nn.Module):
def __init__(self):
super().__init__()
self.layer_1 = nn.Linear(in_features=2, out_features=10)
self.layer_2 = nn.Linear(in_features=10, out_features=10)
self.layer_3 = nn.Linear(in_features=10, out_features=1)
model = CircleModel()
How to fix It ? |
Beta Was this translation helpful? Give feedback.
Answered by
tonyhaya
Feb 10, 2023
Replies: 1 comment 1 reply
-
|
You must write the class CicleModelV2(nn.Module):
def __init__(self):
super().__init__()
self.layer1=nn.Sequential(
nn.Linear(2,10),
nn.Linear(10,10),
nn.Linear(10,1))
# Required forward() method
def forward(self, x):
return self.layer1(x) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
mrdbourke
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You must write the
forward()and return your layer inside of it, like this: