Skip to main content
http://fa.bianp.net/blog/static/images/2013/comparison_logistic_corr_10.png

The main function is pytron.minimize:

def minimize(func, grad_hess, x0, args=(), max_iter=1000, tol=1e-6):

    Parameters
    ----------
    func : callable
        func(w, *args) is the evaluation of the function at w, It
        should return a float.
    grad_hess: callable
        returns the gradient and a callable with the hessian times
        an arbitrary vector.
    tol: float
        stopping criterion. XXX TODO. what is the stopping criterion ?

    Returns
    -------
    w : array

Stopping criterion

It stops whenever ||grad(x)|| < eps or the maximum number of iterations is attained.

TODO: add tol

Examples

Code

This software uses the C++ implementation of TRON optimization software (files src/tron.{h,cpp}) distributed from the LIBLINEAR sources (v1.93), which is BSD licensed. Note that the original Fortran TRON implementation (available here) is not open source and is not used in this project.

The modifications with respect to the orginal code are:

  • Do not initialize values to zero, allow arbitrary initializations

  • Modify stopping criterion to comply with scipy.optimize API. Stop whenever gradient is smaller than a given quantity, specified in the gtol argument

  • Return the gradient from TRON::tron (pass by reference)

  • Add tol option to TRON

  • Rename eps to gtol.

  • Use infinity norm as stopping criterion for gradient instead of L2.

TODO

  • return status from TRON::TRON

  • callback argument

References

If you use the software please consider citing some of the references below.

The method is described in the paper “Newton’s Method for Large Bound-Constrained Optimization Problems”, Chih-Jen Lin and Jorge J. Moré (http://epubs.siam.org/doi/abs/10.1137/S1052623498345075)

It is also discussed in the contex of Logistic Regression in the paper “Trust Region Newton Method for Logistic Regression”, Chih-Jen Lin, Ruby C. Weng, S. Sathiya Keerthi (http://dl.acm.org/citation.cfm?id=1390703)

The website http://www.mcs.anl.gov/~more/tron/ contains reference to this implementation, although the links to the software seem to be currently broken (May 2013).

License

This code is licensed under the terms of the BSD license. See file COPYING for more details.

Acknowledgement

The source code for the

Release files for pytron 0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytron 0.3
File Size Uploaded
pytron-0.3.tar.gz 111.7 kB Details

Release files / pytron-0.3.tar.gz

Download URL pytron-0.3.tar.gz
Size 111.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a9bb0a4eec1b15e62277ed46b49ef7ecd3daa2451e7bb223146ee1d7a4577b51
BLAKE2b-256 checksum
How to use checksums
854f83c9e51364868df79cc407ea837e8a8d120704655cdc1adfc4bfba93c631
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.3 This release

1 release file

0.2

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page