Skip to content
GitLab
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
    Projects Groups Snippets
  • Sign up now
  • Login
  • Sign in / Register
  • eigen eigen
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 681
    • Issues 681
    • List
    • Boards
    • Service Desk
    • Milestones
    • Requirements
  • Custom issue tracker
    • Custom issue tracker
  • Merge requests 20
    • Merge requests 20
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • libeigenlibeigen
  • eigeneigen
  • Issues
  • #733
Closed
Open
Issue created Dec 04, 2019 by Eigen Bugzilla@eigenbzReporter

CG: Documentation proposes degeneration to Gradient Descent

Submitted by wae..@..il.com

Assigned to Nobody

Link to original bugzilla bug (#733)
Version: 3.2

Description

The documentation of ConjugateGradient gives an example of how CG can be run step by step:

"Here is a step by step execution example starting with a random guess and printing the evolution of the estimated error:

  • x = VectorXd::Random(n);
  • cg.setMaxIterations(1);
  • int i = 0;
  • do {
  • x = cg.solveWithGuess(b,x);
  • std::cout << i << " : " << cg.error() << std::endl;
  • ++i;
  • } while (cg.info()!=Success && i<100);
    Note that such a step by step excution is slightly slower."

With this my optimization problem took ~1400 iterations and later I found out that it only takes ~180 if not done step wise.

As I see it, every time solveWithGuess is called CG is restarted. CG's first iteration is identical to gradient descent and thus the whole optimization effectively degenerates to gradient descent. The note "that such a step by step excution is slightly slower." does not really capture it. Also the evolution of the estimated errors that are being printed to std::cout are not the true CG errors because real CG would converge quicker.

Maybe the documentation can be changed such that it

  1. suggests to use much more than 1 iteration in each solveWithGuess step.
  2. mentions that too small maxIteration numbers make CG degenerate?
Edited Dec 05, 2019 by Eigen Bugzilla
Assignee
Assign to
Time tracking