I would like to add more layers to this model, but I do not know how.
Here is my model with pytorch:
class ResNet(nn.Module):
def __init__(self):
super().__init__()
self.network = resnet18()
num_ftrs = self.network.fc.in_features
self.network.fc = nn.Linear(num_ftrs, 100)
self.act_fun = nn.Softmax(dim=-1)
def forward(self, xb):
x = self.network(xb)
x = self.act_fun(x)
return x
Here are layers with Keras:
model=tf.keras.models.Sequential()
model.add(UpSampling2D(size=(7, 7),interpolation='bilinear'))
model.add(GlobalAveragePooling2D())
model.add(Dropout(.25))
model.add(Dense(256, activation='relu'))
model.add(BatchNormalization())
model.add(Dense(100, activation='softmax'))