code: def factorization_model(num_embeddings, bloom):
      if bloom:
          user_embeddings = BloomEmbedding(
              num_embeddings,
              EMBEDDING_DIM,
              num_hash_functions=NUM_HASH_FUNCTIONS,
          )
          item_embeddings = BloomEmbedding(
              num_embeddings,
              EMBEDDING_DIM,
              num_hash_functions=NUM_HASH_FUNCTIONS,
          )
      else:
          user_embeddings = ScaledEmbedding(
              num_embeddings, EMBEDDING_DIM
          )
          item_embeddings = ScaledEmbedding(
              num_embeddings, EMBEDDING_DIM
          )
  
      network = BilinearNet(
          num_embeddings,
          num_embeddings,
          user_embedding_layer=user_embeddings,
          item_embedding_layer=item_embeddings,
      )
  
      model = ImplicitFactorizationModel(
          loss="adaptive_hinge",
          n_iter=N_ITER,
          embedding_dim=EMBEDDING_DIM,
          batch_size=2048,
          learning_rate=1e-2,
          l2=1e-6,
          representation=network,
          use_cuda=CUDA,
      )
  
      return model
  
file_path: spotlight/examples/bloom_embeddings/performance.py
imports: import os
  import pickle
  import time
  import numpy
  import torch
  from spotlight.layers import BloomEmbedding, ScaledEmbedding
  from spotlight.factorization.implicit import ImplicitFactorizationModel
  from spotlight.factorization.representations import BilinearNet
  from spotlight.sequence.implicit import ImplicitSequenceModel
  from spotlight.sequence.representations import LSTMNet
  from spotlight.datasets.movielens import get_movielens_dataset
label_desc: Use image node_id 2 for calling a global function with example usage: factorization_model(num_embeddings, bloom) and returns: model