Is there a way to disable the fused Act(Conv+Bias+Z)
operation?
#15048
Replies: 1 comment
-
Yes, you can disable the fused Act(Conv+Bias+Z) operation by controlling how the layers are constructed and fused. In your case, it seems you're using models like PP-HGNetV2 from PaddleClas, where certain blocks like ConvBNAct or DiverseBranchBlock can support various fusions of convolution, bias, activation, and potentially an additional z term (e.g., identity or residual input). However, by default, these fusions are manually configured during model definition and parameter fusion (e.g., via reparameterization in DiverseBranchBlock or affine scaling in LearnableAffineBlock). To disable the fused Act(Conv+Bias+Z) pattern, consider the following strategies:
If you are using your own custom module or modifying a model like PPHGNetV2, ensure that in forward passes you avoid:
Since you mentioned that you only have Act(a1 * Conv + Bias) and not the extra z, you’re likely using a model configuration without explicit residual or fused affine/identity branches. That's expected if you're not using, for instance, DiverseBranchBlock with all branches enabled. If needed, you can insert custom code to further isolate the Act(Conv + Bias) by replacing composite layers with atomic layers (Conv2D, BatchNorm2D, ReLU), and controlling exactly what gets fused. Let me know your specific model definition if you'd like exact code replacements. Response generated by 🤖 feifei-bot | chatgpt-4o-latest |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
For me,
Act(a1 * Conv + Bias)
exists but I don't have the+ z
operation.Beta Was this translation helpful? Give feedback.
All reactions