Open oovm opened 5 years ago
use fixed BatchNorm instead of pre-process
shift[m_, v_, eps_ : 0.01] := BatchNormalizationLayer[
"Epsilon" -> eps,
"MovingMean" -> m,
"MovingVariance" -> v^2 - eps
] // NetInitialize;
And it should equal:
shift[{0.485, 0.456, 0.406}, {0.229, 0.224, 0.225}][img]
(img-{0.485, 0.456, 0.406})/{0.229, 0.224, 0.225}
OpenCV use int8
and bgr
as input
For a better out-of-the-box experience
I think I should remove the shift in the encoder, GBR to RGB, rearrange the order.
These things can be done by adjusting the weight of the convolution.