human
3. ResNet
ResNet (Residual Networks) models were introduced by He et al. in 2015 (paper url). They found that more layers improved the performance but unfortunatly it was hard to backpropagate the gradients up to first layers.
A trick to let the gradients "flow" easily is to use shortcut connection that let the forward tensor untouched (aka a residual):

This time, code a ResNet layer using the Oriented-Object API:
Exemple usage:
```python
class MyModel(Model):
    def init(self):
        self.classifier = Dense(10, activation="softmax")
def call(self, inputs):
    return self.classifier(inputs)

```"
Please write code following the instructions in jupyter notebook style.

Write me a code to 3?
assistant
#Here is code to 3.

from tensorflow.keras.layers import Layer, Add

class ResidualBlock(Layer):
    def __init__(self, n_filters):
        super().__init__(name="ResidualBlock")
        
        # TODO: define needed layers, use Add to combine the shortcut with the convs' output.
        
    def call(self, inputs):
        # TODO
        return 42
    

class MiniResNet(Model):
    def __init__(self, n_filters):
        super().__init__()

        self.conv = Conv2D(n_filters, kernel_size=(5, 5), padding="same")
        self.block = ResidualBlock(n_filters)
        self.flatten = Flatten()
        self.classifier = Dense(10, activation="softmax")
        
    def call(self, inputs):
        # TODO
        return 1337

mini_resnet = MiniResNet(32)
mini_resnet.build((None, *input_shape))
mini_resnet.summary()

# %load solutions/mini_resnet.py