File:Coordinate descent.svg
![File:Coordinate descent.svg](https://upload.wikimedia.org/wikipedia/commons/thumb/e/e3/Coordinate_descent.svg/600px-Coordinate_descent.svg.png?20160110001043)
Size of this PNG preview of this SVG file: 600 × 600 pixels. Other resolutions: 240 × 240 pixels | 480 × 480 pixels | 768 × 768 pixels | 1,024 × 1,024 pixels | 2,048 × 2,048 pixels | 900 × 900 pixels.
Original file (SVG file, nominally 900 × 900 pixels, file size: 56 KB)
File information
Structured data
Captions
Captions
Add a one-line explanation of what this file represents
Summary
editDescriptionCoordinate descent.svg |
English: Coordinate descent with cyclic iteration of the coordinates. In each iteration a line search is done to find the step. |
Date | |
Source | Own work |
Author | Nicoguaro |
SVG development InfoField | ![]() This plot was created with Matplotlib. |
Source code InfoField | Python codefrom __future__ import division
import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import line_search
from matplotlib import rcParams
rcParams['font.family'] = 'serif'
rcParams['font.size'] = 16
def fun(x, y):
return 5*x**2 - 6*x*y + 5*y**2
def f(x):
x1 = x[0]
x2 = x[1]
return fun(x1, x2)
def g(x):
x1 = x[0]
x2 = x[1]
g1 = 10*x1 - 6*x2
g2 = -6*x1 + 10*x2
return [g1, g2]
X, Y = np.mgrid[-1.5:1.5:101j, -1.5:1.5:101j]
Z = fun(X, Y)
levels = np.linspace(0.5, 5, 6)
plt.figure(figsize=(10, 10))
CS = plt.contour(X, Y, Z, levels=levels, colors='k')
plt.clabel(CS)
xk = np.array([-0.5, -1])
pk = np.array([0., 1.])
for k in range(10):
res = line_search(f, g, xk, pk)
alpha = res[0]
xnew = xk + 0.6*alpha*pk
pk = pk[::-1]
plt.arrow(xk[0], xk[1], xnew[0] - xk[0], xnew[1] - xk[1],
fc='r', ec='r',
length_includes_head=True)
xk = xnew
plt.axis('image')
plt.xlabel(r'$x$', size=18)
plt.ylabel(r'$y$', size=18)
plt.title(r'$f(x,y) = 5x^2 - 6xy + 5y^2$')
plt.savefig('coordinate descent.svg')
plt.show()
|
Licensing
editI, the copyright holder of this work, hereby publish it under the following license:
![w:en:Creative Commons](https://upload.wikimedia.org/wikipedia/commons/thumb/7/79/CC_some_rights_reserved.svg/90px-CC_some_rights_reserved.svg.png)
![attribution](https://upload.wikimedia.org/wikipedia/commons/thumb/1/11/Cc-by_new_white.svg/24px-Cc-by_new_white.svg.png)
This file is licensed under the Creative Commons Attribution 4.0 International license.
- You are free:
- to share – to copy, distribute and transmit the work
- to remix – to adapt the work
- Under the following conditions:
- attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 00:10, 10 January 2016 | ![]() | 900 × 900 (56 KB) | Nicoguaro (talk | contribs) | Add labels to the contours. |
23:19, 9 January 2016 | ![]() | 900 × 900 (50 KB) | Nicoguaro (talk | contribs) | User created page with UploadWizard |
You cannot overwrite this file.
File usage on Commons
The following page uses this file:
File usage on other wikis
The following other wikis use this file:
- Usage on en.wikipedia.org
- Usage on ru.wikipedia.org
- Usage on uk.wikipedia.org
- Usage on zh.wikipedia.org
Metadata
This file contains additional information such as Exif metadata which may have been added by the digital camera, scanner, or software program used to create or digitize it. If the file has been modified from its original state, some details such as the timestamp may not fully reflect those of the original file. The timestamp is only as accurate as the clock in the camera, and it may be completely wrong.
Width | 720pt |
---|---|
Height | 720pt |