Skip to content

Commit

Permalink
asp bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Ortner committed Sep 11, 2024
1 parent f892f48 commit 56dcdcc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/asp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ function solve(solver::ASP, A, y, Aval=A, yval=y)
tracer = asp_homotopy(AP, y; solver.params...)

q = length(tracer)
every = max(1, q ÷ solver.nstore)
istore = unique([1:every:q; q])
every = max(1, q / solver.nstore)
istore = unique(round.(Int, [1:every:q; q]))
new_tracer = [ (solution = tracer[i][1], λ = tracer[i][2], σ = 0.0 )
for i in istore ]

Expand Down
7 changes: 6 additions & 1 deletion test/test_asp.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using ACEfit
using LinearAlgebra, Random, Test
using Random

##

Expand Down Expand Up @@ -29,6 +28,12 @@ Av = A[val_indices,:]
yt = y[train_indices]
yv = y[val_indices]

for (nstore, n1) in [ (20, 21), (100, 101), (200, 165)]
solver = ACEfit.ASP(P=I, select = :final, nstore = nstore, loglevel=0, traceFlag=true)
results = ACEfit.solve(solver, A, y)
@test length(results["path"]) == n1
end

for (select, tolr, tolc) in [ (:final, 10*epsn, 1),
( (:byerror,1.3), 10*epsn, 1),
( (:bysize,73), 1, 10) ]
Expand Down

0 comments on commit 56dcdcc

Please sign in to comment.