- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In the svm_two_class_batch.cpp example, it has:
SharedPtr<svm::training::Result> trainingResult; ... /* Retrieve algorithm results */ trainingResult = algorithm.getResult(); ...
However, it turns out that the object at the end of the pointer is not an instance of svm::training::Result (!).
In svm_train.h, the Batch template has:
void allocateResult() { SharedPtr<Result> res = staticPointerCast<Result, two_class_classifier::training::Result>(_result); res->template allocate<algorithmFPType>(&input, _par, (int) method); _res = _result.get(); }
As can be seen, it allocates the superclass of svm::training::Result, two_class_classifier::training::Result.
It was confusing when I was trying to hold the trainingResult in a SharedPtr< ::daal::algorithm::Result> and could not dynamicPointerCast< svm::training::Result>(p).
Would be nice to have the option for SharedPtr to do runtime checking to ensure that it is, indeed, pointing to an instance of what it says it's pointing to.
Regards,
ACS
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Alvin,
Thank you for the feedback.
The issues you describe below have already been fixed and would be available in the upcoming releases of Intel® DAAL. The modifications implemented in the library are as follows:
- getResult() method of the classification algorithms now returns the shared pointer to the respective Result class, in your case, it is SharedPtr<svm::training::Result>
- Behavior of operator=() method in Intel® DAAL shared pointer is aligned with shared pointer in C++ standard library. In the Beta release of the library, this operator allowed implicit upcasts, thus, the code of the example worked fine.
Please, let us know, if you have other questions on the methods of classifiers, shared pointers, or other features of the Intel® DAAL
Best regards,
Victoriya
![](/skins/images/45C6C2D737ED71F4C51F0145C8CB1E9C/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page