Skip to content

Tidy up of VGG10 RadioML model #420

Answered by fpjentzsch
satishkumar538 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,

I attached some Python code in a .txt file: network_surgery.txt

We used this code to perform the necessary "tidy up" (aka "network surgery") to make the model ready for FINN, but I have not tested it on the latest Brevitas/FINN versions. It is not very elegant because it works on the .onnx model and not on the Pytorch model level, but it gets the job done.

As you see, we remove all nodes before the first "Mul" node. In our case, this includes the (MultiThreshold->Add) sequence that represents the input quantization. We also replace the final Softmax/LogSoftmax node with a TopK node. The rest of it is mostly cleanup steps, some of which might be redundant or not needed anymore.

Replies: 2 comments 13 replies

Comment options

You must be logged in to vote
10 replies
@fpjentzsch
Comment options

@Aakasha01Agarwal
Comment options

@fpjentzsch
Comment options

@Aakasha01Agarwal
Comment options

@fpjentzsch
Comment options

Answer selected by fpjentzsch
Comment options

You must be logged in to vote
3 replies
@fpjentzsch
Comment options

@Aakasha01Agarwal
Comment options

@fpjentzsch
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants