Activations of freezed layers are different between before/after training, why?

2 ビュー (過去 30 日間)
ntinoson
ntinoson 2018 年 6 月 29 日
コメント済み: Amanjit Dulai 2018 年 8 月 28 日
I follow the example "transfer-learning-using-googlenet" where, the last 3 layers ('loss3-classifier','prob','output') are replaced with 3 new ones. Then I 'freeze' the first 141 layers (that is up to and including 'pool5-drop_7x7_s1'):
layers(1:141) = freezeWeights(layers(1:141));
lgraph = createLgraphUsingConnections(layers,connections);
Then I follow fine-tuning.
Since 'pool5-7x7_s1' is BEFORE 'pool5-drop_7x7_s1', I would expect that the following two vectors were the same:
b_orig= activations(net_orig, I, 'pool5-7x7_s1');
b_tune= activations(net_tune, I, 'pool5-7x7_s1');
but they aren't!... Any idea why?
p.s. I also tried the activation of several other layers BEFORE 'pool5-drop_7x7_s1', and I got different vectors.... 'I' is an image, 'net_orig=googlenet;', and 'net_tune' is the resulting net after tuning.
  2 件のコメント
conngame
conngame 2018 年 7 月 15 日
I have the same problem using alexnet. Any explanations to this question?
ntinoson
ntinoson 2018 年 7 月 17 日
I did also try other CNNs, and same result. Activation of freezed layers after fine-tuning is different to that before fine-tuning (for the same input image of course). If anyone comes up with an explanation, drop a line!

サインインしてコメントする。

採用された回答

Amanjit Dulai
Amanjit Dulai 2018 年 8 月 14 日
The vectors are different because when you fine tune on a new dataset, the average image in "imageInputLayer" is recalculated for your new dataset.
  2 件のコメント
ntinoson
ntinoson 2018 年 8 月 27 日
ok, i see, thanks!
p.s. if 'normalization' was set to 'none' (i.e. NO data transformation applied, I guess the vectors would be the same, right?)
Amanjit Dulai
Amanjit Dulai 2018 年 8 月 28 日
Yes, that's correct.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDeep Learning Toolbox についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by