This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bd = BenchmarkData(Xdata = Xdata(MvNormal, NoCorrelation), | |
wdist = BinChoice(), | |
noisedist = Normal(), | |
SNR = 20.0, | |
nfeatures = 1000, | |
sparsity = 10, | |
nrange = collect(100:20:500) | |
) | |
m = RelaxDualSubgradient(gamma = 1.0, ConstantStepping(1e-3)) | |
results = benchmark(bd, m) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using JLD | |
using SparseArrays | |
a = sprand(100, 100, 0.1) | |
JLD.save("a.jld", "a", a) | |
write( | |
"test.jl", | |
""" | |
using JLD | |
using SparseArrays |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
write( | |
"test2.jl", | |
""" | |
using LinearAlgebra, Random | |
a = rand(10, 10) | |
b = Symmetric(a * a') | |
f = cholesky(b) | |
""" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# JLD in https://drive.google.com/file/d/1ixztoXBV7qKPW6BQ8VNRPzzbj01Txw2B/view?usp=sharing | |
using JLD, ECOS, MathOptFormat, MathOptInterface | |
const MOI = MathOptInterface | |
const MOIB = MathOptInterface.Bridges | |
const MOIU = MathOptInterface.Utilities | |
model = MathOptFormat.read_from_file(joinpath(cblib_dir, "LogExpCR-n20-m400.cbf.gz")) | |
cache = MOIU.UniversalFallback(MOIU.Model{Float64}()); | |
MOI.copy_to(cache, model); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# script: | |
import Pkg | |
Pkg.add(url="https://github.com/lkapelevich/SegExample.jl") | |
using SegExample | |
SegExample.foo() | |
# backtrace: | |
(gdb) r | |
Starting program: /home/ptah/julia/usr/bin/julia-debug /home/ptah/.julia/dev/seg.jl | |
[Thread debugging using libthread_db enabled] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pkg.add(url = "https://github.com/chriscoey/Hypatia.jl") | |
import Hypatia.Cones | |
cone = Cones.MatrixEpiPerSquare{Float64, Float64}(1, 1) | |
Cones.setup_data(cone) | |
pt = Cones.set_initial_point(zeros(3), cone) | |
Cones.load_point(cone, pt) | |
Cones.is_feas(cone) | |
Cones.grad(cone) | |
Cones.correction(cone, ones(3)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using LinearAlgebra | |
import GenericLinearAlgebra | |
import ForwardDiff | |
import Random | |
Random.seed!(1) | |
d = 5 | |
rand_W = randn(d, d) | |
rand_W = rand_W * rand_W' | |
bad_W = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cf https://math.stackexchange.com/questions/540361/derivative-or-differential-of-symmetric-square-root-of-a-matrix | |
using ForwardDiff | |
using LinearAlgebra | |
using GenericLinearAlgebra | |
d = 3 | |
V = randn(d, d) | |
V = Hermitian(V * V' + I) | |
W = randn(d, d) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#= | |
analyze natvsext benchmark results | |
see natvsext/README.md | |
=# | |
using Printf | |
using CSV | |
using DataFrames | |
include(joinpath(@__DIR__, "../../examples/Examples.jl")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using JuMP | |
import Hypatia | |
import Hypatia.PolyUtils | |
using LinearAlgebra | |
n = 2 | |
halfd = 2 | |
k = 3 # number of functions defining nonnegativity domain | |
# try good interpolation points from [-1, 1]^n: |
OlderNewer