non-convex

Minimizing non-convex function with linear constraint and bound in mystic

99封情书 提交于 2021-02-11 14:19:12
问题 Say I have a non-convex objective function loss that takes a np.ndarray named X whose shape is (n,) and returns a float number. The objective has many many many local minima, since it's essentially a function of np.round(X * c, 2) where c is another constant array of shape (n,). You can imagine something like this: def loss(X: np.ndarray) -> float: c = np.array([0.1, 0.5, -0.8, 7.0, 0.0]) X_rounded = np.round(X * c, 2) return rosen(X_rounded) The linear constraint is expressed with two

How to apply inequality constraints in Mystic

痴心易碎 提交于 2020-01-25 07:23:09
问题 I'm trying to maximise an objective subject to an inequality constraint using Mystic but am struggling to see how to apply the penalty constraints. The problem is non-convex and involves maximising the objective where there is only one variable that will be changing (x). I'm trying Mystic because I've heard that it is good for large scale optimisation, and x is a 1D array contain millions of items (size N). There are three 1-D arrays of numbers a, b, and c all with N number of values, (the

Non-convex polygon - preprocess to use convex hull algorithm

强颜欢笑 提交于 2019-12-23 15:30:59
问题 I used the convexHull algorithm to find the contour for some... irregular shape. It is not good enough though... Quite possibly because I can't guarantee that the shape I have is convex... I have a set of rectangles, and I would like to be able to get all points on the outside of the contour - but not throw any of the contour points out. The convex hull algorithm works great - but it works like the example on the right, so I lose some information on the contours. I want something that works

Detect corner coordinates of a non-convex polygon in clockwise order MATLAB

情到浓时终转凉″ 提交于 2019-12-22 05:10:24
问题 I have some images which includes both convex as well as non-convex polygons. Each image contains exactly one polygon. I need to detect the corner coordinates and need to sort them in clock-wise or counter-clockwise order. For convex polygons, I use Harris corner detection for detecting corners and convexhull for sorting the points. But i dont have any idea on how to sort non-convex polygon. As my inputs are images, i think some Image Processing Technique might help to sort them out by moving

how to order vertices in a non-convex polygon (how to find one of many solutions)

早过忘川 提交于 2019-12-17 18:22:01
问题 I have the same problem as here: how to order vertices in a simple, non-convex polygon but there is no solutions I can use. I have coordinates of points and need to find some polygon. Does not matter that there is more solutions for one list of dots. I need some algorithm to find one of them. Does not matter which one. I really don't know how to solve this. (I have stored coordinates in array and I want to use some algorithm in Javascript) Thanks a lot. 回答1: First, find the center of the

how to order vertices in a simple, non-convex polygon

て烟熏妆下的殇ゞ 提交于 2019-11-30 09:47:52
问题 I have a problem where I have a series of points for a simple, non-convex polygon (I hope I have the terminology correct). But the points are not necessarily in order (ie, clockwise or counterclockwise). For Flash's drawing API to correctly draw a fill area, I need to have these points progress in order around the edge (to finally connect with the starting point). Is there some way I can sort my list of Cartesian coordinates in either clockwise or counterclockwise direction so I can draw my

how to order vertices in a simple, non-convex polygon

给你一囗甜甜゛ 提交于 2019-11-29 17:30:21
I have a problem where I have a series of points for a simple, non-convex polygon (I hope I have the terminology correct). But the points are not necessarily in order (ie, clockwise or counterclockwise). For Flash's drawing API to correctly draw a fill area, I need to have these points progress in order around the edge (to finally connect with the starting point). Is there some way I can sort my list of Cartesian coordinates in either clockwise or counterclockwise direction so I can draw my shape from point to point without "lifting the pen"? I saw one post for sorting 4-points of a polygon,

how to order vertices in a non-convex polygon (how to find one of many solutions)

霸气de小男生 提交于 2019-11-28 06:39:00
I have the same problem as here: how to order vertices in a simple, non-convex polygon but there is no solutions I can use. I have coordinates of points and need to find some polygon. Does not matter that there is more solutions for one list of dots. I need some algorithm to find one of them. Does not matter which one. I really don't know how to solve this. (I have stored coordinates in array and I want to use some algorithm in Javascript) Thanks a lot. First, find the center of the bounding box that contains all of your vertices. We'll call this point C. Sort your list of vertices based on