Open albertnieto opened 1 month ago
Something like this
self.layers = nn.ModuleList()
for layer_config in architecture:
layer_type = layer_config['type']
params = layer_config['params']
if layer_type == 'QuanvLayer':
self.layers.append(QuanvLayer(**params))
elif layer_type == 'Conv2d':
self.layers.append(nn.Conv2d(**params))
elif layer_type == 'Linear':
self.layers.append(nn.Linear(**params))
Example: