Distributed Processing: Training¶
The distributed processing mode assumes that the data set is split in nblocks
blocks across computation nodes.
Algorithm Parameters¶
At the training stage, implicit ALS recommender in the distributed processing mode has the following parameters:
Parameter 
Default Value 
Description 


Not applicable 
The parameter required to initialize the algorithm. Can be:



The floatingpoint type that the algorithm uses for intermediate computations. Can be 


Performanceoriented computation method for CSR numeric tables, the only method supported by the algorithm. 

\(10\) 
The total number of factors. 

\(5\) 
The number of iterations. 

\(40\) 
The rate of confidence. 

\(0.01\) 
The parameter of the regularization. 

\(0\) 
Threshold used to define preference values. \(0\) is the only threshold supported so far. 
Computation Process¶
At each iteration, the implicit ALS training algorithm alternates between recomputing user factors (\(X\)) and item factors (\(Y\)). These computations split each iteration into the following parts:
Recompute all user factors using the input data sets and item factors computed previously.
Recompute all item factors using input data sets in the transposed format and item factors computed previously.
Each part includes four steps executed either on local nodes or on the master node, as explained below and illustrated by graphics for \(\mathrm{nblocks} = 3\). The main loop of the implicit ALS training stage is executed on the master node.
Step 1  on Local Nodes¶
This step works with the matrix:
Parts of this matrix are used as input partial models.
In this step, implicit ALS recommender training accepts the input described below.
Pass the Input ID
as a parameter to the methods that provide input for your algorithm.
For more details, see Algorithms.
Input ID 
Input 


Partial model computed on the local node. 
In this step, implicit ALS recommender training calculates the result described below.
Pass the Result ID
as a parameter to the methods that access the results of your algorithm.
For more details, see Algorithms.
Result ID 
Result 


Pointer to the \(f \times f\) numeric table with the sum of numeric tables calculated in Step 1. 
Step 2  on Master Node¶
This step uses local partial results from Step 1 as input.
In this step, implicit ALS recommender training accepts the input described below.
Pass the Input ID
as a parameter to the methods that provide input for your algorithm.
For more details, see Algorithms.
Input ID 
Input 


A collection of numeric tables computed on local nodes in Step 1. Note The collection may contain objects of any class derived from 
In this step, implicit ALS recommender training calculates the result described below.
Pass the Result ID
as a parameter to the methods that access the results of your algorithm.
For more details, see Algorithms.
Result ID 
Result 


Pointer to the \(f \times f\) numeric table with merged crossproducts. 
Step 3  on Local Nodes¶
On each node \(i\), this step uses results of the previous steps and requires that you provide two extra matrices Offset Table i and Input of Step 3 From Init i computed at the initialization stage of the algorithm.
The only element of the Offset Table i table refers to the:
\(i\)th element of the
offsets
collection from the step 2 of the distributed initialization algorithm in part 1 of the iteration\(i\)th element of the
offsets
collection from the step 1 of the distributed initialization algorithm in part 2 of the iteration
The Input Of Step 3 From Init is a keyvalue data collection that refers to the outputOfInitForComputeStep3
output of the initialization stage:
Output of the step 1 of the distributed initialization algorithm in part 1 of the iteration
Output of the step 2 of the distributed initialization algorithm in part 2 of the iteration
In this step, implicit ALS recommender training accepts the input described below.
Pass the Input ID
as a parameter to the methods that provide input for your algorithm.
For more details, see Algorithms.
Input ID 
Input 


Partial model computed on the local node. 

A numeric table of size \(1 \times 1\) that holds the global index of the starting row of the input partial model.
A part of the keyvalue data collection 
In this step, implicit ALS recommender training calculates the result described below.
Pass the Result ID
as a parameter to the methods that access the results of your algorithm.
For more details, see Algorithms.
Result ID 
Result 


A keyvalue data collection that contains partial models to be used in Step 4.
Each element of the collection contains an object of the 
Step 4  on Local Nodes¶
This step uses the results of the previous steps and parts of the following matrix in the transposed format:
The results of the step are the recomputed parts of this matrix.
In this step, implicit ALS recommender training accepts the input described below.
Pass the Input ID
as a parameter to the methods that provide input for your algorithm.
For more details, see Algorithms.
Input ID 
Input 


A keyvalue data collection with partial models that contain user factors/item factors
computed in Step 3.
Each element of the collection contains an object of the 

Pointer to the CSR numeric table that holds the \(i\)th part of the input data set, assuming that the data is divided by users/items. 

Pointer to the \(f \times f\) numeric table computed in Step 2. 
In this step, implicit ALS recommender training calculates the result described below.
Pass the Result ID
as a parameter to the methods that access the results of your algorithm.
For more details, see Algorithms.
Result ID 
Result 


Pointer to the partial implicit ALS model that corresponds to the \(i\)th data block. The partial model stores user factors/item factors. 

Pointer to the partial implicit ALS model that corresponds to the \(i\)th data block. The partial model stores user factors/item factors. 