Skip to content

Commit

Permalink
Reformat to match black settings
Browse files Browse the repository at this point in the history
  • Loading branch information
NegatioN committed Nov 26, 2018
1 parent 1d9e1a7 commit 27d3057
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions lightfm/lightfm.py
Expand Up @@ -20,10 +20,20 @@

CYTHON_DTYPE = np.float32

model_weights = {'user_embeddings', 'user_biases', 'item_embeddings', 'item_biases',
'item_bias_momentum', 'item_bias_gradients', 'item_embedding_momentum',
'item_embedding_gradients', 'user_bias_momentum', 'user_bias_gradients',
'user_embedding_momentum', 'user_embedding_gradients'}
model_weights = {
"user_embeddings",
"user_biases",
"item_embeddings",
"item_biases",
"item_bias_momentum",
"item_bias_gradients",
"item_embedding_momentum",
"item_embedding_gradients",
"user_bias_momentum",
"user_bias_gradients",
"user_embedding_momentum",
"user_embedding_gradients",
}


class LightFM(object):
Expand Down Expand Up @@ -513,7 +523,9 @@ def load(self, path):
for value in [x for x in numpy_model if x in model_weights]:
setattr(self, value, numpy_model[value])

self.set_params(**{k: v for k, v in numpy_model.items() if k not in model_weights})
self.set_params(
**{k: v for k, v in numpy_model.items() if k not in model_weights}
)

def fit(
self,
Expand Down

0 comments on commit 27d3057

Please sign in to comment.