can me understand python code below. trying figure "output = layer.ingredients(input_)" does? don't understand how class handles object being passed. example, how 1 use parameter in contractor?
class lasagna(layer): def __init__(self, layers): self.layers = layers def ingredients(self, input_): # remember inputs each layer can use them self.inputs = [] layer in self.layers: self.inputs.append(input_) output = layer.ingredients(input_) input_ = output return output lasagna = lasagna([linear(784, 100), function1(), linear(100, 10), function2()])
thanks
Comments
Post a Comment