StructuredOptimization.jl
Structured optimization in Julia
Install / Use
/learn @JuliaFirstOrder/StructuredOptimization.jlREADME
StructuredOptimization.jl
StructuredOptimization.jl is a high-level modeling language that utilizes a syntax that is very close to the mathematical formulation of an optimization problem.
This user-friendly interface acts as a parser to utilize three different packages:
StructuredOptimization.jl can handle large-scale convex and nonconvex problems with nonsmooth cost functions.
It supports complex variables as well.
Installation
To install the package, hit ] from the Julia command line to enter the package manager, then
pkg> add StructuredOptimization
Usage
A least absolute shrinkage and selection operator (LASSO) can be solved with only few lines of code:
julia> using StructuredOptimization
julia> n, m = 100, 10; # define problem size
julia> A, y = randn(m,n), randn(m); # random problem data
julia> x = Variable(n); # initialize optimization variable
julia> λ = 1e-2*norm(A'*y,Inf); # define λ
julia> @minimize ls( A*x - y ) + λ*norm(x, 1); # solve problem
julia> ~x # inspect solution
100-element Array{Float64,1}:
0.0
0.0
0.0
0.440254
0.0
0.0
0.0
[...]
See the documentation for more details about the type of problems StructuredOptimization.jl can handle and the demos to check out some examples.
Related Skills
node-connect
353.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
111.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
353.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
353.3kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
