Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AdaW算法运行MaF8和MaF9报错 #167

Open
wjq19990427 opened this issue Dec 18, 2024 · 1 comment
Open

AdaW算法运行MaF8和MaF9报错 #167

wjq19990427 opened this issue Dec 18, 2024 · 1 comment

Comments

@wjq19990427
Copy link

您好,我本身不是做这个方向的,只是近期有个项目用到了PlatEMO,我在测试AdaW算法性能的时候,发现用GUI运行会报错:
函数计算已完成,但有错误。

出错 module_exp/cb_start (第 242 行)
[r,result,metric] = fetchNext(Future,0.01);
^^^^^^^^^^^^^^^^^^^^^^
出错 module_exp>@(varargin)obj.cb_start(varargin{:}) (第 73 行)
obj.app.buttonC(1) = GUI.APP(3,2,uibutton(obj.app.grid(3),'push','Text','Start','FontSize',16,'ButtonpushedFcn',@obj.cb_start));
^^^^^^^^^^^^
原因:
错误使用 WeightUpdate (第 27 行)
位置 2 处的索引超出数组边界。索引不能超过 1。

错误使用 appdesservices.internal.interfaces.model.AbstractModel/executeUserCallback (第 282 行)
计算 Button PrivateButtonPushedFcn 时出错。

报错的是AdaW算法中WeightUpdate.m这个文件,27行
niche_size = median(dis2(:,2));
没有考虑到这个dis2输入只有一列的情况。

@wjq19990427
Copy link
Author

我的处理方法是把这行代码改为:
if size(dis2, 2) >= 2
niche_size = median(dis2(:,2));
else
warning('dis2 只有一列数据,无法访问第二列。');
% 使用第一列数据:
niche_size = median(dis2(:,1));
end

但我不清楚,这么改是否合理?

wjq19990427 added a commit to wjq19990427/PlatEMO that referenced this issue Dec 19, 2024
Try to fix the bug "Fix issue BIMK#167: add a judegment to check the number of columns for virable dis2, if there is only one column, use this column instead of the second column"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant