How to make the weight obtained by convolution2dlayer non-negative?

6 ビュー (過去 30 日間)
CHAO WANG
CHAO WANG 2020 年 12 月 20 日
コメント済み: CHAO WANG 2021 年 1 月 5 日
I am training a simple network. I need to constrain the weights of one layer of convolution2dlayer to be >0. For example, in keras, Layer weight constraints are implemented using tf.keras.constraints.NonNeg(). Can this function be realized in matlab? If there is no direct way, are there indirect constraints?

採用された回答

Abhishek Gupta
Abhishek Gupta 2020 年 12 月 23 日
Hi,
As per my understanding, you want to constrain the weights of a convolution2DLayer in MATLAB. You can do so by accessing the weights of a layer as shown below: -
net.LW{i,j}
Referring to the following resources, which might help you in resolving the issue: -
  1 件のコメント
CHAO WANG
CHAO WANG 2021 年 1 月 5 日
Thank you very much for your answer. It's helpful.I will try to run it on my program.

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

その他の回答 (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