示例#1
0
    def __init__(self, num_hidden: int = 50) -> None:
        # TODO: Introduce linear modules (aka linear layers)
        self.w1 = Parameter(10, num_hidden)
        self.b1 = Parameter(num_hidden)

        self.w2 = Parameter(num_hidden, 4)
        self.b2 = Parameter(4)
示例#2
0
    def __init__(self, num_hidden: int = 50) -> None:
        self.w1 = Parameter(10, num_hidden)
        self.b1 = Parameter(num_hidden)

        self.w2 = Parameter(num_hidden, 4)
        self.b2 = Parameter(4)
示例#3
0
 def __init__(self) -> None:
     self.w =  Parameter(3)
     self.b = Parameter()
 def __init__(self) -> None:
     self.w = Parameter(
         3)  # tensor (3,) requires_grad = True,  random values
     self.b = Parameter()