Vectorize!



  1. Vectorize Definition
  2. Vectorize Numpy
  3. Vectorize Photoshop
  4. Vectorize Definition

We are a vectorize art conversion service, we convert to vector your low resolution art into high resolution vector art? We vectorize images of all file types such as jpegs, bit maps, pdfs, raster images etc. Into useable vector art for print on anything. Once we convert to vector, it will be able to print at any scale and at the highest possible resolution. Use our free vectorization tool and vectorize an image, sketch, blueprint or photo to vector format. FREE VECTORIZATION. Free online vectorization tool With the help of our software, you can turn pixel images with blurry edges into sharp and scalable vector images that you can modify and resize to any size! UPLOAD YOUR FILE.

In mathematics, especially in linear algebra and matrix theory, the vectorization of a matrix is a linear transformation which converts the matrix into a column vector. Specifically, the vectorization of a m × n matrix A, denoted vec(A), is the mn × 1 column vector obtained by stacking the columns of the matrix A on top of one another:

Vectorize!
vec(A)=[a1,1,,am,1,a1,2,,am,2,,a1,n,,am,n]T{displaystyle operatorname {vec} (A)=[a_{1,1},ldots ,a_{m,1},a_{1,2},ldots ,a_{m,2},ldots ,a_{1,n},ldots ,a_{m,n}]^{mathrm {T} }}

Here, ai,j{displaystyle a_{i,j}} represents A(i,j){displaystyle A(i,j)} and the superscript T{displaystyle {}^{mathrm {T} }} denotes the transpose. Vectorization expresses, through coordinates, the isomorphismRm×n:=RmRnRmn{displaystyle mathbf {R} ^{mtimes n}:=mathbf {R} ^{m}otimes mathbf {R} ^{n}cong mathbf {R} ^{mn}} between these (i.e., of matrices and vectors) as vector spaces.

For example, for the 2×2 matrix A=[abcd]{displaystyle A={begin{bmatrix}a&bc&dend{bmatrix}}}, the vectorization is vec(A)=[acbd]{displaystyle operatorname {vec} (A)={begin{bmatrix}acbdend{bmatrix}}}.

The connection between the vectorization of A and the vectorization of its transpose is given by the commutation matrix.

Compatibility with Kronecker products[edit]

The vectorization is frequently used together with the Kronecker product to express matrix multiplication as a linear transformation on matrices. In particular,

Vectorize Definition

vec(ABC)=(CTA)vec(B){displaystyle operatorname {vec} (ABC)=(C^{mathrm {T} }otimes A)operatorname {vec} (B)}

for matrices A, B, and C of dimensions k×l, l×m, and m×n.[1] For example, if adA(X)=AXXA{displaystyle operatorname {ad} _{A}(X)=AX-XA} (the adjoint endomorphism of the Lie algebragl(n, C) of all n×n matrices with complex entries), then vec(adA(X))=(InAATIn)vec(X){displaystyle operatorname {vec} (operatorname {ad} _{A}(X))=(I_{n}otimes A-A^{mathrm {T} }otimes I_{n}){text{vec}}(X)}, where In{displaystyle I_{n}} is the n×nidentity matrix.

There are two other useful formulations:

vec(ABC)=(InAB)vec(C)=(CTBTIk)vec(A){displaystyle operatorname {vec} (ABC)=(I_{n}otimes AB)operatorname {vec} (C)=(C^{mathrm {T} }B^{mathrm {T} }otimes I_{k})operatorname {vec} (A)}
vec(AB)=(ImA)vec(B)=(BTIk)vec(A){displaystyle operatorname {vec} (AB)=(I_{m}otimes A)operatorname {vec} (B)=(B^{mathrm {T} }otimes I_{k})operatorname {vec} (A)}

More generally, it has been shown that vectorization is a self-adjunction in the monoidal closed structure of any category of matrices.[1]

Compatibility with Hadamard products[edit]

Vectorization is an algebra homomorphism from the space of n × n matrices with the Hadamard (entrywise) product to Cn2 with its Hadamard product:

vec(AB)=vec(A)vec(B).{displaystyle operatorname {vec} (Acirc B)=operatorname {vec} (A)circ operatorname {vec} (B).}

Compatibility with inner products[edit]

Vectorization is a unitary transformation from the space of n×n matrices with the Frobenius (or Hilbert–Schmidt) inner product to Cn2:

Free
tr(AB)=vec(A)vec(B)=vec(B)vec(A).{displaystyle operatorname {tr} (A^{top }B)=operatorname {vec} (A)^{top }operatorname {vec} (B)=operatorname {vec} (B)^{top }operatorname {vec} (A).}

where the superscript T denotes the conjugate transpose.

Vectorization as a linear sum[edit]

The matrix vectorization operation can be written in terms of a linear sum. Let X be an m × n matrix that we want to vectorize, and let ei be the i-th canonical basis vector for the n-dimensional space, that is ei=[0,...,0,1,0,...,0]T{textstyle mathbf {e} _{i}=left[0,...,0,1,0,...,0right]^{mathrm {T} }}. Let Bi be a (mn) × m block matrix defined as follows:

Bi=[00Im00]=eiIm{displaystyle mathbf {B} _{i}={begin{bmatrix}mathbf {0} vdots mathbf {0} mathbf {I} _{m}mathbf {0} vdots mathbf {0} end{bmatrix}}=mathbf {e} _{i}otimes mathbf {I} _{m}}

Bi consists of n block matrices of size m × m, stacked column-wise, and all these matrices are all-zero except for the i-th one, which is a m × m identity matrix Im.

Then the vectorized version of X can be expressed as follows:

vec(X)=i=1nBiXei{displaystyle operatorname {vec} (mathbf {X} )=sum _{i=1}^{n}mathbf {B} _{i}mathbf {X} mathbf {e} _{i}}

Multiplication of X by ei extracts the i-th column, while multiplication by Bi puts it into the desired position in the final vector.

Vectorize!

Alternatively, the linear sum can be expressed using the Kronecker product:

vec(X)=i=1neiXei{displaystyle operatorname {vec} (mathbf {X} )=sum _{i=1}^{n}mathbf {e} _{i}otimes mathbf {X} mathbf {e} _{i}}

Half-vectorization[edit]

For a symmetric matrixA, the vector vec(A) contains more information than is strictly necessary, since the matrix is completely determined by the symmetry together with the lower triangular portion, that is, the n(n + 1)/2 entries on and below the main diagonal. For such matrices, the half-vectorization is sometimes more useful than the vectorization. The half-vectorization, vech(A), of a symmetric n × n matrix A is the n(n + 1)/2 × 1 column vector obtained by vectorizing only the lower triangular part of A:

vech(A)=[A1,1,,An,1,A2,2,,An,2,,An1,n1,An,n1,An,n]T.{displaystyle operatorname {vech} (A)=[A_{1,1},ldots ,A_{n,1},A_{2,2},ldots ,A_{n,2},ldots ,A_{n-1,n-1},A_{n,n-1},A_{n,n}]^{mathrm {T} }.}

Vectorize Numpy

For example, for the 2×2 matrix A=[abbd]{displaystyle A={begin{bmatrix}a&bb&dend{bmatrix}}}, the half-vectorization is vech(A)=[abd]{displaystyle operatorname {vech} (A)={begin{bmatrix}abdend{bmatrix}}}.

There exist unique matrices transforming the half-vectorization of a matrix to its vectorization and vice versa called, respectively, the duplication matrix and the elimination matrix.

Vectorize reddit

Programming language[edit]

Programming languages that implement matrices may have easy means for vectorization.In Matlab/GNU Octave a matrix A can be vectorized by A(:).GNU Octave also allows vectorization and half-vectorization with vec(A) and vech(A) respectively. Julia has the vec(A) function as well.In PythonNumPy arrays implement the flatten method[1], while in R the desired effect can be achieved via the c() or as.vector() functions. In R, function vec() of package 'ks' allows vectorization and function vech() implemented in both packages 'ks' and 'sn' allows half-vectorization.[2][3][4]

Vectorize Photoshop

Notes[edit]

1.^^ The identity for row-major vectorization is vec(ABC)=(ACT)vec(B){displaystyle operatorname {vec} (ABC)=(Aotimes C^{mathrm {T} })operatorname {vec} (B)}.

See also[edit]

References[edit]

  1. ^Macedo, H. D.; Oliveira, J. N. (2013). 'Typing Linear Algebra: A Biproduct-oriented Approach'. Science of Computer Programming. 78 (11): 2160–2191. arXiv:1312.4818. doi:10.1016/j.scico.2012.07.012. S2CID9846072.
  2. ^Duong, Tarn (2018). 'ks: Kernel Smoothing'. R package version 1.11.0.
  3. ^Azzalini, Adelchi (2017). 'The R package 'sn': The Skew-Normal and Related Distributions such as the Skew-t'. R package version 1.5.1.
  4. ^Vinod, Hrishikesh D. (2011). 'Simultaneous Reduction and Vec Stacking'. Hands-on Matrix Algebra Using R: Active and Motivated Learning with Applications. Singapore: World Scientific. pp. 233–248. ISBN978-981-4313-69-8 – via Google Books.
  • Jan R. Magnus and Heinz Neudecker (1999), Matrix Differential Calculus with Applications in Statistics and Econometrics, 2nd Ed., Wiley. ISBN0-471-98633-X.

Vectorize Definition

Retrieved from 'https://en.wikipedia.org/w/index.php?title=Vectorization_(mathematics)&oldid=1009041696'