Skip to content
Discussion options

You must be logged in to vote

You must write the forward() and return your layer inside of it, like this:

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)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ghost
Comment options

Answer selected by mrdbourke
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant