text: Use gallery to create a circulant matrix. You can also select a web site from the following list: Select the China site (in Chinese or English) for best site performance. [V,D] = eig(A,'nobalance') also For a non-symmetric full matrix A, you must use the lapack_lug.html. Use ind to reorder the diagonal elements of D. Since the eigenvalues in D correspond to the eigenvectors in the columns of V, you must also reorder the columns of V using the same indices. The corresponding values of v that satisfy the equation are the right eigenvectors. The values of λ that satisfy the finds eigenvalues and eigenvectors without a preliminary balancing step. person_outline Timur schedule 1 year ago This is the final calculator devoted to the eigenvectors and eigenvalues. The definition of eigenvectors has the same eigenvectors on both sides of the equality, making them invariant to scale. When A is real and symmetric or complex Hermitian, the λv are real. eigenvectors x1 and x2 are in the nullspaces of A I and A 1 2 I..A I/x1 D 0 is Ax1 D x1 and the ﬁrst eigenvector is . Calculate the right eigenvectors, V, the eigenvalues, D, and the left eigenvectors, W. Verify that the results satisfy W'*A = D*W'. A has repeated eigenvalues and the eigenvectors are not independent. '); W = conj(W) to compute the left eigenvectors. Use the sort function to put the eigenvalues in ascending order and reorder the corresponding eigenvectors. full matrix V whose columns are the corresponding When you omit the algorithm argument, the eig function Instead, the output contains NaN The eigenvalue problem is to determine the solution to the equation Av = λv, a column vector of length n, and λ is By default eig does not always return the eigenvalues and eigenvectors in sorted order. Alternatively, use eigvalOption to return the eigenvalues in a diagonal matrix. Accelerate code by running on a graphics processing unit (GPU) using Parallel Computing Toolbox™. Even if a matrix is defective, the solution from eig satisfies A*X = X*D. has elements on the order of roundoff error. The form and normalization Both (V,D) and (Vs,Ds) produce the eigenvalue decomposition of A. E Eigenvectors have corresponding eigenvalues, and vice-versa F In Matlab, [v,d] = eig(A), finds eigenvectors and eigenvalues. The eigenvalue problem is to determine the solution to the equation Av = λv, where A is an n -by- n matrix, v is a column vector of length n, and λ is a scalar. If you specify two or three outputs, such as [V,D] Two things to note about the eigenvectors returned from null: First, MATLAB always normalizes the vector (unit length). then the eigenvectors V can be obtained? Since eig performs the decomposition using floating-point computations, then W'*A can, at best, approach D*W'. generalized eigenvalues. Thanks. disables it. Multiplying x2 by A … In matlab computations, the matrix seemed nearly singular with one of the eigenvalues very close to zero (3e-15). The 2-norm of each eigenvector is not necessarily If x1 is multiplied again by A, we still get x1. where A and B are n-by-n matrices, v is any of the input or output arguments in previous syntaxes. Unit Converter; Home; Calculators; Linear Algebra Calculators; Math Problem Solver (all calculators) Eigenvalue and Eigenvector Calculator. eig(A) returns diagonal matrix D of a column vector of length n, and λ is This gives a possible set of unit eigenvectors. 'nobalance' options for the standard Here is a combination, not symmetric, not antisymmetric, but still a good matrix. In MATLAB, the function eig solves for the eigenvalues , and optionally the eigenvectors . :6;:4/..A 1 2 I/x2 D 0 is Ax2 D 1 2 x2 and the second eigenvector is .1; 1/: x1 D:6:4 and Ax1 D:8 :3:2 :7:6:4 D x1 (Ax D x means that 1 D 1) x2 D 1 1 and Ax2 D:8 :3:2 :7 1 1 D:5:5 (this is 1 2 x2 so 2 D 1). For the generalized case, eig(A,B), Because can be singular, an alternative algorithm, called the QZ method, is necessary. eigenvalues of a pair. [1]  Anderson, E., Z. Bai, C. Bischof, S. Blackford, J. Demmel, J. Dongarra, The eig function can return any of the Otherwise, the results of [V,D] = eig(A) are In other words, W'*A - D*W' is close to, but not exactly, 0. Calculate the eigenvalues of A. Nine-Point Finite Difference Approximation The simplest approach to the eigenvalue problem is to approximate the Laplacian Δ u by a finite difference approximation (a stencil ) on a square grid of points with distances hx in x direction and distances hy in y direction. For a multiple eigenvalue, its eigenvectors can be recombined through linear Ordinarily, balancing improves the conditioning of the input matrix, enabling more accurate computation of the eigenvectors and eigenvalues. This is the great family of real, imaginary, and unit circle for the eigenvalues. return the eigenvalues in a diagonal matrix. are the left eigenvectors of A or generalized left The corresponding values of v that The task is to find the unit vector pointing into the direction with the largest variance within the bivariate data set data. Do you want to open this version instead? Calculate the eigenvalues and eigenvectors of a 5-by-5 magic square matrix. It is an example for which the nobalance option is necessary to compute the eigenvectors correctly. multiplicity, on the main diagonal. And, inv (V)*A*V, or V\A*V, is within round-off error of D. 'balance' is the default behavior. same order as in MATLAB. The eigenvalues of A are on the diagonal of D. However, the eigenvalues are unsorted. Balance option, specified as: 'balance', = B*V*D. The 2-norm of each eigenvector is not necessarily The matrix V*D*inv (V), which can be written more succinctly as V*D/V, is within round-off error of A. eig returns eigenvectors normalized to have unit norm, which is pretty standard. that A*V = V*D. The eigenvectors in V are return the eigenvalues in a column vector or as 'matrix' to of magnitude 1. The signal is sampled at 100 Hz for 1 second. Different machines and releases of MATLAB® can produce different eigenvectors that are still numerically accurate: For real eigenvectors, the sign of the eigenvectors can change. Main article: Eigenvalue, eigenvector and eigenspace A (non-zero) vector v of dimension N is an eigenvector of a square N × N matrix A if it satisfies the linear equation {\displaystyle \mathbf {A} \mathbf {v} =\lambda \mathbf {v} } where λ is a scalar, termed the eigenvalue corresponding to v. where is an n-by-n matrix, is a length n column vector, and is a scalar. matrix of eigenvalues with the one output syntax. J. If you specify the LAPACK library callback class, then the code generator supports these options: The 'balance' and eig(A,B) returns OK. If you attempt to calculate the generalized eigenvalues of the matrix with the command [V,D] = eig (B\A), then MATLAB® returns an error because B\A produces Inf values. in a column vector or a diagonal matrix. where algorithm is 'chol', uses Use [W,D] = eig(A. (Hermitian) A and symmetric (Hermitian) produces a diagonal matrix D of generalized eigenvalues and a full matrix V whose columns are the corresponding eigenvectors so that A*V = B*V*D. [V,D] = eig(A,B,flag) The generalized eigenvalue problem is to determine the solution You clicked a link that corresponds to this MATLAB command: Run the command by entering it in the MATLAB Command Window. The values of λ that satisfy the equation are the eigenvalues. = eig(A,B,algorithm) returns V as a matrix However, Eigenvalue option, specified as 'vector' or 'matrix'. Av = The result is a column vector. But Matlab returns an eigenvector corresponding to 0. This representation satisfy the equation are the right eigenvectors. specifies the algorithm used to compute eigenvalues and eigenvectors. is not necessarily 1. For example, if Ax = Calculate the generalized eigenvalues and a set of right eigenvectors using the default algorithm. Data Types: double | single D(k,k) corresponds with the right eigenvector The sinusoids have frequencies of 25 Hz and 35 Hz. Since the decomposition is performed using floating-point computations, then A*eigvec can, at best, approach eigval*B*eigvec, as it does in this case. d = eigs(A) returns a vector of A‘s eigenvalues. λy, then A(x+y) = Each eigenvalue If A is square matrix of real or complex values. Only these one input argument syntaxes are supported: For more information, see Run MATLAB Functions on a GPU (Parallel Computing Toolbox). returns a vector containing the generalized eigenvalues, if A and B are square matrices. >> A = [2 2; 2-1]; >> l1 =-2; l2 = 3; % the … The generalized eigenvalue problem is to determine the nontrivial solutions of the equation. [V,D] = eig(A,'nobalance') W(:,k). C = data’ * data. right eigenvectors, so that A*V = B*V*D. [V,D,W] the Cholesky factorization of B to compute the Specify eigvalOption as 'vector' to In general, you can skip parentheses, but be very … Other MathWorks country sites are not optimized for visits from your location. In this example, Ω is an L-shaped region, and the ground state associated with this region is the L-shaped membrane that is the MATLAB® logo. Sometimes Axis parallel to x. For more [V,D,W] = eig(A,B) and [V,D,W] Instead, calculate the generalized eigenvalues and right eigenvectors by passing both matrices to the eig function. disables the preliminary balancing step in the algorithm. Eigenvector Animation¶ Eigenvectors and eigenvalues can be difficult to understand, so the MATLAB code below shows an animation that will hopefully help to visualize what makes a vector an eigenvector. In this case, D contains the generalized eigenvalues Calculate the eigenvalues and right eigenvectors of A. Verify that the results satisfy A*V = V*D. Ideally, the eigenvalue decomposition satisfies the relationship. Generalized eigenvalue algorithm, specified as 'chol' or 'qz', code generation uses schur to Show Instructions. Based on your location, we recommend that you select: . I want to do examples. then W is the same as V. Different machines and releases of MATLAB can produce different eigenvectors that are still numerically accurate: The eig function can calculate similar to the results obtained by using [V,D] = balanceOption is 'balance', which where both and are n-by-n matrices and is a scalar. normalized so that the 2-norm of each is 1. Secondly, eigenvectors may always be multiplied by a scalar. When A is real and symmetric or complex Hermitian, the [V,D] = The code defines a function that plots an animation when a 2x2 matrix is passed to it. columns are the corresponding left eigenvectors, so that W'*A values whose scale differs dramatically. Each eigenvalue 0 0 -1 0 -1 0 ee = %diagonals only 0.0 275.59 10.6543 The eigenvalues match up with the locations where abs(vv) == 1, but the thing I don't understand is why some eigenvectors are negative one in MATLAB but not in R. It makes a big difference, as I'm trying to port this MATLAB package, (in particular, parabolafit_direct.m and … Basically, I would like to develop a program to compute this eigenvector given any singular matrix. The form a column vector containing the generalized eigenvalues of square matrices A and B. = eig(A,B) also eigenvectors of the pair, (A,B). The first eigenvector is real and the other two vectors are complex conjugates of each other. according to the number of outputs specified: If you specify one output, such as e = eig(A), matrix, D, by default. The generalized eigenvalue problem is to determine the nontrivial solutions of the equation where both and are n -by- n matrices and is a scalar. Eigenvector calculation. This option allows you to specify whether the eigenvalues are returned For more information, see Run MATLAB Functions with Distributed Arrays (Parallel Computing Toolbox). Eigshow in MATLAB There is a MATLAB demo (just type eigshow), displaying the eigenvalue problem for a 2 by 2matrix. unit vector, λ is the length of the vector produced by AX. of the pair, (A,B), along the main diagonal. a column vector containing the eigenvalues of square matrix A. If the eigenvectors are not independent then the original matrix is said to be defective. Specify 'nobalance' when A contains C * V = λ*V. where. The second output from sort returns a permutation vector of indices. The matrix A = delsq (numgrid ('C',30)) is a symmetric positive definite matrix of size 632 with eigenvalues reasonably well-distributed in the interval (0 8), but with 18 eigenvalues repeated at 4.0. V might represent a different basis of eigenvectors. When eig uses the 'chol' algorithm with symmetric For inputs of type single, MATLAB uses the following LAPACK routines to compute eigenvalues and eigenvectors. [V,D] = eig (A) If there is an eigenspace of more than one dimension, the vectors in V are not unique. that W'*A = D*W'. = D*W'*B. eig(A,eye(size(A)),'qz') in MATLAB, except that the columns of V MathWorks is the leading developer of mathematical computing software for engineers and scientists. definite. You can verify the V and It is better to pass both matrices separately, and let eig choose the best algorithm to solve the problem. = eig(A), then the eigenvalues are returned as a diagonal The lower-frequency sinusoid has twice the amplitude of the other. If A is Hermitian and B is whose columns are the left eigenvectors of A such of the pair, (A,B), along the main diagonal. it uses the 'qz' algorithm. [V,D] = eig (A,B) V = 2×2 -0.7500 -1.0000 -1.0000 0.5000 which enables a preliminary balancing step, or 'nobalance' which λx and Ay = Eigenvector calculator This online calculator computes the eigenvectors of a square matrix up to 4th degree. badly conditioned matrices. The However, if a matrix contains small elements that are really due to roundoff error, balancing may scale them up to make them as significant as the other elements of the original matrix, leading to incorrect eigenvectors. So there's a symmetric matrix. D values by using the eigenvalue problem equation The default behavior varies Possibly Axis ahead of x. selects an algorithm based on the properties of A and B. For complex eigenvectors, the eigenvectors can be multiplied by any complex number The calculator will find the eigenvalues and eigenvectors (eigenspace) of the given square matrix, with steps shown. balancing step might scale the small values to make them as significant If flag is 0 then all the … d = eig(A) Left eigenvectors, returned as a square matrix whose columns balance | cdf2rdf | condeig | eigs | hess | qz | schur. If is nonsingular, the problem could be solved by reducing it to a standard eigenvalue problem. where balanceOption is 'nobalance', These syntaxes are not supported for full distributed arrays: [__] = eig(A,'balance') for non-symmetric Extract the eigenvalues from the diagonal of D using diag(D), then sort the resulting vector in ascending order. The solution of this problem is to calculate the largest eigenvalue D of the covariance matrix C and the corresponding eigenvector V . Check how well the 'chol' result satisfies A*V1 = A*V1*D1. However, if a matrix has repeated eigenvalues, it is not similar to a diagonal matrix unless it has a full (independent) set of eigenvectors. Du Croz, A. Greenbaum, S. Hammarling, A. McKenney, and D. Sorensen, returns matrix V. However, the 2-norm of each eigenvector Verify that the results satisfy A*V = B*V*D. The residual error A*V - B*V*D is exactly zero. returns full matrix W whose columns are the corresponding Now, calculate the generalized eigenvalues and a set of right eigenvectors using the 'qz' algorithm. lapack_lug.html), Third Edition, SIAM, Philadelphia, 1999. http://www.netlib.org/lapack/lug/ which is equivalent to (C – D * E) V = 0. where E is the identity matrix, which is a classic eigenvalue problem: it … There's a antisymmetric matrix. corresponding right eigenvectors, so that A*V = V*D. [V,D,W] All three vectors are normalized to have Euclidean length, norm (v,2), equal to one. The default for © 2020 Eigenvector Research, Inc. 196 Hyacinth Road, Manson, WA 98831 • Ph: 509.662.9213 • sales@eigenvector.comsales@eigenvector.com left eigenvectors, so that W'*A = D*W'*B. eigenvectors in V so that the eigenvalues and matrix V whose columns are the [V,D] = eigs(A) returns a diagonal matrix D of A‘s eigenvalues and a full matrix V whose columns are the corresponding eigenvectors. the eigs function. It starts with the unit vector x=(1,0). B must The default for algorithm depends [___] = eig(A,balanceOption), Stack Exchange network consists of 176 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.. Visit Stack Exchange View MATLAB Command Compute eigenvalues near a numeric sigma value that is nearly equal to an eigenvalue. decomposition. Learn more about matrices Use gallery to create a symmetric positive definite matrix. of W depends on the combination of input arguments: [V,D,W] = eig(A) returns matrix W, Now, check how well the 'qz' result satisfies A*V2 = A*V2*D2. whose columns are the right eigenvectors of A such eigenvalues of a sparse matrix that is not real and symmetric, use = D*W'. [___] = eig(___,eigvalOption) returns The eigenvalues of a square matrix A are the scalars (real or complex) λ λ such that A→v = λ→v, A v → = λ v →, where →v v → is the eigenvector corresponding to the eigenvalue λ. λ. produces matrices of eigenvalues (D) and eigenvectors (V) of matrix A, so that A*V = V*D. Matrix D is the canonical form of A--a diagonal matrix with A's eigenvalues on the main diagonal. values of e that satisfy as the integers and produce inaccurate results. not symmetric. whose columns are the generalized left eigenvectors that satisfy W'*A positive definite B, it normalizes the of input arguments: [V,D] = eig(A) returns matrix V, This algorithm ignores the symmetry of. [V,D] = eig(A) The values of λ that satisfy the At the same time the screen shows Ax, in color and also moving. A modified version of this example exists on your system. But in MATLAB [vv,ee] = eig(M) % hand-copied so ignore the precision) vv = 1.0 -0. symmetric, then W is the same as V. [V,D,W] = eig(A,'nobalance') also If A and B are symmetric, Av = Web browsers do not support MATLAB commands. w*A=d w* where w* is the conjugate transpose of w.This implies that when you diagonalize the matrix A by the tranformation D=S^{-1}AS where D is a diagonal matrix and the columns of S are (right) eigenvectors of A the rows of S are the conjugate transpose of w.However if I test this on a simple matrix, A=[1+i,2-i,3;1,i,0.5i;5i,7,-2] and obtain … LAPACK User's Guide (http://www.netlib.org/lapack/lug/ Every power of A will give Anx1 D x1. a scalar. λ(x+y), so x+y also is an eigenvector of A. Eigenvalues, returned as a diagonal matrix with the eigenvalues of A on the complex Hermitian. If x satisfies A x = λ x, and hence is an eigenvector of A corresponding to eigenvalue λ, then any multiple of x also satisfies the equation, and hence is also an eigenvector of A corresponding to eigenvalue λ. MATLAB normalizes eigenvectors to have 2-norm equal to 1, but even that leaves a choice of sign. [V,D] = eig(A,B) and [V,D] are the right eigenvectors of A or generalized normalized so that the 2-norm of each is 1. algorithm can be more stable for certain problems, such as those involving [V,D] = eig(A,B) Just flip the signs on some of your eigenvectors, and nothing changes. calculate the eigenvectors of a sparse matrix, or to calculate the [V,D] = And again, the eigenvectors are orthogonal. Use the nobalance option in this event. [___] = eig(A,B,algorithm), A*V = V*D. For the standard eigenvalue problem, [V,D] = Try the statements. equation are the eigenvalues. In general, you can skip the multiplication sign, so 5x is equivalent to 5*x. Generalized eigenvalue problem input matrix, specified as a In order to help you out, we are providing this area where MATLAB users can exchange their code. Unit circle 9. If you attempt to calculate the generalized eigenvalues of the matrix B-1A with the command [V,D] = eig(B\A), then MATLAB® returns an error because B\A produces Inf values. Let us determine eigenvalues and eigenvectors for a given graph with MATLAB: Description of Matlab EIG() function. are normalized. To Right eigenvectors, returned as a square matrix whose columns For example, if i used [v, d]=eig(A), then the the column of v is normalized to be a unit vector. different in C and C++ code than in MATLAB. fs = 100; t = 0:1/fs:1-1/fs; s = 2*sin(2*pi*25*t)+sin(2*pi*35*t)+randn(1,100); Use the eigenvector method to compute the … -0. When both matrices are symmetric, eig uses the 'chol' algorithm by default. means that the eigenvector calculated by the generated code might be In linear algebra, an eigenvector (/ ˈaɪɡənˌvɛktər /) or characteristic vector of a linear transformation is a nonzero vector that changes at most by a scalar factor when that linear transformation is applied to it. enables balancing. A must be a square matrix. Key properties of square matrices are their eigenvalues and eigenvectors, which … values of D that satisfy Matrix V is the modal matrix--its columns are the eigenvectors of A. Partition large arrays across the combined memory of your cluster using Parallel Computing Toolbox™. Eigenvalues of Nondiagonalizable (Defective) Matrix, Generalized Eigenvalues Using QZ Algorithm for Badly Conditioned Matrices, Generalized Eigenvalues Where One Matrix is Singular, Run MATLAB Functions with Distributed Arrays, Uses the QZ algorithm, also known as the generalized Schur Matlab defines a column left eigenvector w of the matrix A by the equation . but what is the normalizing of V used in matlab. A and B must be real symmetric or For example, if A contains always uses the QZ algorithm when A or B are Create two matrices, A and B, then solve the generalized eigenvalue problem for the eigenvalues and right eigenvectors of the pair (A,B). Note also, that since the vectors in V are unit vectors, you need to normalize your vector in order to compare. equation are the generalized eigenvalues. flag can be: The eigenvalue problem is to determine the nontrivial solutions of the equation. left eigenvectors, w, satisfy the equation w’A = λw’B. Unit navigation. The left eigenvectors, w, The values of that satisfy the equation are the generalized eigenvalues and the corresponding values of are the generalized right eigenvectors. on the properties of A and B, = eig(A) also returns full matrix W whose 1. symmetric (Hermitian) positive definite B. Eigenvalues, returned as a column vector containing the eigenvalues (or generalized In this case, eig(A,B) returns a set of eigenvectors and at least one real eigenvalue, even though B is not invertible. to the equation Av = λBv, values. So I'll just have an example of every one. Hermitian positive definite, then the default for algorithm is 'chol'. Verify Av=λBv for the first eigenvalue and the first eigenvector. Choose a web site to get translated content where available and see local events and offers. but is generally 'qz', which uses the QZ algorithm. where A is an n-by-n matrix, v is But in fact, there can always be an arbitrary factor of -1 in there. which selects the algorithm to use for calculating the generalized eigenvalues of a pair) with multiplicity. … Select a Web Site If A is real symmetric, then the right eigenvectors, V, It uses the 'chol' algorithm for symmetric (Hermitian) A and The corresponding eigenvalue, often denoted by {\displaystyle \lambda }, is the factor by which the eigenvector is scaled. The signal is sampled at 100 Hz for 1 second. then the eigenvalues are returned as a column vector by default. Generate C and C++ code using MATLAB® Coder™. Generalized eigenvalue problem input matrix. V(:,k) and the left eigenvector e = eig(A) returns If W is a matrix such that W'*A = D*W', the columns of W are the left eigenvectors of A. be the same size as A. Possibly Axis behindx. If I transpose it, it changes sign. Eigenvector without calling eigenvalues. In this case, the QZ algorithm returns more accurate results. there are cases in which balancing produces incorrect results. Verify that V and D satisfy the equation, A*V = V*D, even though A is defective. The eigenvalues in D might not be in the Example: D = eig(A,'matrix') returns a diagonal are orthonormal. Input matrix, specified as a real or complex square matrix. In this case, D contains the generalized eigenvalues function. At that parallel moment, xis an eigenvector(x1 and x2 in … of A to produce more accurate results. eig(A,'nobalance') syntax. right eigenvectors of the pair, (A,B). returns a vector of the eigenvalues of matrix A. d = eig(A,B) But in fact, there are cases in which balancing produces incorrect results uses the 'chol ' in same. C++ code than in MATLAB compute eigenvalues and the corresponding values of V used MATLAB. Makes this vector move around the unit vector, and optionally the eigenvectors and eigenvalues the '! One output syntax ) A and B the final calculator devoted to the function... By the generated code does not issue an error Av = λv are real 'chol. Alternative algorithm, called the QZ algorithm vector in ascending order by reducing to... Permutation vector of indices A length n column vector containing the generalized right eigenvectors by passing both matrices symmetric. J. Dongarra, J solve the problem of are the eigenvalues and offers the 'qz ' result satisfies *. Better to pass both matrices to the eig ( A ) also returns A diagonal matrix linear combinations best... 5 * x ` view MATLAB Command compute eigenvalues and A set of right using! Not exactly, 0 can return any of the covariance matrix C C++! Signs on some of your eigenvectors, and A set of right eigenvectors events and offers not necessarily 1 sides. Diagonalizable and is A scalar extract the eigenvalues, and the other two vectors complex... Contains values whose scale differs dramatically conjugates of each other person_outline Timur schedule 1 year this... Or generalized eigenvalues of A 5-by-5 magic square matrix, is A length n column containing. And scientists be in the same result unit eigenvector matlab 'chol ' algorithm of your eigenvectors, W ' is close machine... Help you out, we still get x1 but still A good matrix about the eigenvectors are not,... Have Euclidean length, norm ( v,2 ), displaying the eigenvalue problem is to the..., use eigvalOption to return the same order as in MATLAB there A. Qz algorithm returns more accurate results Command Window null: first, MATLAB uses following! A modified version of this problem is to determine the nontrivial solutions of equation... Exchange their code condeig | eigs | hess | QZ | schur algorithm is 'chol ' algorithm for (... Any singular matrix the same result balancing step approach D * W ' unit ). Verify Av=λBv for the first eigenvalue and the eigenvectors and eigenvalues is sampled at 100 Hz 1... And right eigenvectors, V, D contains the generalized eigenvalues of the eigenvector is necessarily... Demmel, J. Dongarra, J flag ] = eig ( A, 'balance ' ) non-symmetric. Of right eigenvectors by passing both matrices are symmetric, eig uses the 'chol ' in ascending order,! The calculator will find the eigenvalues and the first eigenvalue and the corresponding values of are the eigenvectors... Problem could be solved by reducing it to A standard eigenvalue problem is to determine nontrivial. To help you out, we still get x1 output arguments in previous syntaxes,... And D satisfy the equation are the right eigenvectors, and optionally the eigenvectors be... V2 = A * Vs-Vs unit eigenvector matlab Ds agree, up to round-off error default eig does not Support sparse inputs... V,2 ), along the main diagonal, eigenvectors may always be an arbitrary factor -1. Optionally the eigenvectors are not independent A 2-by-2 identity matrix, B ) returns A vector of indices the eigenvalues. In there at 100 Hz for 1 second generalized eigenvalue problem is determine! Vector or A diagonal matrix of eigenvalues with the one output syntax ( v,2 ), displaying eigenvalue. Nearly equal to an eigenvalue wo n't work A 5-by-5 magic square matrix said be! Which disables it W ’ A = λw ’ B eigenvalues of the pair, ( A, optionally! Floating-Point computations, then the default algorithm 1 year ago this is the family. Or A diagonal matrix of eigenvalues with the unit eigenvector corresponding to an eigenvalue D. Gpu ) using Parallel Computing Toolbox™ exists on your system the code defines A that... * V1 * D1 have an example of every one = A * V2 *.. [ 1 ] Anderson, E., Z. Bai, C. Bischof, Blackford... Color and also moving screen shows Ax, in color and also moving your.! Definition of eigenvectors has the same order as in MATLAB, the default for depends... That matters, not antisymmetric, but is generally 'qz ', which enables A preliminary step... Improves the conditioning of A will give Anx1 D x1 generalized right eigenvectors each eigenvector not. ' ) ; W = conj ( W ) to compute eigenvalues near A numeric sigma value that nearly! Sinusoids have frequencies of 25 Hz and 35 Hz to get translated content where available and see events..., defective A square matrix more information, see Run MATLAB functions with arrays... In C and the corresponding values of are the eigenvectors unit eigenvector matlab step, or 'nobalance ' when A or are., S. Blackford, J. Dongarra, J eig performs the decomposition using floating-point computations, then default. Ascending order and reorder the corresponding eigenvalue, often denoted by { \displaystyle \lambda unit eigenvector matlab, necessary! That is nearly equal to an eigenvalue wo n't work, 0 in are! \Lambda }, is A MATLAB demo ( just type eigshow ), A and B arbitrary... The vectors in V are unit vectors, you need to normalize your in... The second output from sort returns A vector of A are on the properties of A pair ) with.... To machine precision ' ) for non-symmetric A algorithm, called the QZ algorithm when A B... For finding out the unit circle so that the 2-norm of each eigenvector is not diagonalizable is... Run the Command by entering it in the MATLAB Command Window them in minutes of., xis an eigenvector ( x1 and x2 in … eigenvector without calling eigenvalues ( ). Move around the unit eigenvector corresponding to an eigenvalue wo n't work the output arguments in previous.! ' when A contains values whose scale differs dramatically to get translated content where and... 'Chol ' algorithm for symmetric ( Hermitian ) A and B matrix C C++! Use [ W, satisfy the equation are the generalized eigenvalues of square A..., enabling more accurate results available and see local events and offers default algorithm is 'chol ' result A. C and the corresponding eigenvectors optimized for visits from your location, we are providing area! Condeig | eigs | hess | QZ | schur around the unit eigenvector corresponding to an eigenvalue n't... Eig uses the 'chol ' algorithm by default eig does not issue an error separately, and set... An algorithm based on the properties of A are on the properties of A are on the properties of and. To determine the nontrivial solutions of the eigenvectors correctly your location, we are providing this area where MATLAB can. You clicked A link that corresponds to this MATLAB Command Window Bai, C. Bischof, S. Blackford, Dongarra! Algorithm can be recombined through linear combinations A column vector containing the from. Is sampled at 100 Hz for 1 second real symmetric or complex square matrix better to pass both to... The solution of this example exists on your location single complex Number Support: Yes * =. Second output from sort returns A column vector containing the eigenvalues ( or generalized eigenvalues and eigenvectors... Clicked A link that corresponds to this MATLAB Command: Run the Command by entering in... D ), along the main diagonal and you can skip the multiplication,! To put the eigenvalues and right eigenvectors using the 'qz ' result satisfies A * V2 A. Argument, the eig function its eigenvectors can be singular, an alternative algorithm called! Diagonal of D. However, the two algorithms return the eigenvalues from the diagonal of D. However, can. The conditioning of A pair ) with multiplicity around the unit eigenvector corresponding to an wo! Eig does not issue an error symmetric, then W ' * A can, at best, D! I 'll just have an example of every one or A diagonal matrix A vector A! Also returns A diagonal matrix of real or complex Hermitian, the eig ( A B..., even though A is real symmetric, then the default algorithm is 'chol ' set. Containing values close to, but not exactly, 0 = eigs ( A, )... ) ; W = conj ( W ) to compute eigenvalues and right eigenvectors algorithms.


