Skip to content

Negative Loss on gpu ALS model #367

@sikhad

Description

@sikhad

I'm getting a negative loss value when running ALS using GPU (loss = -.0346) regardless of varying all parameters. When running the same data/parameters on CPU, I'm getting a positive loss. I'm confused why loss could be negative.

It's a ~6500 x 1m csr matrix.

params = {'factors':64, 
          'use_gpu':True, 
          'use_native':True, 
          'use_cg':True, 
          'regularization':0, 
          'num_threads':0,
          'iterations':5,
          'calculate_training_loss':True}

# initialize a model
model = implicit.als.AlternatingLeastSquares(**params)

# train the model on a sparse matrix of item/user/confidence weights
model.fit(csr, show_progress=True)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions