Train Network Using Federated Learning example given in Matlab documentation is not working

5 ビュー (過去 30 日間)
The example "Train Network Using Federated Learning" given in Matlab documentation is not working. I tried to simulate this code as it is given in Matlab documentation but I am getting the following error:
Can somebody help me in solving this issue.

回答 (1 件)

Gagan Agarwal
Gagan Agarwal 2023 年 11 月 17 日
Hi Debojit
I understand that you are encountering the error while replicating the scenario from MATLAB documentation. The error is occurring because the 'preprocessMiniBatch' function is not defined in your code. In the documentation, the function is defined in a later section as follows:
function [X,Y] = preprocessMiniBatch(XCell,YCell,classes)
% Concatenate.
X = cat(4,XCell{1:end});
% Extract label data from cell and concatenate.
Y = cat(2,YCell{1:end});
% One-hot encode labels.
Y = onehotencode(Y,1,ClassNames=classes);
end
Defining the 'preprocessMiniBatch' function as shown above will resolve the error.
I hope it helps!
  1 件のコメント
debojit sharma
debojit sharma 2023 年 11 月 21 日
@Gagan Agarwal even after adding the 'preprocessMiniBatch' function I am getting the following error:

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

カテゴリ

Help Center および File ExchangeSequence and Numeric Feature Data Workflows についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by