hjmshi / noise-tolerant-bfgs Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
I am sometimes getting this error when I pass scalars for eps_f
and eps_g
:
UnboundLocalError Traceback (most recent call last)
~/Projects/multinomial_probit/safe/asan2.py in <module>
9 idx = rng.choice(X.shape[0], size=10_000)
10 model = MultinomialProbitRegression(lambda_=1e-4, presolve_logistic=False)
---> 11 model.fit(X[:10_000], y[:10_000])
12 np.mean(model.predict(X[:10_000]) == y[:10_000])
~/Projects/multinomial_probit/multinomial_probit/__init__.py in fit(self, X, y, sample_weights)
196 maxferr = X.shape[0] * 0.1
197 import ntqn
--> 198 x_opt, f_opt, iters, f_evals, g_evals, flag, results = ntqn.bfgs_e(
199 _mnp_fun_glob, _mnp_grad_glob, optvars, eps_f=maxferr,
200 eps_g=maxferr
~/Projects/noise-tolerant-bfgs-master/ntqn.py in bfgs_e(func, grad, x0, eps_f, eps_g, callback, options)
331 f_old = f_k
332 alpha, beta, mu_hat, f_k, g_new, eps_fk, eps_gk, ls_fevals, ls_gevals, armijo_flag, wolfe_flag, split_flag = \
--> 333 _line_search_nt_wolfe(func, grad, x_k, p_k, eps_f=eps_f, eps_g=eps_g, f_k=f_k, g_k=g_k,
334 alpha_init=options['alpha_init'], beta_init=options['beta_init'], mu=mu,
335 c1=options['c1'], c2=options['c2'], c3=options['c3'],
~/Projects/noise-tolerant-bfgs-master/ntqn.py in _line_search_nt_wolfe(func, grad, x_k, p_k, eps_f, eps_g, f_k, g_k, alpha_init, beta_init, mu, c1, c2, c3, split_iter, max_ls_iter, verbose)
860 if not wolfe_flag:
861 beta, g_new, gtp_new, eps_gp, fevals_length, gevals_length, wolfe_flag = \
...
--> 862 _lengthening(grad, x_k, p_k, beta=beta, eps_g=eps_g, g_k=g_k, eps_gk=eps_gk, eps_gp=eps_gp, gtp=gtp,
863 g_new=g_new, gtp_new=gtp_new, norm_pk=norm_pk, c3=c3, max_ls_iter=max_ls_iter,
864 verbose=verbose)
UnboundLocalError: local variable 'eps_gp' referenced before assignment
Can provide a long example file if needed for reproducibility.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.