Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
638 views
in Technique[技术] by (71.8m points)

python - Changing to TF 2, tf.contrib.opt.ScipyOptimizer

tf.contrib.opt.ScipyOptimizerInterface(self.loss, 
                                                  method = 'L-BFGS-B', 
                                                            options = {'maxiter': 50000,
                                                                       'maxfun': 50000,
                                                                       'maxcor': 50,
                                                                       'maxls': 50,
                                                                       'ftol' : 1.0 * 
                                                                     np.finfo(float).eps})

Can you please explain how to connect this one to the tf 2 version? What does each option changes to in the new version? I am new to python and tensor flow. I am trying to learn to program using an old code.

self.optimizer = tfp.optimizer.lbfgs_minimize(self.loss, initial_position= 
         ,max_iterations = 50000,  num_correction_pairs= 50,
             max_line_search_iterations= 50,
                   f_relative_tolerance = 1.0 * np.finfo(float).eps)    

I have changed it like this but I don't know what to give in the initial position

question from:https://stackoverflow.com/questions/65852644/changing-to-tf-2-tf-contrib-opt-scipyoptimizer

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...