neurosim / DNN_NeuroSim_V1.3

Benchmark framework of compute-in-memory based accelerators for deep neural network (inference engine focused)
62 stars 36 forks source link

how to use other network #19

Closed diziww closed 2 years ago

diziww commented 2 years ago

Hi, I have learnt a lot from neurosim.

And I tried the examples you provide. But how to simulate other networks like vgg19, densenet121 and more. I download the models from pytorch and it's hard to make it work

neurosim commented 2 years ago

Hi! You can mimic the example model of densenet40 and resnet18 to extend to other models. The key point is to replace nn.Conv2d and nn.Linear with QConv2d and QLinear. For example, in DenseNet.py, the nn.Conv2d and nn.Linear layers are replaced by QConv2d and QLinear called by function make_layers. You can reuse the make_layers function for other models, or directly call QConv2d and QLinear as we did in ResNet.py. Hope this could help you.