chin-shiuh shieh assignment 3.1, 文鶑 1. maximize f 1 (x,y) assignment - 20142 requirement: find...

16
Chin-Shiuh Shieh Assignment 3.1, 文文 1

Upload: janiya-salkin

Post on 14-Dec-2015

220 views

Category:

Documents


2 download

TRANSCRIPT

Chin-Shiuh Shieh

Assignment 3.1, 文鶑 1

Maximize F1(x,y)

Assignment - 2014 2

Requirement: Find maximize value of F1(x,y) used hill-climbing (gradient-ascent) method.

Step1: Initialize a value for: (x,y)(Choice one point:-5≤x,y<5)Example: x0 = 1; y0 = 1;

Assignment - 2014 3

Assignment - 2014 4

x

yxF

,

and y

yxF

,

If initialize value (x0,y0) is good, we can find global value. If not we can be trapped in local optima

The number of steps are change around: 100

Assignment - 2014 5

We initialize many points of (x0,y0) and used For loop to find optima value with each point. And then compare this to choice the best optima.

Assignment - 2014 6

The optimize when we you many initialize points (For loop) seem better than when we only used one point in some cases. But the number of steps size will be increase linear with number of initialize points.

Example: The number of steps size with 10 initialize points are change around: 1000

Assignment - 2014 7

Assignment - 2014 8

Assignment - 2014 9

Assignment - 2014 10

But when we used Hill-climbing on this, some time I receive local optimize, some time is a strange value, have something are wrong in here? What happening?

I will point to you a case that we can’t find the optimize value if we only used Hill-climbing method.

Assignment - 2014 11

Now, you are standing in point a. You used Hill-climbing and you receive point a’. But it isn’t a optimize value in this location because the peak of mountains isn’t exit (out of range), and you are strapped on back of the mountains.

Assignment - 2014 12

We find maximum value of F(x,y) when (x,y) in line: y=-5*x/3 + 5

I replace y=-5*x/3 + 5 in function F(x,y). And then we can used For loop or Hill-Climbing to find this.

In here I used For loop with step size: 0.01.You can use Hill-Climbing to replace the For Loop to

have better result.

Assignment - 2014 13

After that we compare maximum value in case 1 and case 2 to find exactly global value

And we find out the optimize value is point b: Max = 4.1724

(x0, y0)= 1.8600 1.9000 Steps: 2009

Assignment - 2014 14

No. Optimize value in

Case1

(-5<x<3;-5<y<5

and y<-5*x/3 +

5)

Optimize value in

Case2

(y=-5*x/3 + 5)

Global optimize Total

numbe

r steps

1 Max = 2.3285

 

(x0, y0)=

-1.9660

1.9944

 

Steps: 730

Max = 4.1724

 

(x0, y0)=

1.8600 1.9000

 

Steps: 301

Max = 4.1724

 

(x0, y0)=

1.8600 1.9000

 

Steps:

1031

1031

2 Max = 3.2972

 

(x0, y0)=

1.9975 -1.9788

 

Steps: 1794

Max = 4.1724

 

(x0, y0)=

1.8600 1 .9000

 

Steps: 301

Max = 4.1724

 

(x0, y0)=

1.8600 1.9000

 

Steps: 2095

2095

3 Max = 2.3289

 

(x0, y0)=

1.3197 -1.8148

 

Steps: 556

Max = 4.1724

 

(x0, y0)= 1.8600

1.9000

 

Steps: 301

Max = 4.1724

 

(x0, y0)=

1.8600 1.9000

 

Steps: 857

 

857

4 Max = 4.1281

 

(x0, y0)=

1.7865 2.0232

 

Steps: 1708

Max = 4.1724

 

(x0, y0)= 1.8600

1.9000

 

Steps: 301

Max = 4.1724

 

(x0, y0)=

1.8600 1.9000

 

Steps: 2009

2009

Assignment - 2014 15

Assignment - 2014 16