Skip to content

gcp_opt with LBFGSB has no output with printitn= #260

Open
@jeremy-myers

Description

@jeremy-myers

Minimal working example

X = ttb.tenones((2, 2))
X[0, 1] = 0.0
X[1, 0] = 0.0
rank = 2

# Select Gaussian objective
objective = Objectives.GAUSSIAN

# Select LBFGSB solver with 2 max iterations
optimizer = LBFGSB(maxiter=1)

# Compute rank-2 GCP approximation to X with GCP-OPT
# Return result, initial guess, and runtime information
np.random.seed(0)  # Creates consistent initial guess
result_lbfgs, initial_guess, info_lbfgs = ttb.gcp_opt(
    data=X, rank=rank, objective=objective, optimizer=optimizer, printitn=1
)

# <-- No output

However, constructing LBFGSB with iprint= works:

# Select LBFGSB solver with 2 max iterations
optimizer = LBFGSB(maxiter=1, iprint=1)

# Compute rank-2 GCP approximation to X with GCP-OPT
# Return result, initial guess, and runtime information
np.random.seed(0)  # Creates consistent initial guess
result_lbfgs, initial_guess, info_lbfgs = ttb.gcp_opt(
    data=X, rank=rank, objective=objective, optimizer=optimizer
)

RUNNING THE L-BFGS-B CODE

           * * *

Machine precision = 2.220D-16
 N =          540     M =           10

At X0         0 variables are exactly at the bounds

At iterate    0    f=  9.14877D+06    |proj g|=  1.23309D+06

At iterate    1    f=  8.91367D+06    |proj g|=  9.45422D+05

           * * *

Tit   = total number of iterations
Tnf   = total number of function evaluations
Tnint = total number of segments explored during Cauchy searches
Skip  = number of BFGS updates skipped
Nact  = number of active bounds at final generalized Cauchy point
Projg = norm of the final projected gradient
F     = final function value

           * * *

   N    Tit     Tnf  Tnint  Skip  Nact     Projg        F
  540      1      2      1     0     0   9.454D+05   8.914D+06
  F =   8913669.7805772256     

STOP: TOTAL NO. of ITERATIONS REACHED LIMIT                 

Final fit: 0.09313583776378109 (for comparison to f(x) in CP-ALS)

CPU times: user 164 ms, sys: 111 ms, total: 275 ms
Wall time: 36.8 ms
 This problem is unconstrained.

If this is intended behavior, it should be documented.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdocumentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions