mathematical-optimization

Why does FindMaximum with Newton's method complain it can't find a sufficient decrease in function?

主宰稳场 提交于 2019-12-23 03:55:08
问题 Firstly, this seems like (from ContourPlot) a fairly straightforward maximization problem, why is FindMaximum with Newton's method having problems? Secondly, how can I get rid of the warnings? Thirdly, if I can't get rid of these warnings, how can I tell if the warning is meaningful, ie, maximization failed? For instance, in the code below, FindMaximum with Newton's method gives a warning, whereas the PrincipalAxis method doesn't o = 1/5 Log[E^(-(h/Sqrt[3]))/( 2 E^(-(h/Sqrt[3])) + 2 E^(h/Sqrt

Optimization of Neural Network input data

走远了吗. 提交于 2019-12-23 03:14:43
问题 I'm trying to build an app to detect images which are advertisements from the webpages. Once I detect those I`ll not be allowing those to be displayed on the client side. Basically I'm using Back-propagation algorithm to train the neural network using the dataset given here: http://archive.ics.uci.edu/ml/datasets/Internet+Advertisements. But in that dataset no. of attributes are very high. In fact one of the mentors of the project told me that If you train the Neural Network with that many

To optimize four parameters in Python Scipy.optimize.fmin_l_bfgs_b, with an error

空扰寡人 提交于 2019-12-23 03:13:41
问题 I am coding an algorithm for active learning, using L-BFGS algorithm from scipy.optimize. I need to optimize four parameters: alpha , beta , W and gamma . However, it does not work, with the error of optimLogitLBFGS = sp.optimize.fmin_l_bfgs_b(func, x0=np.array(alpha,beta,W,gamma), fprime=func_grad) ValueError: only 2 non-keyword arguments accepted Note that, in last sentence of the code, x0 is the initial guess of the four paramters. If I change to x0=np.array((alpha,beta,W,gamma),dtype

Using min/max operator in integer programming

大城市里の小女人 提交于 2019-12-23 02:52:24
问题 I am trying to optimize an objective function using integer programming, I have to use Max operator in my function, I want to know is there any way to deal with that? Actually my question is similar to Using min/max within an Integer Linear Program but is different in some aspects: All variables are binary. Note that x4 and x5 are presented in two place. One possible solution is using auxiliary variables like the answer of similar question, but I am confused when using this solution for my

Nonlinear optimization with R for grouped variables

不打扰是莪最后的温柔 提交于 2019-12-22 14:51:47
问题 I am trying to find maximum values for below objective function: objective <-function(bid,revenue,click,cost) { revenue_2 <- sum((revenue / cost)* (bid*click*bid*(cost/click) / cost)^(-0.2*revenue/cost)* (bid*click)*bid*(cost/click)) return(-revenue_2) } subject to roas_2 <- function(bid, revenue,click,cost) { revenue_2 <- ((revenue / cost)* (bid*click*bid*(cost/click) / cost)^(-0.2*revenue/cost))* (bid*click)*bid*(cost/click) cost_2 <- (bid*click)*bid*(cost/click) roas_2 <- (sum(revenue_2)

Number of Sides Required to draw a circle in OpenGL

家住魔仙堡 提交于 2019-12-22 12:58:36
问题 Does anyone know some algorithm to calculate the number of sides required to approximate a circle using polygon, if radius, r of the circle and maximum departure of the polygon from circularity, D is given? I really need to find the number of sides as I need to draw the approximated circle in OpenGL. Also, we have the resolution of the screen in NDC coordinates per pixel given by P and solving D = P/2, we could guarantee that our circle is within half-pixel of accuracy. 回答1: What you're

Convergence of a very large non-linear least squares optimization

谁说我不能喝 提交于 2019-12-22 10:52:45
问题 I'm trying to solve the following problem: I have a lot (~80000) surface patches of an organ that's growing. I measure each of its areas over time (18 time-points) and want to fit a growth curve to it (bi-logistic model, eg. just the sum of two logistic functions bcs. there are two 'growth spurts' happening in the observed period). I have box constraints to ensure that the exponential terms don't explode and a linear constraint that one growth spurt has to happen after the other. Also, in

NMinimize eats all memory b/c of unnecessary symbolic work

梦想的初衷 提交于 2019-12-21 20:52:06
问题 The following code is a naive way to find the least number whose square has n divisors (the minimum should be its log and the x_i the powers in its prime factorization). If I look at the case n=2000 and use ten variables instead of twenty, this uses somewhere around 600MB of memory. With the value of n I'm actually trying to find the answer for, I need around 20 variables to be sure of not missing the actual solution, and it quickly uses up all available memory and then thrashes swap. n=8*10

Optimization in R: Maximizing and Minimizing Many Variables

只愿长相守 提交于 2019-12-21 20:25:03
问题 I have a dataset with 70 foods and information about each food's nutritional value (protein/oz., fat/oz., cals/oz., etc.), as well as the food's cost/oz. I am trying to figure out--given a set budget in $--what the best combination of foods (and the amt. of each food) would be to maximize protein, minimize fat, minimize calories, etc. I aim to do this across a series of price points, and to plot each. I found a whole bunch of different packages that could help with this here: http://cran.r

Matrix completion in Python

我是研究僧i 提交于 2019-12-21 09:08:24
问题 Say I have a matrix: > import numpy as nap > a = np.random.random((5,5)) array([[ 0.28164485, 0.76200749, 0.59324211, 0.15201506, 0.74084168], [ 0.83572213, 0.63735993, 0.28039542, 0.19191284, 0.48419414], [ 0.99967476, 0.8029097 , 0.53140614, 0.24026153, 0.94805153], [ 0.92478 , 0.43488547, 0.76320656, 0.39969956, 0.46490674], [ 0.83315135, 0.94781119, 0.80455425, 0.46291229, 0.70498372]]) And that I punch some holes in it with np.NaN , e.g.: > a[(1,4,0,3),(2,4,2,0)] = np.NaN; array([[ 0