Intel DAAL AI加速——支持从数据预处理到模型预测,数据源必须使用DAAL的底层封装库

数据源加速见官方文档(必须使用DAAL自己的库):

Data Management

可以看到支持的数据源:同数据类型的table(matrix),不同类型的table,以及从DB文件取数据、数据序列化、压缩等。

在这些定制的数据源上,Intel DAAL使用自己底层的CPU进行硬件加速!下面摘自其官方:

Intel DAAL addresses all stages of the data analytics pipeline: preprocessing, transformation, analysis, modeling, validation, and decision-making.

Intel DAAL is developed by the same team as the Intel? Math Kernel Library (Intel? MKL)—the leading math library in the world. This team works closely with Intel? processor architects to squeeze performance from Intel processor-based systems.

Specs at a Glance

Processors Intel Atom?, Intel Core?, Intel? Xeon?, and Intel? Xeon Phi? processors and compatible processors
Languages Python*, C++, Java*
Development Tools and Environments
Microsoft Visual Studio* (Windows*)

Eclipse* and CDT* (Linux*)

Operating Systems Use the same API for application development on multiple operating systems: Windows, Linux, and macOS*

统计特征的计算加速例子:

# file: low_order_moms_dense_batch.py
#===============================================================================
# Copyright 2014-2018 Intel Corporation.
#
# This software and the related documents are Intel copyrighted  materials,  and
# your use of  them is  governed by the  express license  under which  they were
# provided to you (License).  Unless the License provides otherwise, you may not
# use, modify, copy, publish, distribute,  disclose or transmit this software or
# the related documents without Intel‘s prior written permission.
#
# This software and the related documents  are provided as  is,  with no express
# or implied  warranties,  other  than those  that are  expressly stated  in the
# License.
#===============================================================================

## <a name="DAAL-EXAMPLE-PY-LOW_ORDER_MOMENTS_DENSE_BATCH"></a>
## \example low_order_moms_dense_batch.py

import os
import sys

from daal.algorithms import low_order_moments
from daal.data_management import FileDataSource, DataSourceIface

utils_folder = os.path.realpath(os.path.abspath(os.path.dirname(os.path.dirname(__file__))))
if utils_folder not in sys.path:
    sys.path.insert(0, utils_folder)
from utils import printNumericTable

DAAL_PREFIX = os.path.join(‘..‘, ‘data‘)

# Input data set parameters
dataFileName = os.path.join(DAAL_PREFIX, ‘batch‘, ‘covcormoments_dense.csv‘)

def printResults(res):
    printNumericTable(res.get(low_order_moments.minimum),              "Minimum:")
    printNumericTable(res.get(low_order_moments.maximum),              "Maximum:")
    printNumericTable(res.get(low_order_moments.sum),                  "Sum:")
    printNumericTable(res.get(low_order_moments.sumSquares),           "Sum of squares:")
    printNumericTable(res.get(low_order_moments.sumSquaresCentered),   "Sum of squared difference from the means:")
    printNumericTable(res.get(low_order_moments.mean),                 "Mean:")
    printNumericTable(res.get(low_order_moments.secondOrderRawMoment), "Second order raw moment:")
    printNumericTable(res.get(low_order_moments.variance),             "Variance:")
    printNumericTable(res.get(low_order_moments.standardDeviation),    "Standard deviation:")
    printNumericTable(res.get(low_order_moments.variation),            "Variation:")

if __name__ == "__main__":

    # Initialize FileDataSource to retrieve input data from .csv file
    dataSource = FileDataSource(
        dataFileName,
        DataSourceIface.doAllocateNumericTable,
        DataSourceIface.doDictionaryFromContext
    )

    # Retrieve the data from input file
    dataSource.loadDataBlock()

    # Create algorithm for computing low order moments in batch processing mode
    algorithm = low_order_moments.Batch()

    # Set input arguments of the algorithm
    algorithm.input.set(low_order_moments.data, dataSource.getNumericTable())

    # Get computed low order moments
    res = algorithm.compute()

    printResults(res)  

原文地址:https://www.cnblogs.com/bonelee/p/9702982.html

时间: 2024-08-06 19:15:05

Intel DAAL AI加速——支持从数据预处理到模型预测,数据源必须使用DAAL的底层封装库的相关文章

借助 SIMD 数据布局模板和数据预处理提高 SIMD 在动画中的使用效率

原文链接 简介 为发挥 SIMD1 的最大作用,除了对其进行矢量化处理2外,我们还需作出其他努力.可以尝试为循环添加 #pragma omp simd3,查看编译器是否成功进行矢量化,如果性能有所提升,则达到满意状态. 然而,可能性能根本不会提升,甚至还会降低. 无论处于何种情况,为了最大限度发挥 SIMD 执行的优势并实现性能提升,通常需要重新设计算法和数据布局,以便生成的 SIMD 代码尽可能高效. 另外还可收到额外的效果,即标量(非矢量化)版代码会表现得更好. 本文将通过一个 3D 动画算

