0% found this document useful (0 votes)
3 views8 pages

Assignment 2 REPORT

The document presents optimization results for three functions with specified learning rates. For function f, the optimal point is approximately [2, 4] with a minimal value, while for function g, the optimal point is around [7, -10] with a value of approximately -31. Additionally, a third function with a learning rate of 0.0004 shows various values of 'k' and 'Z' throughout the optimization process.

Uploaded by

anju singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views8 pages

Assignment 2 REPORT

The document presents optimization results for three functions with specified learning rates. For function f, the optimal point is approximately [2, 4] with a minimal value, while for function g, the optimal point is around [7, -10] with a value of approximately -31. Additionally, a third function with a learning rate of 0.0004 shows various values of 'k' and 'Z' throughout the optimization process.

Uploaded by

anju singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

ANJU SINGH ENTRY NO.

-2024MEM1003
a. Enter the learning rate for function f (e.g., 0.1): 0.0987
Results for function f(x, y) = (x - 2)^2 + (y - 4)^2:
Optimal point: [1.99999807 3.99999615]
Optimal value: 1.8532054802838638e-11

Optimization history for function f:


x y function_value
0 0.000000 0.000000 2.000000e+01
1 0.394800 0.789600 1.288334e+01
2 0.711666 1.423333 8.299016e+00
3 0.965984 1.931967 5.345950e+00
4 1.170098 2.340197 3.443684e+00
.. ... ... ...
59 1.999995 3.999991 1.076293e-10
60 1.999996 3.999993 6.933119e-11
61 1.999997 3.999994 4.466085e-11
62 1.999998 3.999995 2.876903e-11
63 1.999998 3.999996 1.853205e-11

[64 rows x 3 columns]


ANJU SINGH ENTRY NO.-2024MEM1003

b. Enter the learning rate for function g (e.g., 0.01): 0.067


Results for function g(x, y) = 5x^2 - 30x + y^2 - 8y + 4xy + 34:
Optimal point: [ 6.99998362 -9.99996045]
Optimal value: -30.999999999685542

Optimization history for function g:


x y function_value
0 0.000000 0.000000 34.000000
1 2.010000 0.536000 -5.790764
ANJU SINGH ENTRY NO.-2024MEM1003
2 2.529652 0.461496 -8.703156
3 2.721104 0.257709 -9.801332
4 2.838898 0.029920 -10.768937
.. ... ... ...
535 6.999982 -9.999957 -31.000000
536 6.999982 -9.999958 -31.000000
537 6.999983 -9.999959 -31.000000
538 6.999983 -9.999960 -31.000000
539 6.999984 -9.999960 -31.000000

[540 rows x 3 columns]


ANJU SINGH ENTRY NO.-2024MEM1003
ANJU SINGH ENTRY NO.-2024MEM1003
2. Enter the learning rate (e.g., 0.1): 0.09876
Enter the value of 'a' in the function f(x, y) = x^2 + ay^2 (e.g., 1, 100, 1000):
0.5

Results for function f(x, y) = x^2 + 0.5*y^2:


Optimal point: [2.46716464e-11 9.71160339e-06]
Optimal value: 4.715762015578482e-11

Optimization history for the function:


x y function_value
0 1.000000e+00 1.000000 1.500000e+00
1 8.024800e-01 0.901240 1.050091e+00
2 6.439742e-01 0.812234 7.445644e-01
3 5.167764e-01 0.732017 5.349825e-01
4 4.147027e-01 0.659723 3.895958e-01
.. ... ... ...
107 5.949237e-11 0.000015 1.083498e-10
108 4.774144e-11 0.000013 8.800536e-11
109 3.831155e-11 0.000012 7.148091e-11
110 3.074425e-11 0.000011 5.805919e-11
111 2.467165e-11 0.000010 4.715762e-11

[112 rows x 3 columns]


ANJU SINGH ENTRY NO.-2024MEM1003

3. What is the learning rate?0.0004

the value of the k is -1420.8633090909088


The value of the Z is : 8182.453236363635
the value of the k is -1016.1304170401102
The value of the Z is : 7927.263874221046
the value of the k is -896.4310020235964
The value of the Z is : 7405.934653797893
the value of the k is -884.480603878916
The value of the Z is : 7271.244857815313
the value of the k is -883.08481055576
The value of the Z is : 7243.213385192259
the value of the k is -882.8026669369777
The value of the Z is : 7237.412898613286
the value of the k is -882.744615817885
ANJU SINGH ENTRY NO.-2024MEM1003
The value of the Z is : 7236.213946373755
the value of the k is -882.7326312042644
The value of the Z is : 7235.966182546016
The updated value of s is : 0
The updated value of t is : 7235.966182546016
The updated value of x_new is : -1.8943864730184066
the updated value of y_new is : -0.4483932365092034
the value of the k is 4947.665659864425
The value of the Z is : -16085.66827570003
the value of the k is 2907.058900415776
The value of the Z is : -11810.180314279776
the value of the k is 1789.0084009928207
The value of the Z is : -6625.396989684578
the value of the k is 1347.9497211803982
The value of the Z is : -3997.0317163356895
the value of the k is 1252.3601174748576
The value of the Z is : -3176.612422622045
the value of the k is 1241.375225080937
The value of the Z is : -2995.9363040940884
the value of the k is 1239.4939352503786
The value of the Z is : -2958.29845835053
the value of the k is 1239.1137118678648
The value of the Z is : -2950.5045905298807
The updated value of s is : 1239.1137118678648
The updated value of t is : 0
The updated value of x_new is : 0.008709030505708149
the updated value of y_new is : -2.9663638779771677
the value of the k is 1246.9169151091705
The value of the Z is : -2488.6676604366817
the value of the k is 1235.8935258340136
The value of the Z is : -2859.3520467421686
the value of the k is 1238.1404836427328
The value of the Z is : -2930.120609027959
the value of the k is 1238.8321425031786
The value of the Z is : -2944.6820048507075
the value of the k is 1238.9773108609056
The value of the Z is : -2947.6895775854073
the value of the k is 1239.0073849921778
The value of the Z is : -2948.3111362329464
the value of the k is 1239.0136040733234
The value of the Z is : -2948.4396056654514
the value of the k is 1239.014889653013
The value of the Z is : -2948.4661595562934
The updated value of s is : 1239.014889653013
The updated value of t is : 0
The updated value of x_new is : 0.00878808827758959
the updated value of y_new is : -2.9660476468896415
the value of the k is 1246.8932233328778
The value of the Z is : -2488.5728933315118
the value of the k is 1235.8916323786675
The value of the Z is : -2859.3286784032553
the value of the k is 1238.140254668975
The value of the Z is : -2930.1157984097767
the value of the k is 1238.8320946660901
The value of the Z is : -2944.6810117326563
the value of the k is 1238.9773009353273
The value of the Z is : -2947.6893723634184
ANJU SINGH ENTRY NO.-2024MEM1003
the value of the k is 1239.0073829390199
The value of the Z is : -2948.3110938166496
the value of the k is 1239.0136036488773
The value of the Z is : -2948.4395968982844
the value of the k is 1239.014889565279
The value of the Z is : -2948.466157744164
The updated value of s is : 1239.014889565279
The updated value of t is : 0
The updated value of x_new is : 0.008788088347776779
the updated value of y_new is : -2.9660476466088928

You might also like