Awesome! Just tried thisAlvaroBegue wrote:
Yes. Just download the repository here: https://bitbucket.org/alonamaloh/ruy_tune
The file sample/tune.cpp contains an example that finds the material values. The file sample/evaluation_parameters has the initial guesses, which are all 0.
Code: Select all
daniel@daniel-Satellite-C855:~/tune/ruy_tune/sample$ time ./tune
Iteration 1: fx=0.254122 xnorm=225.906 gnorm=0.00107094 step=16849.2
Iteration 2: fx=0.226642 xnorm=308.495 gnorm=0.00129121 step=1
Iteration 3: fx=0.190256 xnorm=305.099 gnorm=0.000439781 step=1
Iteration 4: fx=0.17945 xnorm=335.221 gnorm=0.000254876 step=1
Iteration 5: fx=0.160943 xnorm=430.828 gnorm=0.000239747 step=1
Iteration 6: fx=0.143313 xnorm=577.106 gnorm=0.000139124 step=1
Iteration 7: fx=0.134633 xnorm=758.539 gnorm=0.000118312 step=1
Iteration 8: fx=0.129293 xnorm=924.942 gnorm=0.000109973 step=1
Iteration 9: fx=0.126691 xnorm=1060.07 gnorm=2.79885e-05 step=1
Iteration 10: fx=0.126251 xnorm=1124.05 gnorm=1.54913e-05 step=1
Iteration 11: fx=0.125993 xnorm=1200.32 gnorm=6.48393e-06 step=1
Iteration 12: fx=0.125989 xnorm=1202.11 gnorm=3.96651e-06 step=0.0918372
Iteration 13: fx=0.125976 xnorm=1220.09 gnorm=1.36075e-06 step=1
Iteration 14: fx=0.125975 xnorm=1220.76 gnorm=2.78424e-07 step=1
Iteration 15: fx=0.125975 xnorm=1220.57 gnorm=7.5212e-08 step=0.28461
L-BFGS optimization terminated with status code = 0
real 0m53.938s
user 0m53.788s
sys 0m0.152s
Btw, have you considered using radial basis functions (RBF) to reduce the number of objective function calls ? Automatic differentiation is fast but RBF serves the same purpose with a black box objective that does not give the gradient.
Daniel