《数据挖掘概念与技术》--第三章 数据预处理

一.数据预处理 1.数据如果能够满足其应用的要求,那么他是高质量的. 数据质量涉及许多因素:准确性.完整性.一致性.时效性.可信性.可解释性. 2.数据预处理的主要任务:数据清洗.数据集成.数据规约.数据变换. 二.数据清理:试图填充缺失值,光滑噪声.识别利群点.纠正数据中的不一致. 1.缺失值的处理: 1)忽略元组:缺少类标号时通常这么做.但是忽略的元组其他属性也不能用,即便是有用的. 2)人工填写:该方法很费事费时,数据集很大.缺失值很多时可能行不通. 3)使用一个全局常量填充缺失值:将缺失

python data analysis | python数据预处理(基于scikit-learn模块)

原文:http://www.jianshu.com/p/94516a58314d Dataset transformations| 数据转换 Combining estimators|组合学习器 Feature extration|特征提取 Preprocessing data|数据预处理 1 Dataset transformations scikit-learn provides a library of transformers, which may clean (see Preproce

数据预处理(数据的操作2)

2.常用数据预处理方法 这个部分总结的是在Python中常见的数据预处理方法. 2.1标准化(Standardization or Mean Removal and Variance Scaling) 变换后各维特征有0均值,单位方差.也叫z-score规范化(零均值规范化).计算方式是将特征值减去均值,除以标准差. sklearn.preprocessing.scale(X) 一般会把train和test集放在一起做标准化,或者在train集上做标准化后,用同样的标准化去标准化test集,此时

数据预处理与特征选择

数据预处理和特征选择是数据挖掘与机器学习中关注的重要问题,坊间常说:数据和特征决定了机器学习的上限,而模型和算法只是逼近这个上限而已.特征工程就是将原始数据转化为有用的特征,更好的表示预测模型处理的实际问题,提升对于未知数据的预测准确性.下图给出了特征工程包含的内容: 本文数据预处理与特征选择的代码均采用sklearn所提供的方法,并使用sklearn中的IRIS(鸢尾花)数据集来对特征处理功能进行说明,IRIS数据集由Fisher在1936年整理,包含4个特征:Sepal.Length(花萼长

python数据分析入门——数据导入数据预处理基本操作

数据导入到python环境:http://pandas.pydata.org/pandas-docs/stable/io.html(英文版) IO Tools (Text, CSV, HDF5, ...)? The pandas I/O API is a set of top level reader functions accessed like pd.read_csv() that generally return a pandasobject. read_csv read_excel re

文本内容分析和智能反馈(2)- 数据预处理和按纬度统计

书接上文,考虑4个核心功能的实现,先考虑:数据预处理和按纬度统计. 1.数据预处理 1.1.基本原则 首先,考虑数据的格式. 业务数据是保存在关系型数据库中的.数据分析的部分,我们将使用Weka,虽然Weka习惯ARFF格式,为了实现数据分析和提取的自动化,我们将通过Weka的JDBC接口为其提供数据.这样,可以使用ETL工具或者通过程序代码执行SQL实现数据提取和格式转换. 在开发阶段,我们基本上可以将数据提取和转换逻辑固定下来,没有必要采用专门的ETL工具. 其次,考虑数据转换的要求. 我们

【深度学习系列】PaddlePaddle之数据预处理

上篇文章讲了卷积神经网络的基本知识,本来这篇文章准备继续深入讲CNN的相关知识和手写CNN,但是有很多同学跟我发邮件或私信问我关于PaddlePaddle如何读取数据.做数据预处理相关的内容.网上看的很多教程都是几个常见的例子,数据集不需要自己准备,所以不需要关心,但是实际做项目的时候做数据预处理感觉一头雾水,所以我就写一篇文章汇总一下,讲讲如何用PaddlePaddle做数据预处理. PaddlePaddle的基本数据格式 根据官网的资料,总结出PaddlePaddle支持多种不同的数据格式,

机器学习之数据预处理,Pandas读取excel数据

Python读写excel的工具库很多,比如最耳熟能详的xlrd.xlwt,xlutils,openpyxl等.其中xlrd和xlwt库通常配合使用,一个用于读,一个用于写excel.xlutils结合xlrd可以达到修改excel文件目的.openpyxl可以对excel文件同时进行读写操作. 而说到数据预处理,pandas就体现除了它的强大之处,并且它还支持可读写多种文档格式,其中就包括对excel的读写.本文重点就是介绍pandas对excel数据集的预处理. 机器学习常用的模型对数据输入