Skip to content

Armijo linesearch does not allocate the right candidate point type #533

@kellertuer

Description

@kellertuer

If you try to run a code on typed points like

using Manopt, Manifolds
using ManifoldDiff: grad_distance
M = Hyperbolic(2)
data = PoincareBallPoint.([ [0.1, 0.2], [0.3,0.25], [0.35,0.4] ])
n = length(data)
f(M, p) = sum(1 / (2 * n) * distance.(Ref(M), Ref(p), data) .^ 2)
grad_f(M, p) = sum(1 / n * grad_distance.(Ref(M), data, Ref(p)));
m1 = gradient_descent(M, f, grad_f, data[1])

This errors since the candidate point within Armijo line search is an array (from the default representation on Hyperbolic) due to this line

candidate_point::P = allocate_result(M, rand),

allocating a default random point. A solution could be to pass the initial point to step sizes as well (optionally, so they rand otherwise to be nonbreaking) and use that points type to allocate the candidate.

Might affect other step sizes as well that are linesearch based (i.e. need a candidate).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions