# Set up step length for LBFGSBOptimizerv4

**URL:** https://discourse.itk.org/t/set-up-step-length-for-lbfgsboptimizerv4/288
**Category:** Algorithms
**Created:** [October 11, 2017, 2:34pm UTC](https://discourse.itk.org/t/set-up-step-length-for-lbfgsboptimizerv4/288 "2017-10-11T14:34:33Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Ray](https://discourse.itk.org/letter_avatar_proxy/v4/letter/r/e9a140/32.png) [@Ray](https://discourse.itk.org/u/Ray)
#### Post date: [October 11, 2017, 2:34pm UTC](https://discourse.itk.org/t/set-up-step-length-for-lbfgsboptimizerv4/288/1 "2017-10-11T14:34:33Z")

</div>

Hello!

I’m LBFGSBOptimizerv4 to perform optimization for BSpline registration. I want to set up step length for the optimizer, but it looks this class doesn’t provide this method: [https://itk.org/Doxygen/html/classitk\_1\_1LBFGSBOptimizerv4.html#a71e1357c63f5547b8e175e738a080930](https://itk.org/Doxygen/html/classitk_1_1LBFGSBOptimizerv4.html#a71e1357c63f5547b8e175e738a080930)

In LBFGSOptimizer, there is such a method called “SetDefaultStepLength()”: [https://itk.org/Doxygen/html/classitk\_1\_1LBFGSOptimizer.html#ae2c7ee103163ea6b36161632d9d9b539](https://itk.org/Doxygen/html/classitk_1_1LBFGSOptimizer.html#ae2c7ee103163ea6b36161632d9d9b539) . I wonder if there is a way to set up step length using LBFGSBOptimizerv4?

Thanks!

-Ray

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [October 11, 2017, 6:07pm UTC](https://discourse.itk.org/t/set-up-step-length-for-lbfgsboptimizerv4/288/2 "2017-10-11T18:07:58Z")

</div>

Judging by a quick look at the source code, there does not appear to be a way to set the step length. Why do you want to change it?

---

<div class="post-metadata">

### Author: ![Ray](https://discourse.itk.org/letter_avatar_proxy/v4/letter/r/e9a140/32.png) [@Ray](https://discourse.itk.org/u/Ray)
#### Post date: [October 11, 2017, 6:18pm UTC](https://discourse.itk.org/t/set-up-step-length-for-lbfgsboptimizerv4/288/3 "2017-10-11T18:18:52Z")

</div>

My moving image is very close to my target image. I’m a little worried that the step length is too large for my images, so I want to decrease it.
