48 #ifndef __IMPLICIT_ALS_TRAINING_TYPES_H__ 49 #define __IMPLICIT_ALS_TRAINING_TYPES_H__ 51 #include "algorithms/implicit_als/implicit_als_model.h" 52 #include "data_management/data/csr_numeric_table.h" 61 namespace implicit_als
89 enum NumericTableInputId
92 lastNumericTableInputId = data
101 inputModel = lastNumericTableInputId + 1,
102 lastModelInputId = inputModel
109 enum PartialModelInputId
113 lastPartialModelInputId = partialModel
123 inputOfStep2FromStep1,
125 lastMasterInputId = inputOfStep2FromStep1
133 enum DistributedPartialResultStep1Id
135 outputOfStep1ForStep2,
137 lastDistributedPartialResultStep1Id = outputOfStep1ForStep2
145 enum DistributedPartialResultStep2Id
147 outputOfStep2ForStep4 ,
149 lastDistributedPartialResultStep2Id = outputOfStep2ForStep4
157 enum Step3LocalCollectionInputId
159 partialModelBlocksToNode = lastDistributedPartialResultStep2Id + 1,
162 inputOfStep3FromInit = partialModelBlocksToNode,
164 lastStep3LocalCollectionInputId = inputOfStep3FromInit
172 enum Step3LocalNumericTableInputId
174 offset = lastStep3LocalCollectionInputId + 1,
176 lastStep3LocalNumericTableInputId = offset
184 enum DistributedPartialResultStep3Id
186 outputOfStep3ForStep4,
188 lastDistributedPartialResultStep3Id = outputOfStep3ForStep4
196 enum Step4LocalPartialModelsInputId
201 lastStep4LocalPartialModelsInputId = partialModels
209 enum Step4LocalNumericTableInputId
211 partialData = lastStep4LocalPartialModelsInputId + 1,
212 inputOfStep4FromStep2,
214 lastStep4LocalNumericTableInputId = inputOfStep4FromStep2
222 enum DistributedPartialResultStep4Id
224 outputOfStep4ForStep1,
226 outputOfStep4ForStep3 = outputOfStep4ForStep1,
228 outputOfStep4 = outputOfStep4ForStep3,
230 lastDistributedPartialResultStep4Id = outputOfStep4
252 class DAAL_EXPORT Input :
public daal::algorithms::Input
256 Input(
const Input& other) : daal::algorithms::Input(other){}
265 data_management::NumericTablePtr
get(NumericTableInputId id)
const;
272 ModelPtr
get(ModelInputId id)
const;
279 void set(NumericTableInputId id,
const data_management::NumericTablePtr &ptr);
286 void set(ModelInputId id,
const ModelPtr &ptr);
292 size_t getNumberOfUsers()
const;
298 size_t getNumberOfItems()
const;
305 services::Status check(
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
312 template<ComputeStep step>
313 class DistributedInput
322 class DAAL_EXPORT DistributedInput<step1Local> :
public daal::algorithms::Input
329 DistributedInput(
const DistributedInput& other) : daal::algorithms::Input(other){}
331 virtual ~DistributedInput() {}
338 PartialModelPtr
get(PartialModelInputId id)
const;
345 void set(PartialModelInputId id,
const PartialModelPtr &ptr);
353 services::Status check(
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
361 class DAAL_EXPORT DistributedPartialResultStep1 :
public daal::algorithms::PartialResult
364 DECLARE_SERIALIZABLE_CAST(DistributedPartialResultStep1);
366 DistributedPartialResultStep1();
368 virtual ~DistributedPartialResultStep1() {}
375 data_management::NumericTablePtr
get(DistributedPartialResultStep1Id id)
const;
382 void set(DistributedPartialResultStep1Id id,
const data_management::NumericTablePtr &ptr);
390 template <
typename algorithmFPType>
391 DAAL_EXPORT services::Status allocate(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
const int method);
399 services::Status check(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
400 int method)
const DAAL_C11_OVERRIDE;
404 template<
typename Archive,
bool onDeserialize>
405 services::Status serialImpl(Archive *arch)
407 return daal::algorithms::PartialResult::serialImpl<Archive, onDeserialize>(arch);
410 typedef services::SharedPtr<DistributedPartialResultStep1> DistributedPartialResultStep1Ptr;
418 class DAAL_EXPORT DistributedInput<step2Master> :
public daal::algorithms::Input
425 DistributedInput(
const DistributedInput& other) : daal::algorithms::Input(other){}
427 virtual ~DistributedInput() {}
434 data_management::DataCollectionPtr
get(MasterInputId id)
const;
441 void set(MasterInputId id,
const data_management::DataCollectionPtr &ptr);
449 void add(MasterInputId
id,
const DistributedPartialResultStep1Ptr &partialResult);
457 services::Status check(
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
465 class DAAL_EXPORT DistributedPartialResultStep2 :
public daal::algorithms::PartialResult
468 DECLARE_SERIALIZABLE_CAST(DistributedPartialResultStep2);
470 DistributedPartialResultStep2();
472 virtual ~DistributedPartialResultStep2() {}
479 data_management::NumericTablePtr
get(DistributedPartialResultStep2Id id)
const;
486 void set(DistributedPartialResultStep2Id id,
const data_management::NumericTablePtr &ptr);
494 template <
typename algorithmFPType>
495 DAAL_EXPORT services::Status allocate(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
const int method);
503 services::Status check(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
504 int method)
const DAAL_C11_OVERRIDE;
508 template<
typename Archive,
bool onDeserialize>
509 services::Status serialImpl(Archive *arch)
511 return daal::algorithms::PartialResult::serialImpl<Archive, onDeserialize>(arch);
514 typedef services::SharedPtr<DistributedPartialResultStep2> DistributedPartialResultStep2Ptr;
522 class DAAL_EXPORT DistributedInput<step3Local> :
public daal::algorithms::Input
529 DistributedInput(
const DistributedInput& other) : daal::algorithms::Input(other){}
531 virtual ~DistributedInput() {}
538 PartialModelPtr
get(PartialModelInputId id)
const;
545 data_management::KeyValueDataCollectionPtr
get(Step3LocalCollectionInputId id)
const;
552 data_management::NumericTablePtr
get(Step3LocalNumericTableInputId id)
const;
559 void set(PartialModelInputId id,
const PartialModelPtr &ptr);
566 void set(Step3LocalCollectionInputId id,
const data_management::KeyValueDataCollectionPtr &ptr);
573 void set(Step3LocalNumericTableInputId id,
const data_management::NumericTablePtr &ptr);
579 size_t getNumberOfBlocks()
const;
585 size_t getOffset()
const;
592 data_management::NumericTablePtr getOutBlockIndices(
size_t key)
const;
600 services::Status check(
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
608 class DAAL_EXPORT DistributedPartialResultStep3 :
public daal::algorithms::PartialResult
611 DECLARE_SERIALIZABLE_CAST(DistributedPartialResultStep3);
613 DistributedPartialResultStep3();
615 virtual ~DistributedPartialResultStep3() {}
623 template <
typename algorithmFPType>
624 DAAL_EXPORT services::Status allocate(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
const int method);
632 data_management::KeyValueDataCollectionPtr
get(DistributedPartialResultStep3Id id)
const;
642 PartialModelPtr
get(DistributedPartialResultStep3Id id,
size_t key)
const;
649 void set(DistributedPartialResultStep3Id id,
const data_management::KeyValueDataCollectionPtr &ptr);
657 services::Status check(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
658 int method)
const DAAL_C11_OVERRIDE;
662 template<
typename Archive,
bool onDeserialize>
663 services::Status serialImpl(Archive *arch)
665 return daal::algorithms::PartialResult::serialImpl<Archive, onDeserialize>(arch);
668 typedef services::SharedPtr<DistributedPartialResultStep3> DistributedPartialResultStep3Ptr;
676 class DAAL_EXPORT DistributedInput<step4Local> :
public daal::algorithms::Input
683 DistributedInput(
const DistributedInput& other) : daal::algorithms::Input(other){}
685 virtual ~DistributedInput() {}
695 data_management::KeyValueDataCollectionPtr
get(Step4LocalPartialModelsInputId id)
const;
702 data_management::NumericTablePtr
get(Step4LocalNumericTableInputId id)
const;
709 void set(Step4LocalPartialModelsInputId id,
const data_management::KeyValueDataCollectionPtr &ptr);
716 void set(Step4LocalNumericTableInputId id,
const data_management::NumericTablePtr &ptr);
722 size_t getNumberOfRows()
const;
730 services::Status check(
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
739 class DAAL_EXPORT DistributedPartialResultStep4 :
public daal::algorithms::PartialResult
742 DECLARE_SERIALIZABLE_CAST(DistributedPartialResultStep4);
744 DistributedPartialResultStep4();
746 virtual ~DistributedPartialResultStep4() {}
754 template <
typename algorithmFPType>
755 DAAL_EXPORT services::Status allocate(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
const int method);
762 PartialModelPtr
get(DistributedPartialResultStep4Id id)
const;
769 void set(DistributedPartialResultStep4Id id,
const PartialModelPtr &ptr);
777 services::Status check(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
778 int method)
const DAAL_C11_OVERRIDE;
782 template<
typename Archive,
bool onDeserialize>
783 services::Status serialImpl(Archive *arch)
785 return daal::algorithms::PartialResult::serialImpl<Archive, onDeserialize>(arch);
788 typedef services::SharedPtr<DistributedPartialResultStep4> DistributedPartialResultStep4Ptr;
795 class DAAL_EXPORT Result :
public daal::algorithms::Result
798 DECLARE_SERIALIZABLE_CAST(Result);
808 template <
typename algorithmFPType>
809 DAAL_EXPORT services::Status allocate(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
const int method);
816 daal::algorithms::implicit_als::ModelPtr
get(ResultId id)
const;
823 void set(ResultId id,
const daal::algorithms::implicit_als::ModelPtr &ptr);
831 services::Status check(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
832 int method)
const DAAL_C11_OVERRIDE;
836 template<
typename Archive,
bool onDeserialize>
837 services::Status serialImpl(Archive *arch)
839 return daal::algorithms::Result::serialImpl<Archive, onDeserialize>(arch);
842 typedef services::SharedPtr<Result> ResultPtr;
844 using interface1::Input;
845 using interface1::DistributedInput;
846 using interface1::DistributedPartialResultStep1;
847 using interface1::DistributedPartialResultStep1Ptr;
848 using interface1::DistributedPartialResultStep2;
849 using interface1::DistributedPartialResultStep2Ptr;
850 using interface1::DistributedPartialResultStep3;
851 using interface1::DistributedPartialResultStep3Ptr;
852 using interface1::DistributedPartialResultStep4;
853 using interface1::DistributedPartialResultStep4Ptr;
854 using interface1::Result;
855 using interface1::ResultPtr;
daal::algorithms::implicit_als::training::defaultDense
Definition: implicit_als_training_types.h:81
daal::algorithms::implicit_als::training::inputModel
Definition: implicit_als_training_types.h:101
daal::services::interface1::Status
Class that holds the results of API calls. In case of API routine failure it contains the list of err...
Definition: error_handling.h:491
daal
Definition: algorithm_base_common.h:57
daal::algorithms::implicit_als::training::partialModels
Definition: implicit_als_training_types.h:198
daal::algorithms::interface1::Result
Base class to represent final results of the computation. Algorithm-specific final results are repres...
Definition: algorithm_types.h:331
daal::algorithms::implicit_als::training::outputOfStep2ForStep4
Definition: implicit_als_training_types.h:147
daal::algorithms::implicit_als::training::DistributedPartialResultStep3Id
DistributedPartialResultStep3Id
Definition: implicit_als_training_types.h:184
daal::algorithms::implicit_als::training::NumericTableInputId
NumericTableInputId
Definition: implicit_als_training_types.h:89
daal::algorithms::implicit_als::training::interface1::DistributedPartialResultStep4
Provides methods to access partial results obtained with the compute() method of the implicit ALS alg...
Definition: implicit_als_training_types.h:739
daal::algorithms::implicit_als::training::outputOfStep4ForStep3
Definition: implicit_als_training_types.h:226
daal::algorithms::implicit_als::training::partialModelBlocksToNode
Definition: implicit_als_training_types.h:159
daal::algorithms::implicit_als::training::PartialModelInputId
PartialModelInputId
Definition: implicit_als_training_types.h:109
daal::algorithms::implicit_als::training::DistributedPartialResultStep4Id
DistributedPartialResultStep4Id
Definition: implicit_als_training_types.h:222
daal::algorithms::interface1::PartialResult
Base class to represent partial results of the computation. Algorithm-specific partial results are re...
Definition: algorithm_types.h:253
daal::algorithms::implicit_als::training::DistributedPartialResultStep1Id
DistributedPartialResultStep1Id
Definition: implicit_als_training_types.h:133
daal::algorithms::implicit_als::training::MasterInputId
MasterInputId
Definition: implicit_als_training_types.h:121
daal::algorithms::implicit_als::training::partialData
Definition: implicit_als_training_types.h:211
daal::algorithms::implicit_als::training::interface1::DistributedPartialResultStep1
Provides methods to access partial results obtained with the compute() method of the implicit ALS alg...
Definition: implicit_als_training_types.h:361
daal::algorithms::interface1::Parameter
Base class to represent computation parameters. Algorithm-specific parameters are represented as deri...
Definition: algorithm_types.h:86
daal::services::interface1::SharedPtr
Shared pointer that retains shared ownership of an object through a pointer. Several SharedPtr object...
Definition: daal_shared_ptr.h:187
daal::algorithms::implicit_als::training::ResultId
ResultId
Available identifiers of the results of the implicit ALS training algorithm.
Definition: implicit_als_training_types.h:237
daal::algorithms::implicit_als::training::outputOfStep3ForStep4
Definition: implicit_als_training_types.h:186
daal::algorithms::implicit_als::training::ModelInputId
ModelInputId
Definition: implicit_als_training_types.h:99
daal::algorithms::implicit_als::training::inputOfStep3FromInit
Definition: implicit_als_training_types.h:162
daal::algorithms::implicit_als::training::Step3LocalNumericTableInputId
Step3LocalNumericTableInputId
Definition: implicit_als_training_types.h:172
daal::algorithms::implicit_als::training::data
Definition: implicit_als_training_types.h:91
daal::algorithms::implicit_als::training::Step4LocalPartialModelsInputId
Step4LocalPartialModelsInputId
Definition: implicit_als_training_types.h:196
daal::algorithms::implicit_als::training::outputOfStep1ForStep2
Definition: implicit_als_training_types.h:135
daal::algorithms::implicit_als::training::inputOfStep4FromStep2
Definition: implicit_als_training_types.h:212
daal::algorithms::implicit_als::training::model
Definition: implicit_als_training_types.h:239
daal::step4Local
Definition: daal_defines.h:146
daal::algorithms::implicit_als::training::Method
Method
Definition: implicit_als_training_types.h:79
daal::algorithms::implicit_als::training::DistributedPartialResultStep2Id
DistributedPartialResultStep2Id
Definition: implicit_als_training_types.h:145
daal::algorithms::implicit_als::training::interface1::DistributedPartialResultStep3
Provides methods to access partial results obtained with the compute() method of the implicit ALS alg...
Definition: implicit_als_training_types.h:608
daal::algorithms::implicit_als::training::inputOfStep2FromStep1
Definition: implicit_als_training_types.h:123
daal::algorithms::implicit_als::training::Step3LocalCollectionInputId
Step3LocalCollectionInputId
Definition: implicit_als_training_types.h:157
daal::algorithms::implicit_als::training::outputOfStep4ForStep1
Definition: implicit_als_training_types.h:224
daal::algorithms::implicit_als::training::Step4LocalNumericTableInputId
Step4LocalNumericTableInputId
Definition: implicit_als_training_types.h:209
daal::step1Local
Definition: daal_defines.h:143
daal::step2Master
Definition: daal_defines.h:144
daal::algorithms::implicit_als::training::interface1::DistributedPartialResultStep2
Provides methods to access partial results obtained with the compute() method of the implicit ALS alg...
Definition: implicit_als_training_types.h:465
daal::algorithms::implicit_als::training::partialModel
Definition: implicit_als_training_types.h:111
daal::algorithms::implicit_als::training::offset
Definition: implicit_als_training_types.h:174
daal::algorithms::implicit_als::training::fastCSR
Definition: implicit_als_training_types.h:82
daal::step3Local
Definition: daal_defines.h:145
daal::algorithms::implicit_als::training::interface1::Result
Provides methods to access the results obtained with the compute() method of the implicit ALS trainin...
Definition: implicit_als_training_types.h:795
daal::algorithms::implicit_als::training::outputOfStep4
Definition: implicit_als_training_types.h:228