浅いニューラルネットワークのミニバッチトレーニング
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
現在,関数近似ニューラルネットワークを作成しようとしています.
そこでミニバッチで学習をしようとしていますが,trainではサポートされていないのでしょうか?
trainNetworkでしか実行できないのでしょうか?
0 Commenti
Risposta accettata
Naoya
il 19 Giu 2020
残念ながら Deep Learning Toolboxの Shallow Nural Network (train関数ベース)においては、ミニバッチサイズを設定するオプションはありません。
よろしければ、trainNetwork関数ベースの学習の使用をご検討ください。
2 Commenti
Naoya
il 2 Lug 2020
簡単な例で恐れ入りますが、trainNetworkベースでの回帰モデル例を示します。
入出力データ共に乱数としており、精度面は考慮していません。
あくまでもフローについてまでの例となります
% 回帰用 NN layers の作成
layers = [...
imageInputLayer([3,1,1]); % 入力 3ユニット
fullyConnectedLayer(10);
tanhLayer();
fullyConnectedLayer(3);
regressionLayer];
% 入力と教師データの作成
X = randn(3,1,1,1000); % 3入力 / 1000 パターン分
Y = rand(1000,3); % 3出力 / 1000パターン分
% 学習オプション
options = trainingOptions('sgdm', ...
'MiniBatchSize',100,...
'MaxEpochs',100,...
'InitialLearnRate',1e-4, ...
'Verbose',false, ...
'Plots','training-progress');
% 学習
net = trainNetwork(X,Y,layers,options);
% 予測 (新規3入力分を適用)
predict(net, rand(3,1))
Più risposte (0)
Vedere anche
Categorie
Scopri di più su イメージを使用した深層学習 in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!