deeplabv3p​lusでWeight​sをNoneとする方​法をどのように実現で​きますか?

3 ビュー (過去 30 日間)
MathWorks Support Team
MathWorks Support Team 2025 年 8 月 20 日
回答済み: MathWorks Support Team 2025 年 8 月 20 日

deeplabv3plusを使用してセグメンテーションネットワークを構築する際、ResNet18をバックボーンとして指定し、ネットワーク内の重み(Weights)とバイアス(Bias)をNone(空)に初期化したいです。どのような手順で実現できますか?MATLABコード例もあれば教えてください。

採用された回答

MathWorks Support Team
MathWorks Support Team 2025 年 8 月 20 日
deeplabv3plusでResNet18をバックボーンに用いる場合、ネットワークはdlnetworkオブジェクトとして取得されます。重みやバイアスなどの学習可能パラメータは、Learnablesというテーブルにまとめられています。
これらの値をNone(空)にしたい場合は、Learnablesテーブル内の"Weight"または"Bias"に該当する値を空行列[]に書き換えます。
以下のMATLABコード例のように、forループで該当パラメータを空に設定し、ネットワークに再度代入してください。
net = deeplabv3plus([224 224],5,"resnet18"); learnables = net.Learnables; for n = 1:size(learnables,1) if learnables.Parameter(n) == "Weights" | learnables.Parameter(n) == "Bias" learnables.Value{n} = []; end end net.Learnables = learnables;

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGPU Coder を使用した深層学習 についてさらに検索

タグ

タグが未入力です。

Community Treasure Hunt

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

Start Hunting!