--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/0806a52bddaea5b5daac769d7a397aaf4cf027e4.camel%40thevertigo.com.
--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/fc531861dc7bd5c81fb95c80797483d0b218af84.camel%40thevertigo.com.
--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/90cf1c08016ebef8530a0b473bbf7ef7cc41fece.camel%40thevertigo.com.
--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/77eb663680383378d0ecba7a053511018f712b10.camel%40thevertigo.com.
--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/451b1fe22d80cfc616ddeabfde8eb1889948cffc.camel%40thevertigo.com.
In that case what is your cosine weight computation like?
--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/f9441c29871efd68074d6141eca65979565a15fe.camel%40thevertigo.com.
--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/c07ea6df527cb69159890aa1e356369b756aa2f5.camel%40thevertigo.com.
--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/48e69f2ea7dec62c83b0f9890e5cfe760d80a1ae.camel%40thevertigo.com.
On Sun, 2024-08-18 at 14:28 -0700, 'Sameer Agarwal' via Ceres Solver
wrote:
> This code is fine as far as I can tell.
Glad to hear that (kind of - since it still doesn't work).
> With random data I would not expect the solver to make much progress.
I'd imagine it may not be able converge with random data, but the
minimal should at the very least autodifferentiate?
> The gradient checking failure you are getting is likely because of
> the non-differentiable residual which comes from the fmax in the
> functor.
Is that still a problem if we increase the number of iterations or are
you saying I need to replace the fmax? If the latter I don't know how.
> The default number of iterations are not enough you should increase
> the number of iterations and run with real data to see how it does.
To increase the number of iterations, do you mean to increase
Solver::Options::max_num_iterations from the default of 150 to
something higher? If so, I've tried 500, 1500, and 15000 and it still
gives the same "Gradient Error detected!"
(2) I've set the maximum number of iterations to 500,000. The number of
iterations necessary to find a good solution I'm assuming will vary
widely across different problem domains and formulations. Is that
correct?
(3) When I test on real data it took over three hours to converge using
all logical cores using Solver::Options::num_threads set to
thread::hardware_concurrency(). Are there any options for Ceres Solver
you would recommend I experiment with to reduce that time?
Cost:
Initial 1.987583e+03
Final 1.385421e+03
Change 6.021622e+02
Minimizer iterations 10232
Successful steps 10222
Unsuccessful steps 10
Time (in seconds):
Preprocessor 0.001859
Residual only evaluation 45.426662 (10232)
Jacobian & residual evaluation 11811.069377 (10222)
Linear solver 15.100255 (10232)
Minimizer 11875.343345
Postprocessor 0.000121
Total 11875.345325
Termination: CONVERGENCE (Function tolerance reached. |cost_change|/cost: 3.994556e-07 <= 1.000000e-06)
(4) Based on the above time spent in the Jacobian & residual
evaluation, would it make sense to leverage a GPU and set
Solver::Options::dense_linear_algebra_library_type to ceres::CUDA? Or
would the amount of time moving data from CPU / RAM to the GPU make
that pointless?
(5) You can see that I've disabled bounds constraints on L420-436. I
don't see why they'd be necessary in this problem. Would you agree?
> Increasing the number of iterations will give you a better solution
> it does nothing to change gradient checking.
Understood. Which leads me to (6), is there anything else you would
suggest that might increase the quality of the solution? I tried
reducing the size of Solver::Options::function_tolerance from the
default 1e-6 to 1e-12, but to my surprise that reduced the accuracy. As
I understand it, that is the ratio of the current iteration's cost
delta and the remaining cost.
On Wed, 2024-08-21 at 12:38 -0700, Sameer Agarwal wrote:
> no. Your problem is tiny. you are not spending any time in the linear
> solver. All your time is in the Jacobian evaluation. I would focus on
> optimizing it.
Thanks Sameer. Any tips on that? I had suspected a GPU wouldn't do
anything here.
> Further your objective function is easily analytically
> differentiable, that should speed up your jacobian computation. But
> all that comes after you start getting solutions.
Sorry, I don't follow. Do you mean the objective function is easily
autodifferentiating by the optimizer, but that it should speed up as
the optimizer gets closer to convergence? I don't know what I could do
to speed up the Jacobian computation?
> > (5) You can see that I've disabled bounds constraints on L420-436.
> > I don't see why they'd be necessary in this problem. Would you
> > agree?
>
> you want the weights to be positive no?
I don't think it should in theory matter what value the weights are,
provided they create useful embeddings that respect as many of the
triplet predicates as possible. Or is there a benefit to having them
bounds constrained to being positive / some range?
I am saying that it will be faster since the function is essentially linear.
At this point this is out of my area of expertise.
--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/7675e21d385d85473606db06f0c5159cd77305b1.camel%40thevertigo.com.