import argparse from test_function import run if __name__ == '__main__': parser = argparse.ArgumentParser(description='Step methods') parser.add_argument('-f', '--function', default="rosenbrock", type=str, help='Function to minimize: rosenbrock, wood') parser.add_argument('-m', '--method', default="dfp", type=str, help='Quasi-Newton optimization method: dfp, bfgs') args = parser.parse_args() run(args.function, args.method)
import argparse from test_function import run if __name__ == '__main__': parser = argparse.ArgumentParser(description='Step methods') parser.add_argument('-p', '--point', default="const", type=str, help='Type of starting point x: const, rand') parser.add_argument('-f', '--function', default="rosenbrock", type=str, help='Function to minimize: rosenbrock, wood') parser.add_argument('-b', '--beta', default="fr", type=str, help='Function to minimize: fr, pr, hs') args = parser.parse_args() run(args.point, args.function, args.beta)
import argparse from test_function import run if __name__ == '__main__': parser = argparse.ArgumentParser(description='Newton method') parser.add_argument('-s', '--step', default="fijo", type=str, help='Gradient step size method to use: fijo, hess, back') parser.add_argument('-p', '--point', default="const", type=str, help='Type of starting point x: const, rand') parser.add_argument('-l', '--lambda_', default=1, type=int, help='Function parameter: 1, 100, 1000') parser.add_argument('-m', '--method', default="newton", type=str, help='Optimization method: gd, newton') args = parser.parse_args() run(args.step, args.point, args.lambda_, args.method)
import argparse from test_function import run if __name__ == '__main__': parser = argparse.ArgumentParser(description='Step methods') parser.add_argument( '-s', '--step', default="cubic", type=str, help='Gradient step size method to use: cubic, barzilai, zhang') parser.add_argument('-p', '--point', default="const", type=str, help='Type of starting point x: const, rand') parser.add_argument('-f', '--function', default="rosenbrock", type=str, help='Function to minimize: rosenbrock, wood, mnist') args = parser.parse_args() run(args.step, args.point, "gd", args.function)
import argparse from test_function import run if __name__ == '__main__': parser = argparse.ArgumentParser(description='Step methods') parser.add_argument('-p', '--point', default="const", type=str, help='Type of starting point x: const, rand') parser.add_argument('-f', '--function', default="quadratic", type=str, help='Function to minimize: quadratic') parser.add_argument('-d', '--dim', default=128, type=int, help='Dimension of function matrix') parser.add_argument('-l', '--penalization', default=1, type=int, help='Regularization parameter') args = parser.parse_args() run(args.point, args.dim, args.penalization, args.function)
import argparse from test_function import run if __name__ == '__main__': parser = argparse.ArgumentParser(description='Newton method') parser.add_argument('-m', '--method', default="dogleg", type=str, help='Method to use: dogleg, lstr') parser.add_argument('-p', '--point', default="const", type=str, help='Type of starting point x: const, rand') args = parser.parse_args() run(args.method, args.point)