Giter Site home page Giter Site logo

cjones6 / cubic_reg Goto Github PK

View Code? Open in Web Editor NEW
16.0 16.0 11.0 31 KB

Implementation of Nesterov and Polyak's (2006) cubic regularization algorithm and Cartis et al's (2011) adaptive cubic regularization algorithm

License: BSD 3-Clause "New" or "Revised" License

Python 100.00%

cubic_reg's Issues

How to solve the subproblem

What approach do you take to solving subproblems in the literature? Is this an approximate way of solving subproblems or an exact way of solving them? It the article is "Trust region methods (Vol. 1). Siam." ?

Possible incorrect handling of hard case

Hey again! Thanks for your quick response on my previous issue. I may have stumbled across another one. Consider the following:

N = 50

B = np.random.rand(N, N)
B += B.T
g = np.random.rand(N)
lambda_nplus = max(-scipy.linalg.eigh(B, eigvals_only=True, eigvals=(0, 0)), 0)
eigs, V = np.linalg.eigh(B)
# make sure indefinite
assert min(eigs) < 0 and max(eigs) > 0
v1 = V[:, 0]

# make gamma_1 = Ug_1 == 0
g = v1 - g * (v1.T @ v1)/(g.T @ v1)
assert abs(v1 @ g) < 1e-10
assert (V.T @ g)[0] < 1e-10
p = _AuxiliaryProblem(None, g, B, 10, lambda_nplus, 1e-4, 1e4)

print(p.solve())

This should trigger the hard-case (B indefinite, Ug_1 == 0) [1], but it does not reliably. Sometimes, it will trigger the hard case code, but then the output will be imaginary.

I'd love to submit a pull-request with a fix, but I'm actually not quite sure on how to fix this one!

[1]: https://people.maths.ox.ac.uk/cartis/papers/ARCpI.pdf -- Page 27, just below formula 6.5.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.