mathematical-optimization

What does crossover index of 0.25 means in Genetic algorithm for real encoding?

爷,独闯天下 提交于 2019-12-24 01:44:27
问题 I am familiar with crossover and mutation indexes in binary representation but in real encoding, I came across with several articles in which crossover index and mutation index are used as parameter values. For example, we have population size of 300 and 30 decision variables then what does crossover index = 0.25 means? Also confused about the mutation index of 100+current generation number . 回答1: Crossover index A number of real-coded crossover operators have been developed that create two

MATLAB: LSQNONLIN changes in R2011a?

淺唱寂寞╮ 提交于 2019-12-24 01:01:07
问题 I'm working with a matlab code package that was handed down to me. It was written in R2007b version, and I saw it perform. My lab just acquired R2011a and although the package runs without errors, it produces different (and notably worse) results. I've zeroed in on the conclusion that the difference comes when executing lsqnonlin Were there any known and significant changes in the versions? How would I track down the differences? I'll be glad to supply parts of code if needed. Thank you! 回答1:

Constraints on parameters using differential evolution in python

ⅰ亾dé卋堺 提交于 2019-12-23 23:11:11
问题 I am trying to use differential evolution to optimize availability based on cost. However, I have three unknown parameters (a, b, c) here and I can define the range using bounds. However, I want to define additional constraint as a+b+c <= 10000. I am using python to do this and I tried to use an option "args" within differential evolution but it did not work. Any information will be appreciated. 回答1: Here is a hack. I used the last example from the documentation and constrained the sum(x) > 4

Building ranking with genetic algorithm,

元气小坏坏 提交于 2019-12-23 17:15:08
问题 Question after BIG edition : I need to built a ranking using genetic algorithm, I have data like this : P(a>b)=0.9 P(b>c)=0.7 P(c>d)=0.8 P(b>d)=0.3 now, lets interpret a,b,c,d as names of football teams, and P(x>y) is probability that x wins with y . We want to build ranking of teams, we lack some observations P(a>d) , P(a>c) are missing due to lack of matches between a vs d and a vs c. Goal is to find ordering of team names, which the best describes current situation in that four team league

CVXPY: how to efficiently solve a series of similar problems

可紊 提交于 2019-12-23 15:56:59
问题 I have a large problem defined in CVXPY modelling language. I want to solve series of this problems - still the same format but with different parameters (constants). I found out that after calling problem.solve() internal problem generating takes 20 s and main optimization runtime takes 0.2 s. It's a lot of time when I want to solve dozens of similar problems. Is there any tool for CVXPY like YALMIP optimizer or any possibility to reduce problem generating time? 回答1: Yes there is. And it's

Accuracy of maximum likelihood estimators

淺唱寂寞╮ 提交于 2019-12-23 15:13:07
问题 Here's a test for comparing ML estimators of the lambda parameter of a Poisson distribution. with(data.frame(x=rpois(2000, 1.5), i=LETTERS[1:20]), cbind(cf=tapply(x, i, mean), iter=optim(rep(1, length(levels(i))), function(par) -sum(x * log(par[i]) - par[i]), method='BFGS')$par)) The first column shows the ML estimator obtained from the closed-form solution (for reference), while the second column shows the ML estimator obtained by maximizing a log-likelihood function using the BFGS method.

Scipy Differential Evolution with integers

a 夏天 提交于 2019-12-23 12:49:33
问题 I'm trying to run an optimization with scipy.optimize.differential_evolution. The code calls for bounds for each variable in x. But I want to a solution where parts of x must be integers, while others can range freely as floats. The relevant part of my code looks like bounds = [(0,3),(0,3),(0,3),???,???] result = differential_evolution(func, bounds) What do I replace the ???'s with to force those variables to be ints in a given range? 回答1: As noted in the comments there isn't direct support

Element-wise constraints in scipy.optimize.minimize

烈酒焚心 提交于 2019-12-23 11:45:29
问题 I'm using scipy.optimize.minimize 's COBYLA method to find a matrix of parameters for a categorical distribution. I need to impose the constraint that each parameter is greater than zero, and that the sum of the rows of the parameter matrix is a column of ones. It's not clear to me how to implement this in scipy.minimize , because the constraints are checked for non-negativity rather than truth. The minimization raises an exception if I just pass the arrays as the constraint. Does anyone know

Automatic differentiation

落爺英雄遲暮 提交于 2019-12-23 07:51:47
问题 I am working on my project of graduating, particularly, about fluid dynamics and I have a system of non-linear equations to solve, I choose the Newton's method so I have to pass through the Jacobian of the matix (actually 12x12 matrix). Every element in this matrix is the derivative of the function evaluated at some point, it's very difficult to write all of these manually and calculate each derivative; the system looks like: f 1 (x 1 , x 2 , x 3 , ..., x 12 ) = 0 f 2 (x 1 , x 2 , x 3 , ...,

Tensorflow: Compute Hessian matrix (only diagonal part) with respect to a high rank tensor

我的未来我决定 提交于 2019-12-23 05:16:03
问题 I would like to compute the first and the second derivatives(diagonal part of Hessian) of my specified Loss with respect to each feature map of a vgg16 conv4_3 layer's kernel which is a 3x3x512x512 dimensional matrix. I know how to compute derivatives if it is respected to a low-rank one according to How to compute all second derivatives (only the diagonal of the Hessian matrix) in Tensorflow? However, when it turns to higher-rank, I got completed lost. # Inspecting variables under Ipython