I have a JSON file wherein I have defined a network (Consists of Conv and Dense layers)
I want to create a Network dynamically based on this JSON file, thus I want my network to have layers according to file. Thus my layer can either have 4 layers or 10 layers.
How can I achieve this in PyTorch?
For example, my JSON file looks like this:
{
“name”: “Arch 1”,
“batch_size”: 50,
“layers”: [
{
“type”: “Input”,
“output_shape”: [
1,
28,
28
]
},
{
“type”: “Conv2D”,
“num_filters”: 32,
“filter_size”: [
3,
3
],
“non_linearity”: “rectify”,
“conv_mode”: “same”
},
{
“type”: “MaxPool2D”,
“filter_size”: [
2,
2
]
},