Git Product home page Git Product logo

asgd's People

Contributors

jaberg avatar npinto avatar yamins81 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

asgd's Issues

Ready to test!

I fixed all the (apparent) issues with C and BLAS, and now all BLAS functions are called with the right matrix/version dimensions. I gdb'ed them and they all appear to write in the proper memory location. Also, I cleaned up the C file a little bit. Notice that I created a new branch, caa_blas, for the development of the blas-based algorithm.

Now I should start testing that I implemented the logic of the algorithm as a whole correctly. I think a good approach would be to first have a unit test for each of the three functions, and then some integration test for the algorithm. That would be good especially if you plan to push the software as a public library, and to guarantee the correctness of future edits. What do you think?

For the specifics of testing, I can't exactly replicate the python test, as I doubt that the NumPy Mersenne Twister yields the same sequences as the LCG in glibc when seeded with the same seeds (42 and 43). So, if I want to start by testing everything in C, I should find some other way to do it. Any suggestions about this? I am hoping to make much progress from the testing on.

Finally, let me know when you have a chance to pass me the real testing matrices and the reference to the Python wrapping tools that you suggest, so I can also start looking at these. I know you are busy lately, so no worries.

Let me know...

re-parameterize annealing schedule

Remember the previous discussion we had about whether the l2_regularization parameter should be allowed to be 0? I think that was related to a mis-parameterization of the BaseASGD object.  

Background: the schedule implemented takes the form C(t) =  C0 (1 + C0 k t)^a, where C0 is the initial sgd step size, t is the number of iterations so far, a is the annealing exponent, and k is an extra multiplier on the time. This form is recommended in [1].

The current naive_asgd implementation hardcodes k = l2_regularization, as suggested in [2].

This leads to weirdness though because C0 is typically like 1e-2 or 1e-3, and l2_regularization should usually be something like 1e-6. In the most aggressive case we end have a schedule like

C(t) =  C0 (1 + 1e-8 t)^a

For a normal choice of a=.5 this is basically un-annealed SGD, since it takes 100 million examples to get the learning rate from C0 down to C0/sqrt(2). I'm not that confident in saying it, but I don't think this was how the annealing was meant to be used.

I think this could be improved in two ways:

  1. removing the second appearance of C0 from the annealing schedule (simplify things... why put it in twice? and It is not used in [3])
  2. make k default to C0, rather than l2_regularization
  3. make k a parameter of BaseASGD because both [2] and [3] say it's problem-dependent.

[1] http://arxiv.org/pdf/1107.2490v2
[2] http://www.dbs.ifi.lmu.de/~yu_k/cvpr11_0694.pdf
[3] http://hal.archives-ouvertes.fr/docs/00/60/80/41/PDF/gradsto_hal.pdf

The Cython wrapper cannot find the symbols defined by BLAS

I am having an issue with cython. The cython file compiles correctly to C, and the C file also compiles correctly to .so (see first target of the Makefile on branch caa_devel). However, when I import the .so in python, python complains that
ImportError: ./pasgd.so: undefined symbol: cblas_sdsdot

I am not using cblas_sdsdot in python, and also the function is in fact defined (either in simple_blas.c or from libcblas.so). This sounds like a silly issue, like me not giving some necessary parameter to Python. Did you ever encounter something like this? Suggestions?

BLAS and heap safety

I have integrated BLAS in the code, and all functions are complete. However, a BLAS call causes a memory corruption: I need to track it down and correct it. It is probably a wrong size parameter (e.g. sizeof(*x) instead of 1). Lack of documentation for BLAS (both the NetLib version and OpenBLAS) is definitely an issue - will have to be more careful.

After this, I will need to unit-test the code. A preliminary step could be testing the code entirely in C (which makes testing harder, but allows me to test before writing the Python wrapper) or wrapping the functions first (allows for a more flexible testing, but potentially introduces issues with wrapping).

Working feedback

feedback should be restored (btw, it was used in LeCun's NIPS'11 optimization challenge)

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.