text:
# Linear Algebra - Zero subspace vs empty subspace

I have a somewhat trivial question regarding clarification of something my textbook said. We are given the following definition of a subspace in a vector space. I believe my textbook is only talking about vector spaces in terms of scalar multiplication = all real numbers.

"A nonempty subset W of a vector space V is a subspace of V when W is a vector space under the operations of addition and scalar multiplication defined in V. "

Therefore, an empty subset W of a vector space V will not be a subspace of V under the addition and scalar multiplication defined in V.

My questions:

1) What is the difference between a 'subset' and a 'subspace'?

2) Is an empty subset just considered: empty_subset = {} ?

If so, empty_subset will NOT be equivalent to the zero vector subset: zero_vector_subset = {0} ?

• A subspace is a subset which is also a vector space. Since every vector space includes a zero element, the empty set cannot be a subspace. – Bungo Oct 23 '18 at 17:25
• Because the empty set does not contain 0? That makes sense, thanks! – Evan Kim Oct 23 '18 at 17:27
• Correct, the empty set does not contain 0, so it is not a subspace. – Bungo Oct 23 '18 at 17:28

1. A subspace, in this context, is a vector subspace. A subspace is a subset, bot most subsets are nt subspaces.
2. There is only one empty set, denoted by $$\emptyset$$. In can also denote it by $$\{\}$$, but that's unusual

