mathematical-optimization

Need Better Algorithm for Finding Mapping Between 2 Sets of Points with Minimum Distance

风流意气都作罢 提交于 2020-01-22 05:30:06
问题 Problem: I have two overlapping 2D shapes, A and B, each shape having the same number of pixels, but differing in shape. Some portion of the shapes are overlapping, and there are some pieces of each that are not overlapping. My goal is to move all the non-overlapping pixels in shape A to the non-overlapping pixels in shape B. Since the number of pixels in each shape is the same, I should be able to find a 1-to-1 mapping of pixels. The restriction is that I want to find the mapping that

What is the difference between Gradient Descent and Newton's Gradient Descent?

有些话、适合烂在心里 提交于 2020-01-22 04:09:37
问题 I understand what Gradient Descent does. Basically it tries to move towards the local optimal solution by slowly moving down the curve. I am trying to understand what is the actual difference between the plan gradient descent and the newton's method? From Wikipedia, I read this short line "Newton's method uses curvature information to take a more direct route." What does this intuitively mean? 回答1: At a local minimum (or maximum) x , the derivative of the target function f vanishes: f'(x) = 0

Iterating an Array in Python using the brentq Function

此生再无相见时 提交于 2020-01-17 05:05:22
问题 I am having trouble iterating every element of an array using the brentq function. q in the defined function below is a FITS file array, and we are using every element in this array as inputs to run through the brentq function in order to solve for T . Essentially, my problem lies in not particularly knowing where or how to implement the appropriate for loop to iterate the function over every element of q . Any suggestions on how to go about this problem? def f(T,q,coeff1,coeff2,coeff3):

Computing Jacobian And Passing to Scipy Minimize

老子叫甜甜 提交于 2020-01-15 10:43:53
问题 I know the jacobian is the first derivative, but I don't know how to compute it for my simple function (I tried online derivative calculators) and pass it to my scipy minimize function. In code, here is the objective function (guess arrays can contain thousands of variables): def objective(current_guesses_array, first_guesses_array): return np.sum(np.divide(np.square(current_guesses_array - first_guesses_array), first_guesses_array)) I think the Jacobian is like this, but definitely may have

Computing Jacobian And Passing to Scipy Minimize

眉间皱痕 提交于 2020-01-15 10:39:27
问题 I know the jacobian is the first derivative, but I don't know how to compute it for my simple function (I tried online derivative calculators) and pass it to my scipy minimize function. In code, here is the objective function (guess arrays can contain thousands of variables): def objective(current_guesses_array, first_guesses_array): return np.sum(np.divide(np.square(current_guesses_array - first_guesses_array), first_guesses_array)) I think the Jacobian is like this, but definitely may have

Algorithms for optimal student seating arrangements

吃可爱长大的小学妹 提交于 2020-01-15 06:28:08
问题 Say I need to place n=30 students into groups of between 2 and 6, and I collect the following preference data from each student: Student Name: Tom Likes to sit with: Jimi, Eric Doesn't like to sit with: John, Paul, Ringo, George It's implied that they're neutral about any other student in the overall class that they haven't mentioned. How might I best run a large number of simulations of many different/random grouping arrangements, to be able to determine a score for each arrangement, through

Compacting mathematical graph

眉间皱痕 提交于 2020-01-14 09:33:38
问题 I want to draw a graph that will be something like this: alt text http://img25.imageshack.us/img25/9786/problemo.png You can see 3 pathes: a, b & c. How can I change position of elements (1,2,3...,9) to make long of the path as short as possible? I mean this lines should be as short as possible. Im very interested in it becouse I am drawing a graph with question, some kind of infographic like 'follow the lines to know the answer'. I know that its a bit about graph theory... so if its too hard

Fitting two curves with linear/non-linear regression

孤街醉人 提交于 2020-01-14 07:51:09
问题 I need to fit two curves(which both should belong to cubic functions) into a set of points with JuMP. I've done fitting one curve, but I'm struggling at fitting 2 curves into same dataset. I thought that if I can distribute points to curves - so if each point can only be used once - I can do it like below, but it didn't work. (I know that I can use much more complicated things, I want to keep it simple.) This is a part of my current code: # cubicFunc is a two dimensional array which accepts

The Optimization of an Objective Function with Step Functions

陌路散爱 提交于 2020-01-13 16:26:10
问题 I've asked this question at Math SE, but the response is not very satisfactory. So I asked here again: I have an optimization problem with linear inequalities and equalities constraint: A*x<=b Aeq*x=beq The problem is that the objective function is composed of a summation of a series of Heaviside step functions, Here's the pseudo code for the objective function: function f(k, c, x) ffunction =0; for i=0;i<k.row.length;i++ smallF=0 for j=0; j<k.column.length; j++ smallF+= k.row[i]*k.column[j]

The Optimization of an Objective Function with Step Functions

给你一囗甜甜゛ 提交于 2020-01-13 16:25:19
问题 I've asked this question at Math SE, but the response is not very satisfactory. So I asked here again: I have an optimization problem with linear inequalities and equalities constraint: A*x<=b Aeq*x=beq The problem is that the objective function is composed of a summation of a series of Heaviside step functions, Here's the pseudo code for the objective function: function f(k, c, x) ffunction =0; for i=0;i<k.row.length;i++ smallF=0 for j=0; j<k.column.length; j++ smallF+= k.row[i]*k.column[j]