Xrondev / HKU-comp7404

2 stars 0 forks source link

Maybe there is a little problem in the code file woa_svm.py #2

Closed M-Kylie closed 7 months ago

M-Kylie commented 7 months ago

In the function "whale_optimization_algorithm", the loop code (in the while loop): if np.linalg.norm(A) < 1:

update the position by Eq.1

                population[idx] = best_whale - A * (C * best_whale - whale)   

According to the paper, why it is not : population[idx] = whale - A (C best_whale - whale).

And in the da_svm.py, where does the levy_flight come from? Because I can't find any description in the paper you introduced.

Thank you for reading my comment, and I am hoping to receive your response.

Xrondev commented 7 months ago

For that implementation problem, you may refer to the original paper of WOA The whale optimization algorithm and the pyMetaheauristic repo I mentioned in your last issue. I don't know if the implementation is wrong or not now, but if the problem does exist, you can highlight the formula for me and create a pull request if you want to fix it. And for your second problem, actually, we also did not find the levy_flight function in the paper, and the formula seems to not even appear in the original paper that proposed the DA(I am not quite sure; check it, please). It seems like in the end we referred to the pyMetaHeauristic for the levy function. Anyway, you can try to find more papers or repos and keep searching for those terms or formulas. The paper we implemented has many uncertain parts and errors(e.g., figure 4 is for DA, but whales in the steps description), so you might have to look for a broader range of resources to study instead of sticking to only this paper.

M-Kylie commented 7 months ago
formula

This is the formula in the paper(Eq.1), I took a screenshot of it, you can refer to it. I'm not very familiar with using Github, so I can only rely on you to make code changes if you need. Thank you for your suggestions, I will refer to other papers and the repository you mentioned.

Xrondev commented 7 months ago

formula This is the formula in the paper(Eq.1), I took a screenshot of it, you can refer to it. I'm not very familiar with using Github, so I can only rely on you to make code changes if you need. Thank you for your suggestions, I will refer to other papers and the repository you mentioned.

According to the original paper and the pyMetahuristic I mentioned, the formula should be image where the X star denotes the best whale position. (pp.53)

Another code example from pyMetaheuristic is Here at L45 and L70. Please note that the if condition is different from our implementation, but the formula uses the best whale idx.

Therefore, this might be another error that appeared in the paper... Please refer to other resources if you do believe the implementation needs to be corrected, thanks.

M-Kylie commented 7 months ago

Oh, I see...So the paper I referenced is incorrect. Could you tell me the formula you screenshot above is from which paper?

Xrondev commented 7 months ago

Oh, I see...So the paper I referenced is incorrect. Could you tell me the formula you screenshot above is from which paper?

Sure, the paper is mentioned in my first reply. Please refer to this paper, which proposed the WOA: The whale optimization algorithm

For that implementation problem, you may refer to the original paper of WOA The whale optimization algorithm and the pyMetaheauristic repo I mentioned in your last issue. I don't know if the implementation is wrong or not now, but if the problem does exist, you can highlight the formula for me and create a pull request if you want to fix it. And for your second problem, actually, we also did not find the levy_flight function in the paper, and the formula seems to not even appear in the original paper that proposed the DA(I am not quite sure; check it, please). It seems like in the end we referred to the pyMetaHeauristic for the levy function. Anyway, you can try to find more papers or repos and keep searching for those terms or formulas. The paper we implemented has many uncertain parts and errors(e.g., figure 4 is for DA, but whales in the steps description), so you might have to look for a broader range of resources to study instead of sticking to only this paper.

M-Kylie commented 7 months ago

Thanks!!You are my hero!

Xrondev commented 7 months ago

The issue has been closed since no more comments were received.