question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SignomialEquality with trust regions

See original GitHub issue

I am trying to use a SignomialEqualityLinTrust and am getting the following error

/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gpkit/constraints/set.pyc in as_gpconstr(self, x0)
    181 
    182         When x0 is none, may return a default guess."""
--> 183         gpconstrs = [constr.as_gpconstr(x0) for constr in self]
    184         return ConstraintSet(gpconstrs,
    185                              self.substitutions, recursesubs=False)

/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gpkit/constraints/set.pyc in as_gpconstr(self, x0)
    181 
    182         When x0 is none, may return a default guess."""
--> 183         gpconstrs = [constr.as_gpconstr(x0) for constr in self]
    184         return ConstraintSet(gpconstrs,
    185                              self.substitutions, recursesubs=False)

/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gpkit/nomials/nomial_math.pyc in as_gpconstr(self, x0)
    888         varkeys = set(mleft.varkeys).union(mright.varkeys)
    889     bounding_constraints = [[self.trustregion <= Monomial(vk)/x0[vk],
--> 890                          Monomial(vk)/x0[vk] <= 1/self.trustregion] for vk in varkeys]
    891         return [bounding_constraints, mleft == mright]
    892 

I can run the example posted in #808 fine. This is the method throwing the error

def as_gpconstr(self, x0):
        "Returns GP apprimxation of an SP constraint at x0"
        #return self.left >= self.right
        def _force_mono(posy):
            if isinstance(posy, Monomial):
                return posy
            return posy.mono_lower_bound(x0)
        mleft, mright = map(_force_mono, [self.left, self.right])
    varkeys = set(mleft.varkeys).union(mright.varkeys)
    bounding_constraints = [[self.trustregion <= Monomial(vk)/x0[vk],
                         Monomial(vk)/x0[vk] <= 1/self.trustregion] for vk in varkeys]
    return [bounding_constraints, mleft == mright]

I’m not 100% sure but I think the problem is that no argument is being passed into _force_mono

@mopg this might be of interest to you

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:27 (22 by maintainers)

github_iconTop GitHub Comments

1reaction
whoburgcommented, Sep 10, 2016

great, yes that will be interesting to understand better.

BTW, re: closing this, general guidance is to not close the issue until the fix is merged to master. That’s why @bqpd created the “waiting on PR” label.

1reaction
mopgcommented, Aug 24, 2016

Yes that is passing the initial guess.

On Aug 24, 2016, at 2:37 PM, mayork notifications@github.com wrote:

no I didn’t reorder, just tried to plug and play.

As far as passing in an initial guess is that what’s occurring with the x0={x.key:1,y.key:1} in

sol = m.localsolve(verbosity=2, x0={x.key:1,y.key:1}, iteration_limit=101) — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hoburg/gpkit/issues/820#issuecomment-242166325, or mute the thread https://github.com/notifications/unsubscribe-auth/ALRnMG8QSLm1O0vzupVGn_OWobxcbk55ks5qjI9OgaJpZM4JsTb5.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Application of Signomial Programming to Aircraft Design
Therefore, signomial equality constraints may require a trust region, making them the least desirable type of constraint. However, the signomial equality ...
Read more >
(PDF) Comparison of Algorithms for Including Equality ...
PDF | Including equality constraints in signomial programming proves ... Trust region methods are proposed which perform comparably well to ...
Read more >
Application of Signomial Programming ... - Convex Engineering
Therefore, signomial equality constraints may require a trust region, making them the least desirable type of constraint. However, the signomial equality ...
Read more >
Signomial Programming — gpkit 1.1 documentation
Signomial programming finds a local solution to a problem of the form: ... the general smoothness and lack of a need for trust...
Read more >
Exploiting convex structure in aircraft design optimization
Quality of Fit max−affine scaled softmax ... using signomial programming ... Fitting problem solved offline using trust region.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found