How to use steepest decent in re minimization?

43 views
Skip to first unread message

dd ding

unread,
Jan 24, 2024, 10:52:48 AMJan 24
to votca
Hello, may I ask if the deepest method in votca2024 can now be applied? If cg. inverse. re. do is set in XML_ Step, an error message will appear stating "The settings XML file contains the tags which do not exist in the XML defaults file:
./inverse/re/do_ Step. May I ask what the reason is? Also, I would like to ask, after setting "Hessian check=false", does the Newton method not detect whether the Hessian matrix is positive definite, or is it not using the Newton method at this point?

Christoph Junghans

unread,
Jan 24, 2024, 12:07:42 PMJan 24
to vo...@googlegroups.com
On Wed, Jan 24, 2024 at 8:52 AM dd ding <winter...@gmail.com> wrote:
>
> Hello, may I ask if the deepest method in votca2024 can now be applied?
Not sure, do you mean steepest descent method? If so you can only use
that in the prepare step for each iteration, but not the iteration run
itself.
I guess you could force VOTCA to use it for the normal iteration as
well, but that would not be NVT ensemble anymore.

If cg. inverse. re. do is set in XML_ Step, an error message will
appear stating "The settings XML file contains the tags which do not
exist in the XML defaults file:
> ./inverse/re/do_ Step. May I ask what the reason is?
Since VOTCA 2023, we check a bit more aggressively for unknown
options, to help the users with typos.
I think you mean the option <do_potential>, and a couple of postadd
scripts have a <do> option as well.

> Also, I would like to ask, after setting "Hessian check=false", does the Newton method not detect whether the Hessian matrix is positive definite, or is it not using the Newton method at this point?
By default the csg_reupdate / the relative entropy method checks with
the Hessian is positive definite, but for development purposes we have
an option to disable that check, but you cannot get to it easily
outside the testing framework, i.e. there is no option in the XML file
to disable it.

Hope that helps,

Christoph

>
> --
> Join us on Slack: https://join.slack.com/t/votca/signup
> ---
> You received this message because you are subscribed to the Google Groups "votca" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to votca+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/votca/cc2e725f-f582-4146-a83f-0adfacaa3978n%40googlegroups.com.



--
Christoph Junghans
Web: http://www.compphys.de

dd ding

unread,
Jan 27, 2024, 1:56:30 AMJan 27
to votca
First of all, thank you very much for your reply.And I still want to add something to the question I raised last time.

1. In the source code for reupdate.cc, I see a comment in the BeginEvaluate function that reads: dosteep_=options_.get(" cg.invert.re.do_steep ").as<bool>(); So I added the setting of true in the cg.invert.re.do_steep position in setting.xml, but an error was reported during running. Does this comment mean that the function of do_steep is only developed internally at present, so it is not available in the release version of votca?
vot1.png


2. The basic principles and differences of Steepest decent and newton-raphson methods.
In my personal understanding, the newton-raphson method is an improvement of steepest decent, which is steepest decent using a first-order derivative to minimize a variable x. However, this method usually can not correctly choose the shortest path to make the parameter drop to the lowest point, so it may be repeated in the calculation process, so it is difficult to converge. The NR method adds the second derivative, also known as the hessian matrix, to the SD method to help the parameter x to choose the right direction in the process of minimizing from a certain position to the lowest position, avoiding repeated calculation around the same value, so it can achieve convergence faster.

vot2.pngsteepest decent method


vot3.pngnewton-raphson method

From the above understanding, I was thinking, if I set hessian-check = false, it means that in the newton-rephson method, I no longer consider whether the second derivative matrix is positive definite, so only the first derivative matters, Is this somehow equivalent to using steepest decent methods?


3. Hessian-check = false test.
In my own tests, I can add the hessian-check = false setting to this location in setting.xml, and it does work. After I add this setting, I will no longer be unable to run the hessian matrix because it is not definite.


vot4.png


In reupdate.cc, there is a comment in the middle that the newton-raphson method cannot be used in the case of mathematical errors, and that steepest decent could be considered as an alternative, but that steepest decent has not yet been applied in the program.

vot5.png

But in the code that follows, the last line in the screenshot, dlamda = -DS_, means that after hessian-check = false is set, it will run dlamda = -DS_, which is the mathematical form of steepest decent, which has been applied.
So I want to know what does the mathematical formula dlamda = -DS_ mean when it appears here? Is this the steepest decent method that has been perfected? Or is this just a newton-raphson method that doesn't take into account whether the hessian matrix is positive definite? Or is this just a line of test code that doesn't actually run?



These are my questions, best wishes.

Christoph Junghans

unread,
Jan 27, 2024, 10:21:51 AMJan 27
to vo...@googlegroups.com
On Fri, Jan 26, 2024 at 11:56 PM dd ding <winter...@gmail.com> wrote:
First of all, thank you very much for your reply.And I still want to add something to the question I raised last time.
Unfortunately csg_reupdate is not a part that I wrote, so take my answers with a grain of salt.

I think the do_steep option is commented out as the same functionality can be achieved by disabling the hessian check.
However, disabling the hessian check is not something we recommend you use as also stated in the warning message.
You can certainly move forward by hacking it in csg_reupdate.opts, but then you are in uncharted territory.
I will leave it to one of the csg_reupdate developers to respond to the more technical questions.
 
Sorry,

Christoph

dd ding

unread,
Jan 27, 2024, 12:08:52 PMJan 27
to votca
Thanks anyway. I appreciate your support.
Reply all
Reply to author
Forward
0 new messages