# If I change the activation function of VGG16, will the accuracy increase?

**URL:** <https://forum.opencv.org/t/if-i-change-the-activation-function-of-vgg16-will-the-accuracy-increase/9382>\
**Category:** Python\
**Tags:** dnn\
**Created:** [July 3, 2022, 7:12am UTC](https://forum.opencv.org/t/if-i-change-the-activation-function-of-vgg16-will-the-accuracy-increase/9382 "2022-07-03T07:12:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ruorch](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@ruorch](https://forum.opencv.org/u/ruorch)\
**Post date:** [July 3, 2022, 7:12am UTC](https://forum.opencv.org/t/if-i-change-the-activation-function-of-vgg16-will-the-accuracy-increase/9382/1 "2022-07-03T07:12:27Z")

</div>

If I change the activation function of VGG16 to switch, ReLU6, LeakyReLU, Mesh, etc., will the accuracy improve? Or does it go down?

---

<div class="post-metadata">

**Author:** ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)\
**Post date:** [July 3, 2022, 8:21am UTC](https://forum.opencv.org/t/if-i-change-the-activation-function-of-vgg16-will-the-accuracy-increase/9382/2 "2022-07-03T08:21:36Z")

</div>

you probably need to ask this in a different place.

opencv’s dnn only deals with pretrained models  
(where it’s hard/impossible to change those layers after training)
