Skip to content

Commit

Permalink
Undo some formatting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dahong67 committed Feb 29, 2024
1 parent 4e1aee5 commit 357b774
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/gcp-opt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ function _gcp(
) where {TX,N}
# T = promote_type(nonmissingtype(TX), Float64)
T = Float64 # LBFGSB.jl seems to only support Float64

# Compute lower bound from constraints
lower = maximum(constraint.value for constraint in constraints; init = T(-Inf))

Expand Down Expand Up @@ -106,6 +107,7 @@ function _gcp(
gcp_grad_U!(GU, CPD(ones(T, r), U), X, loss)
return gu
end

# Run LBFGSB
lbfgsopts = (; (pn => getproperty(algorithm, pn) for pn in propertynames(algorithm))...)
u = lbfgsb(f, g!, u0; lb = fill(lower, length(u0)), lbfgsopts...)[2]
Expand Down Expand Up @@ -180,7 +182,6 @@ end
section III-B.
"""
function mttkrp(X, U, n)

# Dimensions
N, I, r = length(U), Tuple(size.(U, 1)), (only unique)(size.(U, 2))
(N == ndims(X) && I == size(X)) ||
Expand Down

0 comments on commit 357b774

Please sign in to comment.