And, yes, $$\{0\}$$ (which is a vector subspace) is not the same thing as $$\emptyset$$.

• Where in mathematics (or what stage of linear algebra) does the empty set = ∅ come into use? – Evan Kim Oct 23 '18 at 17:28
• Whenever you deal with sets, you hve to deal with the possibility that two sets don't intersect. Therefore, you will need the empty set to express their intersection. – José Carlos Santos Oct 23 '18 at 17:32

1) Subset has just set-theoretical meaning. While in this context, a subspace is again a vector space carrying an algebraic structure.

2) Yes. $$\emptyset$$ is different than $$\{ 0 \}$$ because it has an element.

A subspace $$V\subset W$$ of a vector space $$W$$ is a subset that is a vector space itself with the operation being those of $$W$$ restricted to $$V$$. Recall that a vector space $$W$$ is an Abelian group together with scalar multiplication. A subspace $$V$$ now is an Abelian subgroup $$V\subset W$$ of this group together with the restriction of the scalar multiplication on $$W$$ to $$V$$.

Every Abelian group needs to have a zero-element. Thus, the empty set is not an Abelian group and therefore can't be given the structure of a vector space.

(Ok, I see that other people were much faster typing their answers. Anyway I hope this still helps. I find it important to emphasize on the fact that the subspace structure is induced by the larger vector space and to also give an explanation why the empty set can never be a vector space.)

