配列の正規化について

4 ビュー (過去 30 日間)
donna
donna 2020 年 7 月 22 日
編集済み: donna 2020 年 7 月 23 日
セルの中身に対して正規化する関数はありますか?

採用された回答

Kenta
Kenta 2020 年 7 月 22 日
datavarsというところを'ResponseImage'としてはどうでしょう?
  6 件のコメント
Kenta
Kenta 2020 年 7 月 22 日
clear;clc
load patchesRead1
% N = normalize(patchesRead1,'DataVariables','ResponseImage');
B = cellfun(@myL2norm,patchesRead1.ResponseImage,'UniformOutput',false);
function output=myL2norm(input)
output=normalize(single(input),'norm');
end
データの方添付していただきありがとうございます。patchesRead1.ResponseImageという変数がセル配列で入っているので、セル配列の変数に対して、そのセルの中を対象に指定した関数を実行するcellfunというものがあります。それを使うと上のようにして、L2 normで正規化した値を返します。
ただ、深層学習に利用したいとなると、もともと、深層学習の入力層で正規化方法を指定できるのであまりこの操作は必要ないかもしれません。
Kenta
Kenta 2020 年 7 月 22 日
よかったです。ちなみに、ただの興味なのですが、ここでsparse filterを利用する理由や目的について教えていただけるとうれしいです。

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!