I have a set of strings of sequential models e.g.
'Sequential( (conv1): Conv2d(3, 4, kernel_size=(3, 3), stride=(1, 1))
(relu1): ReLU() (conv2): Conv2d(4, 2, kernel_size=(3, 3), stride=(1, 1)) (relu2):
ReLU() (Flatten): Flatten() (fc): Linear(in_features=1568, out_features=10, bias=True)
)'
I want to be able to parse it to extract the layers, the hyper parameters and sometimes even make a new model with that setting.
Is there an easy way to do this in PyTorch?