#NEWLINE# def _initialize( self , no_components , no_item_features , no_user_features ) : #NEWLINE# #INDENT# '\n        Initialise internal latent representations.\n        ' #NEWLINE# self . item_embeddings = ( ( self . rng . rand ( no_item_features , no_components ) - 0.5 ) / no_components ) . astype ( np . float32 ) #NEWLINE# self . item_embedding_gradients = np . zeros_like ( self . item_embeddings ) #NEWLINE# self . item_embedding_momentum = np . zeros_like ( self . item_embeddings ) #NEWLINE# self . item_biases = np . zeros ( no_item_features , dtype = np . float32 ) #NEWLINE# self . item_bias_gradients = np . zeros_like ( self . item_biases ) #NEWLINE# self . item_bias_momentum = np . zeros_like ( self . item_biases ) #NEWLINE# self . user_embeddings = ( ( self . rng . rand ( no_user_features , no_components ) - 0.5 ) / no_components ) . astype ( np . float32 ) #NEWLINE# self . user_embedding_gradients = np . zeros_like ( self . user_embeddings ) #NEWLINE# self . user_embedding_momentum = np . zeros_like ( self . user_embeddings ) #NEWLINE# self . user_biases = np . zeros ( no_user_features , dtype = np . float32 ) #NEWLINE# self . user_bias_gradients = np . zeros_like ( self . user_biases ) #NEWLINE# self . user_bias_momentum = np . zeros_like ( self . user_biases ) #NEWLINE# if ( self . learning_schedule == 'adagrad' ) : #NEWLINE# #INDENT# self . item_embedding_gradients += 1 #NEWLINE# self . item_bias_gradients += 1 #NEWLINE# self . user_embedding_gradients += 1 #NEWLINE# self . user_bias_gradients += 1