Comments (5)
Use a closure instead
-- John
On Sep 29, 2014, at 9:52 AM, Florian Oswald [email protected] wrote:
is there a way to have an objective function
f(x,a,b)
where x is the variable I want to minimize over, and a,b are parameters that are set somewhere else in the program? asked differently: can we have?optimize(f::Function,vargs...)
—
Reply to this email directly or view it on GitHub.
from optim.jl.
I think the docs call these "anonymous functions" rather than closures.
If performance becomes a concern (which seems a bit unlikely, but who knows), see also FastAnonymous.jl.
from optim.jl.
wouldn't have made it without the anonymous function pointer. thanks both!
y = 1.1
z = 8.4
optimize((x)->2x^2+3x+y-z, -2.0, 1.0)
from optim.jl.
can i just say that this is awesome? first time i see this. compared to R's environment()
or worrying about the ordering in the varargs
to the objective, that beats the lot of them.
from optim.jl.
Glad this helped. Closures are possible in R as well. The R community is just not very sophisticated about programming, so basic CS concepts tend not to talked about in public.
from optim.jl.
Related Issues (20)
- [Feature request] Adding Hill Climbing HOT 7
- Docs Latex expressions displays as raw HOT 4
- JuMP Interface, Incorrect Status Returned HOT 5
- Mac nightly fails for some reason
- IPNewton : start is not an interior point HOT 1
- CUDA and Adam errors HOT 3
- Incorrect referencing to ipnewton_basics.ipynb in Nonlinear constrained optimization HOT 1
- `Adam` supported by `Fminbox`? HOT 2
- Add progress meter HOT 1
- Documentation Incorrect HOT 2
- Simple optimization failing HOT 1
- Not all convergence criteria mentioned in documentation HOT 2
- `eval` in OptimMOIExt fails to precompile HOT 2
- Bounds Error in Neural Network Training Process HOT 1
- Expose more optimisation parameters to users HOT 4
- Extended trace for Adam fails
- Univariate minimization given function and derivatives HOT 1
- Problem with f_calls_limit in Fminbox
- Convergence of SAMIN is converted to non-convergence.
- Optim.OptimizationState HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from optim.jl.