2016-09-25 4 views
2

CNNの重みと偏りの2つの大規模な配列があります。各レイヤーにウェイトを設定することができます(set_weightsを使用)が、レイヤーごとにバイアスを設定する方法はありません。これはどうすればいいですか?CNNの偏りを設定する

答えて

0

layer.set_weights(weights)を使用してこれを行います。ドキュメントから:

weights: a list of Numpy arrays. The number 
     of arrays and their shape must match 
     number of the dimensions of the weights 
     of the layer (i.e. it should match the 
     output of `get_weights`). 

あなただけの層があり、各パラメータがではなく、用フィルタの重みを入れないでください。体重を入れなければならない順序は、layer.weightsに依存します。

print([p.name for p in layer.weights]) 
のようなコードを見たり、レイヤーの重みの名前を印刷することができます
関連する問題