單目標優化問題 常用的 測試函數


近段時間因為需要完成任務所以在研究群智能算法,在這過程中需要不斷的拿一些測試函數去做實驗,為了以后使用方便在這里將常用的一些測試函數做下記錄。

 

1.Rastrigin's 函數

對於有兩個獨立變量的Rastrigin函數,其定義的形式如下:

 

下面是具有兩個獨立變量的Rastrigin函數圖形。

 

在圖形化表示中,該函數有非常多的局部極小點,而僅僅只有一個全局最小點,這個點就是[0  0],在這個點處的函數的值為0,該函數被用來測試遺傳算法的主要原因是,對於傳統的基於梯度的算法對付這個具有非常多局部極小點的函數來說,那是十分的困難呀。

下面給出該函數的等高線圖:

 

網址:http://blog.csdn.net/niuyongjie/article/details/4879326

給出了 適應度函數 的 最優值平均值會在一個圖形窗口不斷的繪制出,等算法運行結束,繪制的圖形如下所示。

在圖形中上面藍色的點表示適應度函數平均值的變化,而下面黑色的點表示了,每次迭代中最佳適應度值的變化。

 

外國網站上給出的:http://www.sfu.ca/~ssurjano/rastr.html

 

 

Description:

Dimensions: d 

The Rastrigin function has several local minima. It is highly multimodal, but locations of the minima are regularly distributed. It is shown in the plot above in its two-dimensional form. 

Input Domain:

The function is usually evaluated on the hypercube xi ∈ [-5.12, 5.12], for all i = 1, …, d. 

Global Minimum:

 

 

 

2. SCHAFFER FUNCTION N. 2

http://www.sfu.ca/~ssurjano/schaffer2.html

Description:

Dimensions: 2 

The second Schaffer function. It is shown on a smaller input domain in the second plot to show detail. 

Input Domain:

The function is usually evaluated on the square xi ∈ [-100, 100], for all i = 1, 2. 

Global Minimum:

 

 

 

 

還有一種寫法:

f(x)=0.5 -  

該函數在(0,...,0)處有最大值1,因此不需要取相反數。

 

 

 

3.   Ackley函數,函數圖形如下:

 

%Ackley 函數  

%輸入x,給出相應的y值,在x=(0,0,…,0) 處有全局極小點0,為得到最大值,返回值取相反數  

result=-20*exp(-0.2*sqrt((1/col)*(sum(x.^2))))-exp((1/col)*sum(cos(2*pi.*x)))+exp(1)+20;  

result=-result;

 

 

http://www.sfu.ca/~ssurjano/ackley.html

 

Description:

Dimensions: d 

The Ackley function is widely used for testing optimization algorithms. In its two-dimensional form, as shown in the plot above, it is characterized by a nearly flat outer region, and a large hole at the centre. The function poses a risk for optimization algorithms, particularly hillclimbing algorithms, to be trapped in one of its many local minima. 

Recommended variable values are: a = 20, b = 0.2 and c = 2π. 

Input Domain:

The function is usually evaluated on the hypercube xi ∈ [-32.768, 32.768], for all i = 1, …, d, although it may also be restricted to a smaller domain. 

Global Minimum:

 

 

 

4.   Griewank函數,圖形如下所示:

 

 

http://www.sfu.ca/~ssurjano/griewank.html

Description:

Dimensions: d 

The Griewank function has many widespread local minima, which are regularly distributed. The complexity is shown in the zoomed-in plots. 

Input Domain:

The function is usually evaluated on the hypercube xi ∈ [-600, 600], for all i = 1, …, d. 

Global Minimum:

 

 

 

 

更多的 單目標測試函數  網址:

http://www.sfu.ca/~ssurjano/optimization.html

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM