我应该在inception_v3中取消imagenet预先训练的inception_v3模型的均值吗?py keras吗?

时间:2022-08-08 13:57:50
def preprocess_input(x):
x /= 255.
x -= 0.5
x *= 2.
return x

 I am using keras inception_v3 imagenet pretrained model(inception_v3.py) to finetune on my own dataset.
 When I want to subtract the imagenet mean value [123.68, 116.779, 103.939] and reverse axis RGB to BGR as we often do, I find that the author provided a _preprocess_input()_ function at the end.I am confused about this.

我正在使用keras inception_v3 imagenet预先训练的模型(inception_v3.py)在我自己的数据集中进行优化。当我想要像我们经常做的那样减去imagenet的平均值[123.68,116.779,103.939]和反向轴RGB到BGR时,我发现作者在最后提供了_preprocess_input() () _function。我很困惑。

  Should I use the provided function preprocess_input() or subtract mean value and reverse axis as usual?
  Thanks lot.

我应该像往常一样使用提供的函数preprocess_input()还是减去平均值和反向轴?由于很多。

1 个解决方案

#1


2  

Actually in a original Inception paper the autors mention as a data preprocessor the function you provided (one which is zero-centering all channels and resizes it to [-1, 1] interval). As in InceptionV3 paper no new data transformation is provided I think that you may assume that you should use the following function:

实际上,在最初的《盗梦空间》中,autors把你提供的功能称为数据预处理器(一个以所有通道为中心并将其调整为[- 1,1]间隔的功能)。就像InceptionV3的论文中没有提供新的数据转换一样,我认为您可以假设您应该使用以下函数:

def preprocess_input(x):
    x /= 255.
    x -= 0.5
    x *= 2.
    return x

#1


2  

Actually in a original Inception paper the autors mention as a data preprocessor the function you provided (one which is zero-centering all channels and resizes it to [-1, 1] interval). As in InceptionV3 paper no new data transformation is provided I think that you may assume that you should use the following function:

实际上,在最初的《盗梦空间》中,autors把你提供的功能称为数据预处理器(一个以所有通道为中心并将其调整为[- 1,1]间隔的功能)。就像InceptionV3的论文中没有提供新的数据转换一样,我认为您可以假设您应该使用以下函数:

def preprocess_input(x):
    x /= 255.
    x -= 0.5
    x *= 2.
    return x