oovm / WLNet-ModelZoo

19 stars 2 forks source link

Using special Operator instead of using Encoder #3

Open oovm opened 5 years ago

oovm commented 5 years ago

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.

oovm commented 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}
oovm commented 5 years ago

OpenCV use int8 and bgr as input