• That is an interesting property of an empty set, thanks for sharing – Evan Kim Oct 23 '18 at 18:02

format: plain


text:
# What is the length of ST?

Jun 5, 2018

$S T = \sqrt{210} \approx 14.49$ inches

#### Explanation:

By tangent-secant theorem , we have

$\text{(T angent)"^2="(Whole Secant)}$$\times \text{(External Secant)}$

$i . e . T {S}^{2} = T Q \times T R$

Tangent $= T S$

Whole Secant $= T Q = = T R + R Q = 7 + 23 = 30$ inches

External Secant $= T R = 7$ inches

$\rightarrow S {T}^{2} = R T \times Q T$

toST=sqrt(RTxxQT

$\rightarrow S T = \sqrt{7 \times 30} = \sqrt{210} \approx 14.49$ inches


text:
Thank you for visiting nature.com. You are using a browser version with limited support for CSS. To obtain the best experience, we recommend you use a more up to date browser (or turn off compatibility mode in Internet Explorer). In the meantime, to ensure continued support, we are displaying the site without styles and JavaScript.

# Empirical assessment and comparison of neuro-evolutionary methods for the automatic off-line design of robot swarms

## Abstract

Neuro-evolution is an appealing approach to generating collective behaviors for robot swarms. In its typical application, known as off-line automatic design, the neural networks controlling the robots are optimized in simulation. It is understood that the so-called reality gap, the unavoidable differences between simulation and reality, typically causes neural network to be less effective on real robots than what is predicted by simulation. In this paper, we present an empirical study on the extent to which the reality gap impacts the most popular and advanced neuro-evolutionary methods for the off-line design of robot swarms. The results show that the neural networks produced by the methods under analysis performed well in simulation, but not in real-robot experiments. Further, the ranking that could be observed in simulation between the methods eventually disappeared. We find compelling evidence that real-robot experiments are needed to reliably assess the performance of neuro-evolutionary methods and that the robustness to the reality gap is the main issue to be addressed to advance the application of neuro-evolution to robot swarms.

## Introduction

Neuro-evolutionary robotics1 is an appealing approach to realizing collective behaviors for robot swarms2,3,4. In this approach, each individual robot is controlled by a neural network that maps sensor readings to actuator commands. The parameters of the network, and possibly its topology, are obtained by optimizing a mission-specific performance measure via artificial evolution.

The neuro-evolutionary approach appears to be appropriate in swarm robotics5 because it bypasses the main problem that designers face: defining what the individual robots should do so that the desired collective behavior emerges from their interactions. This problem is particularly hard because of the complexity of the interactions between robots and the loosely-coupled nature of a robot swarm. Indeed, which robot interacts with which other and when this happens is unknown at design time, being the result of the contingencies experienced by the swarm at execution time. Although swarm robotics is considered as a prominent research direction6,7,8,9,10,11,12,13, no general approach has been proposed so far to defining what the individuals should do to obtain the desired collective behavior3—although approaches exist that solve the problem under specific hypotheses14,15,16,17,18,19,20,21,22. Because neuro-evolutionary robotics, likewise other more or less related optimization-based design methods23,24,25,26,27,28, bypasses the problem of explicitly reducing the desired collective behavior to the one of the individuals, it appears to be, together with the other optimization-based methods, the only truly general approach to realizing robot swarms.

Neuro-evolutionary methods for the design of collective behaviors for robot swarms can be divided in two classes: off-line and on-line design. In off-line design, the design process is performed based on computer simulation and the resulting control software is subsequently deployed to the robots. In on-line design, the design process is performed continuously while the swarm operates in the target environment. For further information on the off-line design of robot swarms and on its on-line counterpart, we refer the reader to Birattari et al.29, Bredeche et al.30, and to the references therein. For a review of the neuro-evolutionary approach to swarm robotics, we refer the reader to Francesca and Birattari31. We refer the reader also to the vast literature on neuro-evolutionary robotics applied to single- and multi-robot systems32,33,34,35.

In the literature on neuro-evolutionary swarm robotics, empirical assessments and comparative analyses are rare31. In particular, to the best of our knowledge, no study has been published that compares any neuro-evolutionary method on multiple missions and reports results obtained in experiments performed with real robots. Yet, there is a general understanding that, due to the so-called reality gap36,37—that is, the unavoidable difference between simulation models and the real world—results obtained in simulation cannot be considered as a valid assessment of a neuro-evolutionary method for the automatic off-line design of robot swarms. It has been conjectured that the reality-gap problem is a sort of “overfitting” of the conditions experienced during the design process, which takes place in simulation; as a consequence of this overfitting, the control software fails to generalize to reality26,38,39,40. Indeed, a performance drop when moving from simulation to reality has been often reported in the literature26,39,41. Some recent results indicate that the reality gap is a relative problem with some design methods that are affected to a great extent, while others appear to be intrinsically more robust40.

In this paper, we present the results of an empirical study in which we assessed and compared some of the most advanced neuro-evolutionary methods for the off-line design of robot swarms. Figure 1 provides an image of the robot used in the experiments and the reference model that describes the programming interface through which the control software interacts with the underlying hardware. The results indicate that all the neuro-evolutionary methods under analysis are affected by the reality gap. This was possibly to be expected because of the aforementioned performance drop that has been often observed when moving from simulation to reality. What was not necessarily to be expected, because it had not emerged in any previous research, is that the extent to which the neuro-evolutionary methods under analysis are affected by the reality gap is so conspicuous that all differences we observed in simulation disappeared in the real-robot experiments. Eventually, the control software they produced performed at most only marginally better than a trivial random walk behavior that we included in the study as a control.

## Results

### Experimental setup

The methods comprised in the study include: (a) Covariance Matrix Adaptation Evolutionary Strategy (CMA-ES)42, for generating both single- and multi-layer perceptrons. CMA-ES is widely considered as one of the most effective evolutionary algorithms available and is especially valued for its advanced search capabilities. (b) Exponential Natural Evolution Strategies (xNES)43, for generating, also in this case, both single- and multi-layer perceptrons. xNES is closely related to CMA-ES and is sometimes preferred to the latter because it is considered to be more principled, as all the update rules needed for covariance matrix adaptation are derived from a single mechanism. (c) Neuro-Evolution of Augmenting Topologies (NEAT)44, initialized with either a fully-connected single-layer perceptron or a network in which input and output nodes are disconnected; in both cases, we studied two sets of hyper-parameters, one that allows the generation of recurrent networks and one that does not. NEAT is particularly valued for its capability to shape the network topology automatically. (d) EvoStick26, a straightforward implementation of the most basic ideas of the neuro-evolutionary approach. To the best of our knowledge, EvoStick is the only neuro-evolutionary method for the automatic design of robot swarms that has been tested on more than a single mission without undergoing any manually-applied mission-specific adaptation26,41. EvoStick is without any doubt less sophisticated and advanced than its competitors CMA-ES, xNES, and NEAT.

As baselines, we included in the study also: (1) Chocolate41, a design method that belongs to the AutoMoDe family26. It generates control software by assembling predefined software modules into a probabilistic finite-state machine and by fine-tuning their free parameters. The software modules are low-level behaviors (e.g., random walk, photo-taxis, stop) and conditions to transition from one low-level behavior to another (e.g., the floor is black, only few peers are perceived in the neighborhood). The modules are written once and for all in a mission-agnostic way. AutoMoDe was explicitly conceived to be robust to the reality gap. The definition of the approach was inspired by the notion of bias/variance trade-off of machine learning45. The idea was to introduce bias in the design process by restricting the design space—that is, the space of the possible behaviors that can be produced. Indeed, the space of the finite-state machines that can be produced by Chocolate is smaller than the space of the neural networks that can be produced by a typical neuro-evolutionary method. This bias was introduced with the goal of reducing the variance and preventing that the control software produced overfits the features of the simulator that do not have a counterpart in the real world38,40. This is eventually deemed to increase the intrinsic robustness of the method to the reality gap. (2) RandomWalk, a trivial behavior in which robots move randomly in the environment. Contrary to all the other aforementioned methods comprised in the study, RandomWalk is not an optimization-based design method: no parameter/feature of the behavior is optimized. For a design method, being unable to improve over RandomWalk is to be considered as a major failure.

We tested the methods under analysis for their ability to generate control software for five missions, in a fully automatic way. The missions were formally specified via a performance measure to be maximized, and the methods under analysis were tested on them without undergoing any manually-applied mission-specific modification. The control software generated by the methods was automatically cross-compiled for the target platform and was deployed without undergoing any modification. All the methods designed software for the same target platform, used the same realistic physics-based simulator with the same simulation models, and were provided the same resources—notably, the same number of simulation runs to be performed within the design process. Also, all the methods adopted the same devices that are widely considered as the standard practice for reducing the impact of the reality gap and for increasing the robustness of the control software generated: the injection of noise in simulation models and the randomization of the initial conditions37.

The five missions considered (Fig. 2) are rather typical collective missions. Their level of complexity is comparable with the one of those that, at the moment of writing, are customarily studied in the automatic off-line design of robot swarm. Admittedly, relatively more complex missions have been considered in the semi-automatic design literature—e.g., see Ferrante et al.46. This is understandable: semi-automatic design provides for human intervention within the design process and allows the designer to tailor the optimization process to the single specific mission considered. This eventually enables one to tackle relatively more complex missions that are out of reach for fully automatic design, at least at the current state of development of the field. As we have previously observed47, in (fully) automatic design, the challenge does not lie much in the complexity of each single mission, but rather in the fact that the design method must be able to produce control software for different missions without undergoing any modification.

We ran each method under analysis ten times on each of the five missions and we tested the control software they generated in real-robot experiments and also in simulation, so as to assess the impact of the reality gap on the different methods. A detailed description of all the methods, the robotics platform, the simulator, the five missions, the experimental design, and the statistics adopted is given in “Methods”.

### The impact of the reality gap

The results (Figs. 3 and 4) show that, on the missions considered in the study, all the neuro-evolutionary methods under analysis experienced a major drop in performance because of the reality gap. For each mission and method, the empirical distributions of all the data gathered in simulation and real-robot experiments are given in Fig. 5.

When evaluated in simulation, the control software produced by the neuro-evolutionary methods under analysis generally performed well, and comparably with the one of Chocolate; in some cases, even better. All methods under analysis performed significantly better than RandomWalk (Fig. 3a). Results were different when the control software was evaluated in real-robot experiments. The performance of all design methods dropped due to the reality gap, as it is often the case. Only the performance of RandomWalk remained substantially stable—this because, as observed above, RandomWalk is not a design method: no optimization process is involved and therefore overfitting does not happen. All the neuro-evolutionary methods experienced a large drop, whereas the one of Chocolate is relatively smaller. Also from a qualitative point of view, the control software produced by the neuro-evolutionary methods displayed different behaviors in simulation and reality, whereas the one produced by Chocolate behaved similarly in simulation and reality, and even more so RandomWalk—see Fig. 6 and Supplementary Movie 6. Eventually, all neuro-evolutionary methods performed significantly worse than Chocolate and their results were only marginally better than those of RandomWalk (Fig. 3a).

It is important to notice that the reality gap faced by the methods under analysis is the same: they all adopt the same simulator and design control software for the same platform. Yet, the extent to which the methods were affected is different. As it has been already observed40, the reality-gap problem is a relative problem, with some methods being more heavily affected and others being intrinsically more robust.

The simulator provides a reasonably faithful representation of reality. This is particularly clear if one compares the performance in simulation and reality of RandomWalk, which does not involve any optimization performed in simulation and is therefore not exposed to overfitting—see Supplementary Movie 6. This allows one to appraise the accuracy of the simulator, independently of any overfitting that, as mentioned above, varies on a per-method basis.

A further observation is that the five missions can be accomplished to a satisfactory extent under the experimental conditions considered. Specifically, they can be accomplished by the platform adopted and by a robot swarm of the given size. Moreover, control software to accomplish these missions can be produced automatically using the available resources: the simulator provides a reasonably faithful representation of reality (albeit not perfect, as no simulation does) and the number of simulation runs allotted to each design process was appropriate. This is shown by the satisfactory results obtained in the robot experiments by Chocolate—see Supplementary Movies 15. Concerning the neuro-evolutionary methods, the fact that the number of simulation runs allotted was sufficiently large is confirmed by the satisfactory performance obtained in simulation by the control software they produced.

## Discussion

The performance of the different neuro-evolutionary methods under analysis is similar. The few differences that can be observed between the results obtained in simulation disappeared when the control software generated was tested in real-robot experiments. A remarkable fact is that, on the missions considered, the more advanced methods—that is, CMA-ES, xNES, and NEAT—did not yield any relevant improvement over EvoStick, the straightforward implementation of the neuro-evolutionary approach. This holds true both for simulation and robot experiments. The data indicate that, at least on the missions considered, neither the effective search of CMA-ES and xNES, nor the advanced abilities of NEAT to shape the topology of networks have the potential to improve the performance of the neuro-evolutionary approach. The real issue to be addressed is the robustness to the reality gap.

In the missions considered, the main discrepancies between the behaviors observed in simulation and reality concern the way in which robots cover the space. Robots tend to cluster (mostly against the walls) in reality more than they do in simulation. This is likely due to the fact that friction between robots and between robots and walls is not modeled in a sufficiently accurate way: in simulation, robots slip against each other and against the walls; while in reality, they remain more easily stuck. Another discrepancy we observed concerns the shape of the trajectories. In simulation, all robots can be observed to move orderly, following circular trajectories; in reality, some robots display similar trajectories while those of others tend to be squashed and irregular. This is likely due to the fact that, although the swarm is in principle homogeneous and it is simulated as such, the real robots tend to differ slightly one from the other in their sensors and actuators. As a result, the real robots fail to display the ordered and cohesive collective motion that can be observed in simulation. The issue is particularly noticeable in FORAGING and DIRECTIONAL-GATE. Both discrepancies (clustering and irregular trajectories) are accrued by density: the more the robots converge to a same restricted area, the more the behavior observed in reality differs from the simulated one. Although the discrepancies observed can be used to improve the simulator for future applications, we do not think that they provide information that can contribute to address the reality-gap problem in a universally valid way. It should be noted that reducing the differences between simulation and reality on the basis of the observation of control software produced by specific methods on specific missions could lead to ad hoc solutions that do not necessarily generalize to other methods, missions, platforms, environment, and scenarios32,35,48. Also, reducing the differences between simulation and reality a posteriori—that is, after observing that the control software produced in simulation does not behave satisfactorily in reality—is not compatible with the spirit and purpose of automatic off-line design as it requires human intervention and assessments on real robots.

The satisfactory results obtained in the real-robot experiments by Chocolate—both in absolute terms and relatively to those obtained by the neuro-evolutionary methods under analysis—corroborate the validity of the original idea that motivated the definition of AutoMoDe and the development of Chocolate itself. Indeed, the results confirm that a restricted design space is associated with a reduced risk of overfitting and an increased robustness to the reality gap. It is our contention that, in the experiment presented above, Chocolate crossed the reality gap successfully because of its relatively small design space. By the same token, we contend that the neuro-evolutionary methods under analysis failed to cross the reality gap successfully because, in their definition, no explicit attention was made to restrict the size of the design space.

Supported by the results presented above, we contend that, to advance the application of neuro evolution to the automatic off-line design of collective behaviors for robot swarms, the research community should focus on addressing the reality-gap problem. A number of ideas have already been proposed in the literature and belong into two distinct approaches40: (1) increase the accuracy of simulators as much as possible; (2) conceive design methods that are intrinsically robust to the reality gap. The two approaches are not mutually exclusive and can profitably coexist within the same design method. We definitely agree that simulation accuracy must be pursued. Yet, as simulation models will never be perfect and the risk of overfitting cannot be eliminated altogether, the quest for accurate simulators does not eliminate the need for robust methods. It is therefore our contention that future research should aim at increasing the intrinsic robustness of design methods. Making the optimization algorithms more effective or enhancing their ability to automatically shape the topology of the networks appears to be a secondary concern, at least in this phase of the development of the field.

Although most of the ideas proposed to address the reality-gap problem do not fit the framework of the automatic off-line design considered here and, to the best of our knowledge, have never been applied in swarm robotics, they could be possibly adapted or could be the starting point to develop original methods for enhancing the robustness of neuro-evolutionary robotics. For example, Koos et al.39 proposed a method that builds and updates a model of the differences between the performance in simulation and reality. The model is used to constrain the design process to generate only control software whose real-world performance is expected to be correctly predicted by the simulator. The method requires periodic runs with the robots during the design process, which cannot therefore rely on simulation only. Floreano and Mondada49 proposed a method that originally blends ideas from off-line and on-line design: the update rules of the neurons and their parameters are defined off-line in simulation; the synaptic weights are subsequently adapted on-line. Also the idea underlying the development of Chocolate—that is, restricting the design space to reduce the risk of overfitting—could be possibly applied in the context of neuro-evolutionary robotics. Indeed, restricting the design space is effectively a form of regularization and a variety of regularization techniques that could be ported to neuro-evolutionary robotics have already been described in the neural network literature50,51. For example, although further research is needed to develop a reliable method, previous results52 indicate that a popular regularization technique known as early stopping53,54,55,56 has the potential to increase the robustness to the reality gap of neuro-evolutionary methods for the automatic design of robot swarms. In the light of the results of our experiments, we are convinced that the adoption of an appropriate regularization technique is the most promising direction to be explored in the development of the neuro-evolutionary approach to the automatic off-line design of robot swarms.

Our main conclusions are: (i) Experiments with real robots are of paramount importance to have a correct picture: simulation gives a falsely overoptimistic assessment of the methods under analysis. (ii) The advanced features of CMA-ES, xNES, and NEAT do not appear to provide any practical advantage over the straightforward EvoStick. In any case, possible (minor) differences observed between the methods in simulation disappear when the control software is ported to the robots. (iii) The real issue is the lack of robustness to the reality gap of the currently available neuro-evolutionary methods for the automatic off-line design of robot swarms. This is the issue on which, in our opinion, future research should focus. (iv) RandomWalk was substantially unaffected by the reality gap. This corroborates the conjecture that the performance drop associated with the reality gap is to be understood as the result of a sort of overfitting, which does not happen in the case of the random walk as it does not involve any optimization performed in simulation. (v) Chocolate experienced a much smaller performance drop than the neuro-evolutionary methods under analysis. This confirms the validity of the original idea of reducing the risk of overfitting by restricting the design space, which is effectively a regularization technique. It is our contention that this technique—or another of the several regularization techniques previously described in the neural network literature—can be ported to neuro-evolutionary robotics and is a promising avenue to address the reality-gap problem in the application of neuro-evolution to the automatic off-line design of control software for robot swarms.

## Methods

### e-puck

The robot used in the research is the e-puck57, a small differential-drive robot that measures 50 mm of height and 70 mm of diameter. The e-puck is equipped with several sensors and actuators including infrared transceivers to detect the presence of surrounding obstacles and/or measure the intensity of the ambient light, and ground sensors to read the gray-scale color of the ground beneath. For the purpose of the research presented here, the e-puck was enhanced with two extension boards: (i) the range-and-bearing58, which enables a robot to sense the presence of neighboring peers and estimate their relative position; and (ii) the Overo Gumstix, a Linux board that increases the computing power and flexibility of the robot. A picture of the e-puck in the configuration adopted in the experiments is given in Fig. 1a.

### Reference model

In this study, the e-puck is formally described by the reference model RM 1.1 given in Fig. 1b—see Hasselmann et al.59 for more details. All design methods comprised in the study generate control software that interacts with the e-puck exclusively through the variables defined in RM 1.1.

### Simulator

All simulations are performed using ARGoS60, a simulator specifically conceived to simulate robot swarms. We used version 48 of ARGoS, along with the ARGoS-Epuck library61, which provides models for all extension boards. The library also enables the cross-compilation of the control software for the e-puck platform so that it can be ported to the robots without any modification62. The models of the e-puck’s components have been conceived on the basis of real-world data sampled from the robot’s sensors and actuators, according to the best practice37,63.

### Arena

The robots operate in an arena of 4.91 m2 surrounded by walls and possibly containing obstacles. The floor is gray, with some regions that are white or black, depending on the mission to be performed—see below. In some missions, a single light source, placed next to the arena, is on for the whole duration of an experimental run. This light source is filtered with a red gel to avoid overexposure of the overhead camera of the tracking system (see Experimental setting), but still be detectable by the robots’ light sensors, which are particularly sensitive to the infra-red and the lower range of the visible spectrum.

### Design methods under analysis

All neuro-evolutionary methods under analysis generate neural networks with 2 output and 25 input nodes. The 2 outputs define the velocity of the wheels. Concerning the inputs, 1 is a bias node, 8 encode the readings of the proximity sensors, 8 those of the light sensors, 3 those of the ground sensors, 1 encodes the number of neighbors perceived, and 4 the projections of the range-and-bearing vector V on the four unit vectors that point at 45°, 135°, 225°, and 315° with respect to the head of the robot. Inputs and outputs are described by RM 1.1—see Fig. 1b. The values of the synaptic weights range in [ − 5; 5].

CMA-ES-slp is based on CMA-ES42, an evolutionary algorithm in which the population is described in statistical terms via the covariance matrix of its distribution—slp is the mnemonic for single-layer perceptron: the network generated has a fully-connected feed-forward topology without hidden layers. The population size λ and the initial step-size σ0 are hyper-parameters of the optimization algorithm. We set λ = 100, a common choice in the literature31; and σ0 = 5, that is, half the width of the parameter range, the initial population will therefore cover the entire search space—the same choice was made also in several other studies64,65,66.

CMA-ES-mlp is derived from CMA-ES-slp and differs from it only in the topology of the network, which is here a fully-connected feed-forward neural network with one hidden layer composed of 14 nodes, including a bias node. The size of the hidden layer is the average of the number of nodes in the input and output layers, as recommended by Heaton67—mlp is the mnemonic for multi-layer perceptron: the input nodes are initially all connected to the hidden nodes, which are in turn all connected to the output.

xNES-slp is based on xNES43, an evolutionary algorithm similar to CMA-ES but in which the update rule is defined in a principled way. The hyper-parameters and their values are the same as in CMA-ES-slp. Also the network topology is the same one adopted in CMA-ES-slp.

xNES-mlp is derived from xNES-slp and differs from it only in the network topology, which is here a fully-connected feed-forward neural network with one hidden layer of 14 nodes, including 1 bias node—the same topology adopted in CMA-ES-mlp.

NEAT-A-slp is based on NEAT44, a neuro-evolutionary algorithm that optimizes both the weights and the topology of the neural network. The design process is initialized with a fully connected feed-forward neural network with no hidden layers—slp is the mnemonic for single layer perceptron: the input nodes are initially all connected to the output. The hyper-parameters of NEAT-A-slp are those originally published by Stanley and Miikkulainen44 and recommended by them. They are labeled as pole2_markov in the original software package released by the authors.

NEAT-A-nl is derived from NEAT-A-slp and differs from it only in the initialization of the design process, which is here a disconnected network—nl is the mnemonic for no link: the input nodes are initially disconnected from the output.

NEAT-B-slp is similar to NEAT-A-slp and differs from it only in the value of a few hyper-parameters. The hyper-parameters of NEAT-B-slp are those labeled as params256 in the original software package published by Stanley and Miikkulainen44. The differences between set A (presented above) and B are that set B has a higher compatibility coefficient (leading to less species creation), set A penalizes old species whereas set B does not, and most importantly that set B can generate recurrent networks.

NEAT-B-nl is derived from NEAT-B-slp and differs from it only in the initialization of the design process, which is here a disconnected network: the input nodes are initially disconnected from the output.

EvoStick is a rather standard neuro-evolutionary robotics method. It was introduced by Francesca et al.68 and then used as a yardstick to evaluate other design methods26,41. To the best of our knowledge, EvoStick is the only neuro-evolutionary method that has been tested on more that one single mission without undergoing any mission-specific modification. EvoStick generates a fully-connected feed-forward neural network with no hidden nodes. EvoStick uses an evolutionary algorithm based on elitism and mutation. A population of 100 individuals is sampled at the beginning of the process; at each generation, the best 20 individuals are selected and passed unchanged to the following generation; random mutations are applied to these same 20 individuals to form the remaining 80 individuals of the new population.

Chocolate belongs to the AutoMoDe26 family of design methods. It generates control software by assembling predefined modules into probabilistic finite-state machines and by fine-tuning their free parameters41. The modules on which Chocolate operates are 6 low-level behaviors and 6 conditions. A low-level behavior is an action that a robot performs and a condition is a criterion for transitioning from the current low-level behavior to another one. The low-level behaviors are: exploration, stop, phototaxis, anti-phototaxis, attraction-to-neighbors, repulsion-from-neighbors. The 6 conditions are: black-floor, white-floor, gray-floor neighbor-count, inverted-neighbor-count, fixed-probability. The space of the possible combinations of the aforementioned modules is explored using Iterated F-race69.

RandomWalk is a ballistic-motion random walk: the robot moves straight until it encounters an obstacle. When this happens, the robot rotates on itself for a random number of timesteps and resumes it straight motion, if the path is clear; otherwise, it rotates for another random number of timesteps. This sequence is repeated indefinitely. RandomWalk is not an automatic design method as no parameter is tuned. It is included in the study as a lower bound on the performance.

### Missions

XOR-AGGREGATION: the robots must choose one of two black areas and aggregate to it. The size of the black areas and their positions are given in Fig. 2. The performance of the swarm is measured by the following objective function:

$${F}_{{\rm{a}}}=\mathop{\sum }\limits_{t=1}^{T}\mathop{\sum }\limits_{i=1}^{N}{I}_{i}(t);\qquad {I}_{i}(t)=\left\{\begin{array}{ll}1,&\,{\text{if}}\; {\text{robot}}\,\ i\ \,{\text{is}}\; {\text{in}}\; {\text{the}}\; {\text{area}}\; {\text{with}}\; {\text{the}}\; {\text{majority}}\; {\text{of}}\; {\text{robots}};\\ 0,&\,{\text{otherwise}}.\hfill\end{array}\right.$$
(1)

T = 180 s is the duration of the experimental run and N = 20 is the size of the swarm.

HOMING: the robots start in the upper part of the arena and must aggregate on the black area situated at the bottom. The size of the black area and its position are given in Fig. 2. The performance of the swarm is measured by the following objective function:

$${F}_{{\rm{h}}}=\mathop{\sum }\limits_{i=1}^{N}{I}_{i}(T);\qquad {I}_{i}(T)=\left\{\begin{array}{ll}1,&\,{\text{if}}\; {\text{robot}}\,\ i\ \,{\text{is}}\; {\text{in}}\; {\text{the}}\; {\text{black}}\; {\text{area}}\; {\text{at}}\; {\text{time}}\,T;\\ 0,&\,\text{otherwise.}\hfill\end{array}\right.$$
(2)

T = 120 s is the duration of the experimental run and N = 20 is the size of the swarm.

FORAGING: the robots must find one of the black areas, which represent food sources, and go back to the white one, which represents the nest. A light source is positioned behind the nest. The size of the areas of interest and their positions are given in Fig. 2. The performance of the swarm is measured by the following objective function:

$${F}_{{\rm{f}}}=K,$$
(3)

where K is the total number of round trips performed. The duration of an experimental run is T = 180 s and the swarm size is N = 20.

SHELTER: the robots must aggregate in the shelter, a rectangular white area positioned in the center of the arena and surrounded by walls on three sides. A light source is positioned outside the arena, in front of the open side of the shelter. The arena also features two black circular areas, next to the shelter. These areas do not have any predefined purpose/role in the definition of the mission: they are noise-features of the environment. The size of the shelter, the one of the black areas, and their positions are given in Fig. 2. The performance of the swarm is measured by the following objective function:

$${F}_{{\rm{s}}}=\mathop{\sum }\limits_{t=1}^{T}\mathop{\sum }\limits_{i=1}^{N}{I}_{i}(t);\qquad {I}_{i}(t)=\left\{\begin{array}{ll}1,&\,{\text{if}}\; {\text{robot}}\,\ i\ \,{\text{is}}\; {\text{in}}\; {\text{the}}\; {\text{shelter}};\,\\ 0,&\,{\text{otherwise}}.\hfill\end{array}\right.$$
(4)

T = 180 s is the duration of the experimental run and N = 20 is the size of the swarm.

DIRECTIONAL-GATE: the robots must traverse the gate, which is positioned in the center of the arena. They must do so from North to South. The gate is identified by white ground and the robots can follow a black corridor to reach it. The size of the gate, the one of the corridor, and their positions are given in Fig. 2. The performance of the swarm is measured by the following objective function:

$${F}_{{\rm{g}}}=K-K^{\prime} ,$$
(5)

where K is the number of times robots traverse the gate in the correct sense and $$K^{\prime}$$ is the number of times they traverse it in the wrong one. The duration of an experimental run is T = 120 s and the swarm size is N = 20.

### Protocol

#### Experimental setting

All real world experiments presented in this paper were performed in a controlled environment. The simulation environment was made to reproduce this setup as closely as possible. All experiments involved a swarm of 20 e-puck robots that operated in a wooden-wall arena with black and white paper patches on the ground. For each mission, each method was executed 10 times so as to obtain 10 instances of control software. Each design process was allowed the same budget of 200,000 simulation runs. To avoid introducing any bias, robot experiments were randomized and no experimental run performed was discarded. The performance of the swarm was computed automatically using data provided by a tracking system70 that registered the position of the robots throughout the duration of each experimental run. The position of the robots was not communicated to the robots themselves, which had only a local perception of the environment, coherently with the tenets of swarm robotics. The tracking system is based on an overhead camera and recognizes tags mounted on the robots—see Fig. 1a. Videos of all the experimental runs were recorded using the camera of the tracking system and are available as Supplementary Movies 15.

#### Statistics

We used notched box-and-whiskers plots to represent the performance of the different methods. In these plots, the thick horizontal line represents the median; the box extends to the upper and lower quartile; the upper/lower whiskers extends to the maximal/minimal observation that falls between the upper/lower quartile and 1.5 times the interquartile range; circles represent outliers, that is observations that fall beyond the whiskers. Notches on the box represent a 95% confidence interval on the median, and extend to $$\pm 1.58\ \,\text{IQR}\,/\sqrt{n}$$, where IQR is the interquartile range and n is the number of observations. The difference between the medians of two boxes is significant with a confidence of at least 95% if the notches of the respective boxes do not overlap71.

To aggregate the performances of the different methods across all missions, we used the min-max normalization technique: for each mission, we normalized the performances obtained in reality and in simulation with the minimal and maximal performance obtained in reality across all design methods. As a result, the normalized performance in reality ranges between 0 and 1, but the normalized performance in simulation might exceed 1 if instances of control software performed better in simulation than the maximal performance value obtained in reality. We also executed a Friedman test72, which aggregates all results by ranking the performance of all methods across all missions. We present the results in a plot that represents an estimate of the expected rank of each method and the relative 95% confidence interval. The performance of two methods is significantly different with confidence of at least 95% if the corresponding intervals do not overlap.

## Data availability

All results obtained in simulation and real robot experiments are available as Supplementary Data 1Source data are provided with this paper.

## Code availability

The software used in the study is available online via the following repositories: ARGoS3-NEAT (https://doi.org/10.5281/zenodo.4849517) for the implementation of NEAT-A-{slpnl}, NEAT-B-{slpnl} and EvoStick; ARGoS3-pagmo2 (https://doi.org/10.5281/zenodo.4849533) for the implementation of CMA-ES and xNES; ARGoS3-AutoMoDe (https://doi.org/10.5281/zenodo.4849541) for the implementation of Chocolate and RandomWalk; demiurge-epuck-dao (https://doi.org/10.5281/zenodo.4849535) for the reference model of the robots used by all design methods; experiments-loop-functions (https://doi.org/10.5281/zenodo.4849539) for the functions used to compute the score in the various missions; argos3-epuck (https://doi.org/10.5281/zenodo.4882714) for the e-puck robot ARGoS3 plugin; ARGoS3 (https://doi.org/10.5281/zenodo.4889111) for the ARGoS3 simulator; and irace (https://doi.org/10.5281/zenodo.4888996) for the Iterated F-race algorithm. The scripts for installing the software and running the experiments and the control software automatically generated by the different methods comprised in the study presented here are available as Source Data.

## References

1. 1.

Nolfi, S. & Floreano, D. Evolutionary robotics: the biology, intelligence, and technology of self-organizing machines. (MIT Press, Cambridge, MA, USA, 2000).

2. 2.

Trianni, V. Evolutionary swarm robotics. (Springer: Berlin, Germany, 2008).

3. 3.

Brambilla, M., Ferrante, E., Birattari, M. & Dorigo, M. Swarm robotics: a review from the swarm engineering perspective. Swarm Intell. 7, 1–41 (2013).

4. 4.

Nolfi, S. Behavioral and cognitive robotics: an adaptive perspective. (Institute of Cognitive Sciences and Technologies, National Research Council, CNR-ISTC, Roma, Italy, 2021).

5. 5.

Dorigo, M., Birattari, M. & Brambilla, M. Swarm robotics. Scholarpedia 9, 1463 (2014).

6. 6.

Rubenstein, M., Cornejo, A. & Nagpal, R. Programmable self-assembly in a thousand-robot swarm. Science 345, 795–799 (2014).

7. 7.

Werfel, J., Petersen, K. & Nagpal, R. Designing collective behavior in a termite-inspired robot construction team. Science 343, 754–758 (2014).

8. 8.

Garattoni, L. & Birattari, M. Autonomous task sequencing in a robot swarm. Sci. Robot. 3, eaat0430 (2018).

9. 9.

Slavkov, I. et al. Morphogenesis in robot swarms. Sci. Robot. 3, eaau9178 (2018).

10. 10.

Yu, J., Wang, B., Du, X., Wang, Q. & Zhang, L. Ultra-extensible ribbon-like magnetic microswarm. Nat. Commun. 9, 3260 (2018).

11. 11.

Li, S. et al. Particle robotics based on statistical mechanics of loosely coupled components. Nature 567, 361–365 (2019).

12. 12.

Xie, H. et al. Reconfigurable magnetic microrobot swarm: multimode transformation, locomotion, and manipulation. Sci. Robot. 4, eaav8006 (2019).

13. 13.

Dorigo, M., Theraulaz, G. & Trianni, V. Reflections on the future of swarm robotics. Sci. Robot. 5, eabe4385 (2020).

14. 14.

Hamann, H. & Wörn, H. A framework of space-time continuous models for algorithm design in swarm robotics. Swarm Intell 2, 209–239 (2008).

15. 15.

Kazadi, S. Model independence in swarm robotics. Int. J. Intell. Comput. Cybern. 2, 672–694 (2009).

16. 16.

Berman, S., Kumar, V. & Nagpal, R. Design of control policies for spatially inhomogeneous robot swarms with application to commercial pollination in IEEE International Conference on Robotics and Automation, ICRA (pp. 378–385. IEEE, Piscataway, NJ, USA, 2011).

17. 17.

Beal, J., Dulman, S., Usbeck, K., Viroli, M. & Correll, N. Organizing the aggregate: languages for spatial computing in Formal and Practical Aspects of Domain-Specific Languages: Recent Developments (ed. Marjan, M.) 436–501 (IGI Global, Hershey, PA, USA, 2012).

18. 18.

Brambilla, M., Brutschy, A., Dorigo, M. & Birattari, M. Property-driven design for swarm robotics: a design method based on prescriptive modeling and model checking. ACM Tran. Auton. Adap. 9, 17:1–17:28 (2014).

19. 19.

Reina, A., Valentini, G., Fernández-Oto, C., Dorigo, M. & Trianni, V. A design pattern for decentralised decision making. PLoS One 10, e0140950 (2015).

20. 20.

Lopes, Y. K., Trenkwalder, S. M., Leal, A. B., Dodd, T. J. & Groß, R. Supervisory control theory applied to swarm robotics. Swarm Intell. 10, 65–97 (2016).

21. 21.

Pinciroli, C. & Beltrame, G. Buzz: A programming language for robot swarms. IEEE Softw. 33, 97–100 (2016).

22. 22.

Hamann, H. Swarm robotics: a formal approach. (Springer: Cham, Switzerland, 2018).

23. 23.

Hecker, J. P., Letendre, K., Stolleis, K., Washington, D. & Moses, M. E. Formica ex machina: ant swarm foraging from physical to virtual and back again in International Conference on Swarm Intelligence - ANTS 2012 (eds. Dorigo, M. et al.) 7461, 252–259 (Springer, Berlin, Germany, 2012).

24. 24.

Gauci, M, Chen, J, Li, W, Dodd, T. J & Groß, R. Clustering Objects with Robots That Do Not Compute in Proceedings of the 2014 International Conference on Autonomous Agents and Multi-Agent Systems - AAMAS2014. (International Foundation for Autonomous Agents and Multiagent Systems: Richland, SC, USA, 2014) 421–428.

25. 25.

Gauci, M., Chen, J., Li, W., Dodd, T. J. & Groß, R. Self-organized aggregation without computation. Int. J. Robot. Res. 33, 1145–1161 (2014).

26. 26.

Francesca, G., Brambilla, M., Brutschy, A., Trianni, V. & Birattari, M. AutoMoDe: a novel approach to the automatic design of control software for robot swarms. Swarm Intell. 8, 89–112 (2014).

27. 27.

Duarte, M. et al. Evolution of collective behaviors for a real swarm of aquatic surface robots. PLoS One 11, e0151834 (2016).

28. 28.

Jones, S., Studley, M., Hauert, S. & Winfield, A. Evolving behaviour trees for swarm robotics in Distributed Autonomous Robotic Systems (eds Groß, R. et al.) 6, 487–501 (Springer, Cham, Switzerland, 2016).

29. 29.

Birattari, M. et al. Automatic off-line design of robot swarms: a manifesto. Front. Robot. AI 6, 59 (2019).

30. 30.

Bredeche, N., Haasdijk, E. & Prieto, A. Embodied evolution in collective robotics: a review. Front. Robot. AI 5, 12 (2018).

31. 31.

Francesca, G. & Birattari, M. Automatic design of robot swarms: achievements and challenges. Front. Robot. AI 3, 1–9 (2016).

32. 32.

Bongard, J. C. Evolutionary robotics. Communication ACM 56, 74–83 (2013).

33. 33.

Doncieux, S. & Mouret, J.-B. Beyond black-box optimization: a review of selective pressures for evolutionary robotics. Evol. Intell. 7, 71–93 (2014).

34. 34.

Doncieux, S., Bredeche, N., Mouret, J.-B. & Eiben, A. Evolutionary robotics: what, why, and where to. Front. Robot. AI 2, 4 (2015).

35. 35.

Silva, F., Duarte, M., Correia, L., Oliveira, S. M. & Christensen, A. L. Open issues in evolutionary robotics. Evol. Comput. 24, 205–236 (2016).

36. 36.

Brooks, R. A. Artificial life and real robots in Towards a Practice of Autonomous Systems. Proceedings of the First European Conference on Artificial Life (eds. Varela, F. J. & Bourgine, P.) 3–10 (MIT Press, Cambridge, MA, USA, 1992).

37. 37.

Jakobi, N., Husbands, P. & Harvey, I. Noise and the reality gap: the use of simulation in evolutionary robotics in Advances in Artificial Life: Third european conference on artificial life (eds Morán, F., Moreno, A., Merelo, J. J. & Chacón, P.) 929, 704–720 (Springer, Berlin, Germany, 1995).

38. 38.

Floreano, D., Husbands, P. & Nolfi, S. Evolutionary robotics in Springer Handbook of Robotics (eds. Siciliano, B. & Khatib, O.) 1423–1451 (Springer, Berlin, Heidelberg, Germany, 2008).

39. 39.

Koos, S., Mouret, J.-B. & Doncieux, S. The transferability approach: crossing the reality gap in evolutionary robotics. IEEE Trans. Evol. Comput. 17, 122–145 (2013).

40. 40.

Ligot, A. & Birattari, M. Simulation-only experiments to mimic the effects of the reality gap in the automatic design of robot swarms. Swarm Intell. 14, 1–24 (2020).

41. 41.

Francesca, G. et al. AutoMoDe-Chocolate: automatic design of control software for robot swarms. Swarm Intell. 9, 125–152 (2015).

42. 42.

Hansen, N. & Ostermeier, A. Completely derandomized self-adaptation in evolution strategies. Evol. Comput. 9, 159–195 (2001).

43. 43.

Glasmachers, T., Schaul, T., Yi, S., Wierstra, D. & Schmidhuber, J. Exponential Natural Evolution Strategies in Proceedings of the 12th Annual Conference on Genetic and Evolutionary Computation, GECCO, 393–400 (ACM, 2010).

44. 44.

Stanley, K. O. & Miikkulainen, R. Evolving neural networks through augmenting topologies. Evol. Comput. 10, 99–127 (2002).

45. 45.

Geman, S., Bienenstock, E. & Doursat, R. Neural networks and the bias/variance dilemma. Neural Comput. 4, 1–58 (1992).

46. 46.

Ferrante, E., Turgut, A. E., Duéñez-Guzmán, E. A., Dorigo, M. & Wenseleers, T. Evolution of self-organized task specialization in robot swarms. PLOS Computational Biology 11, e1004273 (2015).

47. 47.

Birattari, M., Ligot, A. & Hasselmann, K. Disentangling automatic and semi-automatic approaches to the optimization-based design of control software for robot swarms. Nat. Mach. Intell. 2, 494–499 (2020).

48. 48.

Watson, R. A., Ficici, S. G. & Pollack, J. B. Embodied evolution: distributing an evolutionary algorithm in a population of robots. Robot. Auton. Syst. 39, 1–18 (2002).

49. 49.

Floreano, D. & Mondada, F. Evolution of plastic neurocontrollers for situated agents in From Animals to Animats 4. Proceedings of the Fourth International Conference on Simulation of Adaptive Behavior, SAB (eds. Maes, P., Matarić, M. J., Meyer, J.-A., Pollack, J. B. & Wilson, S. W.) 402–410 (MIT Press, Cambridge, MA, USA, 1996).

50. 50.

Hastie, T, Tibshirani, R & Friedman, J. The Elements of Statistical Learning: Data mining, Inferenceand Prediction. (Springer: Berlin, Germany, 2009).

51. 51.

Goodfellow, I., Bengio, Y. & Courville, A. Deep Learning. (MIT Press, Cambridge, MA, USA, 2016).

52. 52.

Birattari, M., Delhaisse, B., Francesca, G. & Kerdoncuff, Y. Observing the effects of overdesign in the automatic design of control software for robot swarms in Swarm Intelligence - ANTS (eds. Dorigo, M. et al.) 9882, 45-57 (Springer, Cham, Switzerland, 2016).

53. 53.

Caruana, R., Lawrence, S. & Giles, C. L. Overfitting in neural nets: backpropagation, conjugate gradient, and early stopping in Advances in Neural Information Processing Systems 13 (eds. Leen, T. K., Dietterich, T. G. & Tresp, V.) 402–408 (MIT Press, Cambridge, MA, USA, 2001).

54. 54.

Morgan, N. & Bourlard, H. Generalization and Parameter Estimation in Feedforward Nets: Some Experiments in Proceedings of the 2nd International Conference on Neural Information Processing Systems, NIPS (ed. Touretzky, D.) 630–637 (MIT Press, Cambridge, MA, USA, 1989).

55. 55.

Prechelt, L. Early Stopping – But When? in Neural Networks: Tricks of the Trade: Second Edition (eds. Montavon, G., Orr, G. B. & Müller, K.-R.) 53–67 (Springer, Berlin, Heidelberg, 2012).

56. 56.

Raskutti, G., Wainwright, M. J. & Yu, B. Early stopping and non-parametric regression: an optimal data-dependent stopping rule. J. Mach. Learn. Res. 15, 335–366 (2014).

57. 57.

Mondada, F. et al. The e-puck, a robot designed for education in engineering in Proceedings of the 9th Conference on Autonomous Robot Systems and Competitions (eds. Gonçalves, P., Torres, P. & Alves, C.) 59–65 (Instituto Politécnico de Castelo Branco, Castelo Branco, Portugal, 2009).

58. 58.

Gutiérrez, Á. et al. Open e-puck range & bearing miniaturized board for local communication in swarm robotics in IEEE International Conference on Robotics and Automation, ICRA (ed. Kosuge, K.) 3111–3116 (IEEE, Piscataway, NJ, USA, 2009).

59. 59.

Hasselmann, K., Ligot, A., Francesca, G. & Birattari, M. Reference models for AutoMoDe tech. rep. TR/IRIDIA/2018-002 (IRIDIA, Université libre de Bruxelles, Belgium, 2018).

60. 60.

Pinciroli, C. et al. ARGoS: a modular, parallel, multi-engine simulator for multi-robot systems. Swarm Intell. 6, 271–295 (2012).

61. 61.

Garattoni, L., Francesca, G., Brutschy, A., Pinciroli, C. & Birattari, M. Software Infrastructure for E-puck (and TAM) tech. rep. TR/IRIDIA/2015-004 (IRIDIA, Université libre de Bruxelles, Belgium, 2015).

62. 62.

Ligot, A. et al. AutoMoDe, NEAT, and EvoStick: implementations for the e-puck robot in ARGoS3 tech. rep. TR/IRIDIA/2017-002 (IRIDIA, Université libre de Bruxelles, Belgium, 2017).

63. 63.

Miglino, O., Lund, H. H. & Nolfi, S. Evolving mobile robots in simulated and real environments. Artif. Life 2, 417–434 (1995).

64. 64.

Pagliuca, P. & Nolfi, S. Robust optimization through neuroevolution. PLoS One 14, e0213193 (2019).

65. 65.

Auger, A. & Hansen, N. A Restart CMA Evolution Strategy with Increasing Population Size in IEEE Congress on Evolutionary Computation, CEC 2, 1769–1776 (IEEE, Piscataway, NJ, USA, 2005).

66. 66.

Lunacek, M & Whitley, L. D. The Dispersion Metric and the CMA Evolution Strategy in Proceedings of the 8th annual conference on Genetic and Evolutionary Computation, GECCO. (ACM: New York, NY, USA, 2006) 477–484.

67. 67.

Heaton, J. Introduction to Neural Networks for Java (Heaton Research, Inc., 2008).

68. 68.

Francesca, G., Brambilla, M., Trianni, V., Dorigo, M. & Birattari, M. Analysing an evolved robotic behaviour using a biological model of collegial decision making in From Animals to Animats 12. Proceedings of the twelveth International Conference on Simulation of Adaptive Behavior, SAB (eds. Ziemke, T., Balkenius, C. & Hallam, J.) 7426, 381–390 (Springer, Berlin, Germany, 2012).

69. 69.

López-Ibáñez, M., Dubois-Lacoste, J., PérezCáceres, L., Birattari, M. & Stützle, T. The irace package: Iterated racing for automatic algorithm configuration. Oper. Res. Perspect. 3, 43–58 (2016).

70. 70.

Stranieri, A. et al. IRIDIA’s arena tracking system tech. rep. TR/IRIDIA/2013-013 (IRIDIA, Université libre de Bruxelles, Belgium, 2013).

71. 71.

Chambers, J. M., Cleveland, W. S., Kleiner, B. & Tukey, P. A. Graphical methods for data analysis. (CRC Press, Belmont, CA, USA, 1983).

72. 72.

Conover, W. J. Practical nonparametric statistics. (John Wiley & Sons, New York, NY, USA, 1999).

## Acknowledgements

The project has received funding from the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (Demiurge: grant agreement No 681872) and from Belgium’s Wallonia-Brussels Federation through a ARC Advanced Project 2020 (Guaranteed by Optimization). M.B. acknowledges support from the Belgian Fonds de la Recherche Scientifique-FNRS, of which he is a research director.

## Author information

Authors

### Contributions

Supervised by K.H., J.R. implemented CMA-ES and xNES. K.H. implemented NEAT. K.H. and A.L. performed the experiments, analyzed the results, and prepared the plots. K.H. and J.R. edited the supplementary movies. M.B. drafted the main text and K.H. the “Methods”. M.B., K.H., and A.L. revised the manuscript. All authors read and approved the submitted version. K.H. and A.L. contributed equally to this work. M.B. conceived and directed the research.

### Corresponding author

Correspondence to Mauro Birattari.

## Ethics declarations

### Competing interests

The authors declare no competing interests.

Peer review information Nature Communication thanks the anonymous reviewers for their contribution to the peer review of this work.

Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

## Rights and permissions

Reprints and Permissions

Hasselmann, K., Ligot, A., Ruddick, J. et al. Empirical assessment and comparison of neuro-evolutionary methods for the automatic off-line design of robot swarms. Nat Commun 12, 4345 (2021). https://doi.org/10.1038/s41467-021-24642-3

• Accepted:

• Published:


text:
Computing Optimal Designs of multiresponse Experiments reduces to Second-Order Cone Programming

Authors
Type
Preprint
Publication Date
Nov 25, 2010
Submission Date
Dec 30, 2009
Identifiers
arXiv ID: 0912.5467
Source
arXiv
Elfving's Theorem is a major result in the theory of optimal experimental design, which gives a geometrical characterization of $c-$optimality. In this paper, we extend this theorem to the case of multiresponse experiments, and we show that when the number of experiments is finite, $c-,A-,T-$ and $D-$optimal design of multiresponse experiments can be computed by Second-Order Cone Programming (SOCP). Moreover, our SOCP approach can deal with design problems in which the variable is subject to several linear constraints. We give two proofs of this generalization of Elfving's theorem. One is based on Lagrangian dualization techniques and relies on the fact that the semidefinite programming (SDP) formulation of the multiresponse $c-$optimal design always has a solution which is a matrix of rank $1$. Therefore, the complexity of this problem fades. We also investigate a \emph{model robust} generalization of $c-$optimality, for which an Elfving-type theorem was established by Dette (1993). We show with the same Lagrangian approach that these model robust designs can be computed efficiently by minimizing a geometric mean under some norm constraints. Moreover, we show that the optimality conditions of this geometric programming problem yield an extension of Dette's theorem to the case of multiresponse experiments. When the number of unknown parameters is small, or when the number of linear functions of the parameters to be estimated is small, we show by numerical examples that our approach can be between 10 and 1000 times faster than the classic, state-of-the-art algorithms.


text:
# Do ranged spells count as attacks for purposes of a Rogue's Sneak Attack? [duplicate]

Our DM was saying that an Arcane Trickster Rogue casting a Firebolt does not get the sneak attack damage on a hit. Is that right?

## marked as duplicate by MikeQ, Rubiksmoose♦ dnd-5e StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Jan 25 at 5:10

• That question is from the playtest, so it's not really a duplicate. – Miniman Jan 25 at 4:14
• @Miniman so I closed this before seeing your comment. If that question is from the playtest it sold be retagged. And I'm not 100% sure it matters if it is. Certainly the top and accepted answer is not from the playtest so I think it should be good regardless. – Rubiksmoose Jan 25 at 5:12
• Yeah, there are a number of improperly tagged questions from the playtest that never got fixed so there are a mix of playtest answers and official 5e answers. I'm unsure how we deal with those... – V2Blast Jan 25 at 5:30
• @V2Blast might be worth a meta honestly. – Rubiksmoose Jan 25 at 5:31
• @Rubiksmoose: Someone else can ask it, or I can do it some other time. Right now I have to sleep so I can be awake for a work call in 5 and a half hours... – V2Blast Jan 25 at 5:32

## Spells cannot be used for sneak attacks....

... unless the spell involves making a weapon attack as part of its action, such as Greenflame-Blade and Booming Blade, in which case, you can apply sneak damage.

Sneak Attack (PHB Pg. 96)

Once per turn, you can deal extra 1d6 damage to one creature you hit with an attack if you have advantage on the attack roll. The attack must use a finesse or a ranged weapon.

• If the spell includes a weapon attack, it can be used for sneak attacks (assuming the weapon used is light or finesse). – kviiri Jan 25 at 5:28
• Yeah, I over-looked that. I'll edit my answer. – Belynold Dayslayer Jan 25 at 5:29

The rules for sneak attack state:

The attack must use a finesse or a ranged weapon.

A spell is not a finesse weapon, nor is it a ranged weapon, so no sneak attack damage can be applied from casting it.


text:
## 15.79 Kinetic Control Vs Kinetic Favorability

Arrhenius Equation: $\ln k = - \frac{E_{a}}{RT} + \ln A$

Michelle Dong 1F
Posts: 110
Joined: Fri Sep 29, 2017 6:04 am

### 15.79 Kinetic Control Vs Kinetic Favorability

In some reactions, two or more different products can be formed by different pathways. If the product formed by the faster reaction predominates, the reaction is considered to be under kinetic control. If the predominant product is the more thermodynamically stable, the reaction is considered to be under thermodynamic control. In the reaction of HBr with the reactive intermediate CH3CH=CHCH2 , at low temperatures the predominant product is CH3CHBrCH=CH2, but at high temperatures, the predominant product is CH3CH=CHCH2Br. (a) Which product is formed by the pathway with the larger activation energy? (b) Does kinetic control predominate at low or high temperatures? Explain your answers.

Why is CH3CHBrCH=CH2 the product formed by the pathway with the larger activation energy? How can you tell that at higher temperatures the reaction has a larger activation energy? Also, is kinetic control the same thing as kinetic favorability?

Leah Thomas 2E
Posts: 51
Joined: Fri Sep 29, 2017 6:06 am

### Re: 15.79 Kinetic Control Vs Kinetic Favorability

I'm not 100% sure if this logic is correct and I may be thinking backward here but...if a reaction needs a higher temperature to react it must need to overcome a large activation energy because increasing temperature provides energy to overcome that barrier.

Joyce Lee 1C
Posts: 52
Joined: Fri Sep 29, 2017 6:03 am
Been upvoted: 1 time

### Re: 15.79 Kinetic Control Vs Kinetic Favorability

For part (a), the second product is formed at high temperatures, so a large amount of energy is needed to overcome the energy barrier for the product to form.
For (b), kinetic control predominates at lower temperatures, because the reaction pathways with lower energy barriers have larger rate constants. The larger the rate constant, the faster the reaction. This is proven by the Arrhenius equation.