浅いニューラルネットワークのミニバッチトレーニング
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
現在,関数近似ニューラルネットワークを作成しようとしています.
そこでミニバッチで学習をしようとしていますが,trainではサポートされていないのでしょうか?
trainNetworkでしか実行できないのでしょうか?
0 commentaires
Réponse acceptée
Naoya
le 19 Juin 2020
残念ながら Deep Learning Toolboxの Shallow Nural Network (train関数ベース)においては、ミニバッチサイズを設定するオプションはありません。
よろしければ、trainNetwork関数ベースの学習の使用をご検討ください。
2 commentaires
Naoya
le 2 Juil 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))
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur イメージを使用した深層学習 dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!