fixes
This commit is contained in:
@ -307,16 +307,16 @@ function lasso(x::Union{Nothing, AbstractVecOrMat})
|
||||
|
||||
if isnothing(x) # informative call
|
||||
v = ( 2 - 1/3 )^2 + 10/9 # optimal solution [ 1/9 , 0 ]
|
||||
return (v, [0, 0])
|
||||
return (v, [0., 0.], nothing)
|
||||
else
|
||||
v = ( 3 * x( 1 ) + 2 * x( 2 ) - 2 )^2 +
|
||||
10 * ( abs( x( 1 ) ) + abs( x( 2 ) ) ) # f(x)
|
||||
v = (3 * x[1] + 2 * x[2] - 2)^2 +
|
||||
10 * (abs(x[1]) + abs(x[2])) # f(x)
|
||||
|
||||
g = zeros(2)
|
||||
g[1] = 18 * x[1] + 12 * x[2] - 12 + 10 * sign( x[1] )
|
||||
g[2] = 12 * x[1] + 8 * x[2] - 8 + 10 * sign( x[2] )
|
||||
g[1] = 18 * x[1] + 12 * x[2] - 12 + 10 * sign(x[1])
|
||||
g[2] = 12 * x[1] + 8 * x[2] - 8 + 10 * sign(x[2])
|
||||
|
||||
return (v, g)
|
||||
return (v, g, nothing)
|
||||
end
|
||||
end # lasso
|
||||
|
||||
|
||||
Reference in New Issue
Block a user