Git Product home page Git Product logo

oneapi-src / onedal Goto Github PK

View Code? Open in Web Editor NEW
593.0 47.0 209.0 85.18 MB

oneAPI Data Analytics Library (oneDAL)

Home Page: https://software.intel.com/en-us/oneapi/onedal

License: Apache License 2.0

C 4.53% C++ 76.26% Shell 0.30% Batchfile 0.06% Makefile 0.59% Python 0.09% SWIG 16.65% Starlark 1.41% CMake 0.08% Smarty 0.01% Dockerfile 0.01%
onedal data-analysis oneapi machine-learning machine-learning-algorithms hacktoberfest swrepo ai-machine-learning big-data analytics

onedal's Introduction

oneAPI Data Analytics Library

Installation   |   Documentation   |   Support   |   Examples   |   How to Contribute   

Build Status License Join the community on GitHub Discussions

oneAPI Data Analytics Library (oneDAL) is a powerful machine learning library that helps you accelerate big data analysis at all stages: preprocessing, transformation, analysis, modeling, validation, and decision making.

The library implements classical machine learning algorithms. The boost in their performance is achieved by leveraging the capabilities of Intel® hardware.

oneDAL is part of oneAPI. The current branch implements version 1.1 of oneAPI Specification.

Usage

There are different ways for you to build high-performance data science applications that use the advantages of oneDAL:

  • Use oneDAL C++ interfaces with or without SYCL support (learn more)
  • Use Intel(R) Extension for Scikit-learn* to accelerate existing scikit-learn code without changing it
  • Use daal4py, a standalone package with Python API for oneDAL Deprecation Notice: The Java interfaces are removed from the oneDAL library.

Installation

Check System Requirements before installing oneDAL.

You can download the specific version of oneDAL or install it from sources.

Examples

C++ Examples:

Python Examples:

Other Examples

Documentation

oneDAL documentation:

Other related documentation:

Apache Spark MLlib

oneDAL library is used for Spark MLlib acceleration as part of OAP MLlib project and allows you to get a 3-18x increase in performance compared to the default Apache Spark MLlib.

Technical details: FPType: double; HW: 7 x m5.2xlarge AWS instances; SW: Intel DAAL 2020 Gold, Apache Spark 2.4.4, emr-5.27.0; Spark config num executors 12, executor cores 8, executor memory 19GB, task cpus 8

Scaling

oneDAL supports distributed computation mode that shows excellent results for strong and weak scaling:

oneDAL K-Means fit, strong scaling result oneDAL K-Means fit, weak scaling results

Technical details: FPType: float32; HW: Intel Xeon Processor E5-2698 v3 @2.3GHz, 2 sockets, 16 cores per socket; SW: Intel® DAAL (2019.3), MPI4Py (3.0.0), Intel® Distribution Of Python (IDP) 3.6.8; Details available in the article https://arxiv.org/abs/1909.11822

Support

Ask questions and engage in discussions with oneDAL developers, contributers, and other users through the following channels:

You may reach out to project maintainers privately at [email protected].

Security

To report a vulnerability, refer to Intel vulnerability reporting policy.

Contribute

We welcome community contributions. Check our contributing guidelines to learn more.

License

oneDAL is distributed under the Apache License 2.0 license. See LICENSE for more information.

oneMKL FPK microlibs are distributed under Intel Simplified Software License. Refer to third-party-programs-mkl.txt for details.

onedal's People

Contributors

agilev76 avatar agorshk avatar alexandr-solovev avatar alexsandruss avatar amgrigoriev avatar avolkov-intel avatar bysheva avatar ethanglaser avatar homksei avatar icfaust avatar inteldimitrius avatar kalyanovd avatar makart19 avatar maria-petrova avatar masdevas avatar mchernov-intel avatar michael-smirnov avatar napetrov avatar onlydeniko avatar orrrrtem avatar outoftardis avatar owerbat avatar pahandrovich avatar petrovkp avatar plastova avatar renovate[bot] avatar rlnx avatar shvetsks avatar smirnovegorru avatar vika-f avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

onedal's Issues

implicit_als_csr_distributed_mpi.cpp crashed on dumping predictedRatingsMaster

Hi,

I tried to print out predicted ratings at end of implicit_als_csr_distributed_mpi.cpp. The program crashed with segmentation fault and printed out the following output. Any idea?

Compute OK
prediction 0, 0
Compute OK
Compute OK
Compute OK

===================================================================================
= BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES
= PID 23853 RUNNING AT ip-172-31-22-251
= EXIT CODE: 139
= CLEANING UP REMAINING PROCESSES
= YOU CAN IGNORE THE BELOW CLEANUP MESSAGES

YOUR APPLICATION TERMINATED WITH THE EXIT STRING: Segmentation fault (signal 11)
This typically refers to a problem with your application.

Can't extract NumericTable after serializing and deserializing

Summary:

If I serialize and deserialize DistributePartialResult received at here
Then I can't get Numeric Table from DistributePartialResult.

Steps to reproduce:

Go to line no. 158 here
and Insert this code after line 158 -

byte[] resultbyte = serializeDistributedPartialResult(result);
            try{
                DistributedPartialResult deserult = deserializeDistributedPartialResult(resultbyte);
                System.out.println("testdeser end");
                TrainingResult tr = deserult.get(DistributedPartialResultId.resultFromMaster);
                System.out.println("test tr got");
                TrainingModel tm = tr.get(TrainingResultId.model);
                System.out.println("test tm got");
                NumericTable yont = tm.getWeightsAndBiases();
                System.out.println("test yont got");
              } catch (Exception e) 
              {
                System.out.println("Fail to serilization trainingModel" + e.toString());
                e.printStackTrace();
              } 

Define two function serializeDistributedPartialResult and deserializeDistributedPartialResult as following -

private static byte[] serializeDistributedPartialResult(DistributedPartialResult dataTable) throws IOException {
        /* Create an output stream to serialize the DistributedPartialResult */
        ByteArrayOutputStream outputByteStream = new ByteArrayOutputStream();
        ObjectOutputStream outputStream = new ObjectOutputStream(outputByteStream);

        /* Serialize the DistributedPartialResult into the output stream */
        dataTable.pack();
        outputStream.writeObject(dataTable);

        /* Store the serialized data in an array */
        byte[] buffer = outputByteStream.toByteArray();
        return buffer;
    }

    private static DistributedPartialResult deserializeDistributedPartialResult(byte[] buffer) throws IOException, ClassNotFoundException {
        /* Create an input stream to deserialize the DistributedPartialResult from the array */
        ByteArrayInputStream inputByteStream = new ByteArrayInputStream(buffer);
        ObjectInputStream inputStream = new ObjectInputStream(inputByteStream);

        /* Create a DistributedPartialResult object */
        DistributedPartialResult restoredDataTable = (DistributedPartialResult) inputStream.readObject();
        restoredDataTable.unpack(context);

        return restoredDataTable;
    }

These functions are written from [here].(https://github.com/01org/daal/blob/daal_2018_beta_update1/examples/java/com/intel/daal/examples/serialization/SerializationExample.java)

Expected behavior:

All the newly added print statements should work.

Observed behavior:
NumericTable yont = tm.getWeightsAndBiases();
This line is giving error -

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fc4de4fc32d, pid=106185, tid=0x00007fc8c8e8d700
#
# JRE version: Java(TM) SE Runtime Environment (8.0_131-b11) (build 1.8.0_131-b11)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.131-b11 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C  [libJavaAPI.so+0x1dc132d]  Java_com_intel_daal_algorithms_neural_1networks_training_TrainingModel_cGetWeightsAndBiases+0x5d
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /N/u/mayank/daal/__release_lnx/daal/examples/java/hs_err_pid106185.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

questions about impl_als_csr_distr.cpp

Hi, i have a few questions about the code in impl_als_csr_distr.cpp.

Q1. The code shows nUsers = 46, and row counts in the 4 data files are 11, 11, 22, and 22. Is the data of 46 users distributed that way and not overlapped in any of the files?

Q2. When i use Spark ML ALS, it requires data split to 2 sets, one for training and another for verification. Using DAAL ALS, i see no such requirement. How can i verify the model?

Thanks,
Peter

libdaal_core Archive File Not Downloaded Properly

The File: daal/externals/mklfpk/lnx/lib/intel64/libdaal_vmlipp_core.a is supposed to be an Archive of a size of about 19.5 MB when seen on GitHub, But when the command: git clone --recursive https://github.com/01org/daal.git, Specified on the DAAL Page is run, The File that is retrieved is a Text file of size 133 Bytes with the Following contents:

version https://git-lfs.github.com/spec/v1
oid sha256:e8f293258e38e9689cb87ffbb91c3de2c339a6c074c77115ca86d50b5a48bc64
size 20413048

How to access the right Archive File?

Missing Logistic Regression in 2019 Beta

In the 'DAAL Developer Guide 2019 Beta', logistic regression is documented and the example code ./examples/cpp/source/logistic_regression/log_reg_dense_batch.cpp is referenced. But I cannot find this anywhere in either daal_2019_beta or daal_2019_beta_experimental branches.

install DAAL 2018

i tried to install DAAL 2018 but after downloading and untar-ing the zipball l_daal_2018.0.128.tgz, i found install.sh is an empty file.

What do i do now to fix it?

Memory leak in service_topo.cpp on Windows x64 with core count more 32

  1. On Windows x64 system in service_topo.h type LNX_PTR2INT is defined as follows:
    #ifdef _x86_64
    #define LNX_PTR2INT __int64
    #define LNX_MY1CON 1LL
    #else
    #define LNX_PTR2INT unsigned int
    #define LNX_MY1CON 1
    #endif
    Under Windows x64 macro _M_X64 should be used.
    Because LNX_PTR2INT is defined as unsigned int which on Windows is 32 bit
    then function static int __internal_daal_countBits(DWORD_PTR x) return maximum of 32,
    then functiion static void __internal_daal_setChkProcessAffinityConsistency( unsigned int lcl_OSProcessorCount )
    in statement on line 328
    if( sum != lcl_OSProcessorCount ) // check cumulative bit counts matches processor count
    determines inconsistensy;
    then in function static int __internal_daal_queryParseSubIDs(void) in statement on line 1346
    if( glbl_obj.error )
    return -1;
    error is detected which is returned to function static void __internal_daal_buildSystemTopologyTables()
    which leads to exit without initialization
  2. In function static void __internal_daal_buildSystemTopologyTables()
    tables are allocated on line 1683 and should be deallocated in case of an error
    before returns on lines: 1687, 1689, 1694
    function __internal_daal_buildSystemTopologyTables is called from
    __internal_daal_buildSystemTopologyTables which is called from
    __internal_daal_initCpuTopology which is called from
    __internal_daal_GetSysProcessorCoreCount which is called from
    GetL1CacheSize which is called in evere call to compute

External Dependencies of DAAL

I noticed DAAL library is depended on external libraries like "libdaal_mkl_sequential.a libdaal_mkl_thread.a libdaal_vmlipp_core.a", what are these libraries? Can I use DAAL without these external dependencies.
I was looking at Cholesky Factorization for batch processing, I want to use DAAL framework but use different optimization kernel of Cholesky, will this be possible.

confusing install

The installation of dall and pydall and dall-extension is ridiculously confusing.
I've installed the version on this git, but it doesn't have a install.sh. Maybe it was pre-built, so I just setted the vars with the scripts. Didn't work.
Had to get the community version, but surprise, it's written it doesn't support python (wtf)
Finally, got a student XE studio version bloated with useless stuff (fortran compiler wtf)
Install pydaal and daal-extension, yay, finally over. Error, cpp code doesn't match (wtf)
Still, doesn't work, had to manually export DAALROOT var , doesn't work (wtf)
Build the pydaal source from the XE code (why bother making a conda wtf)

Now it almost, but it shoots:

/opt/intel/compilers_and_libraries_2018.2.199/linux/daal/examples/python$ python source/neural_networks/stoch_pool2d_layer_dense_batch.py
Forward two-dimensional stochastic pooling layer input (first 10 rows):
5.308 9.869 1.019 4.292 6.081 6.586 2.411 4.767 3.256 6.030
7.279 0.391 9.619 3.435 4.769 4.873 0.119 5.117 0.419 0.475
6.616 6.192 0.402 9.744 9.991 9.105 1.691 2.606 9.535 7.829
4.792 2.491 2.939 8.086 3.774 9.997 0.222 8.995 5.753 6.091
7.701 6.415 1.684 8.983 4.285 9.018 0.552 7.706 2.590 0.412
6.992 1.064 9.321 0.430 2.168 1.736 0.919 6.981 0.712 3.414
5.794 1.062 0.955 0.390 3.013 9.954 3.197 3.992 6.936 8.148
2.487 6.973 4.047 5.656 5.082 5.534 7.821 2.763 0.454 6.554
2.205 7.840 7.382 1.619 6.567 7.584 8.356 5.501 8.191 2.608
9.949 8.942 8.106 4.864 5.853 1.659 6.343 8.190 3.110 7.485

Traceback (most recent call last):
File "source/neural_networks/stoch_pool2d_layer_dense_batch.py", line 75, in
forwardLayer = stochastic_pooling2d.forward.Batch(nDim)
AttributeError: 'module' object has no attribute 'forward

simple operations on Tensor from java?

on a tensor, and what i have in mind is a homogenous float tensor, is there a way to, say, set or get a value at a given index from java? Or to call gemm? i haven't been able to find anything

Incorrect 'fullNUsers' parameter with implicit_als_csr_distributed_mpi.cpp

Hi, i'm experiencing an error with the sample code implicit_als_csr_distributed_mpi.cpp in which i changed the input CSR file sources as well as changed the constant 'nUsers' from 46 to 2145.

The error shown with all 4 MPI processes are the same, as follows:

daal::services::interface1::Exception'
what(): Incorrect parameter
Details:
Parameter name: fullNUsers

For debugging purpose, i inserted code to log the shapes of the two sparse matrixes, dataTable and transposedDataTable. The printed log is as follow for the 4 processes:

dataTable->getNumberOfRows=534
dataTable->getNumberOfColumns=8656
transposedDataTable->getNumberOfRows=2164
transposedDataTable->getNumberOfColumns=2145

dataTable->getNumberOfRows=537
dataTable->getNumberOfColumns=8656
transposedDataTable->getNumberOfRows=2164
transposedDataTable->getNumberOfColumns=2145

dataTable->getNumberOfRows=537
dataTable->getNumberOfColumns=8656
transposedDataTable->getNumberOfRows=2164
transposedDataTable->getNumberOfColumns=2144

dataTable->getNumberOfRows=537
dataTable->getNumberOfColumns=8656
transposedDataTable->getNumberOfRows=2164
transposedDataTable->getNumberOfColumns=2145

Though some of the row/column numbers above are not all equal to 537 or 2145, it should not be the problem, because i also log for original sample code and original CSR files, and found the numbers are neither the same.

I'm stuck, because i found nothing wrong with nUsers = 2145.

Any idea what's wrong will be appreciated!!

Library files in /lnx32e as opposed to the standard /intel64_lin

Resulting library files from building for lnx32e get put into daal-daal_2017_beta_update1/__work/lnx32e/daal/lib/. While building examples, icc looks for files in intel64_lin, the standard directory name for DAAL library files when bundled with Intel Parallel Studio. I fixed this mismatch on my build, but it maybe a good idea to standardize the location to intel64_lin across DAAL versions. Thank you.

neural_net_dense_asynch_distributed_mpi.cpp hangs or crashes

I have a training data set with ~6 millions of samples. I split the data set to CSV files, then modified the sample code neural_net_dense_asynch_distributed_mpi.cpp to use my CSV files.

[Hang case]: When i keep the "nIterations" constant to be 60, with my data set, the program hangs after it succeeds in training the model and predicting with test data. I need to press Ctrl-C to abort the program.

[Crash case]: When i increase nIterations to 600,000, with the same data set, the program crashes without even finishing model training. Below is console log:

`$ time mpirun -n 4 -ppn 1 /data/intel/daal/examples/cpp/mpi/_results/gnu_intel64_a/neural_net_dense_asynch_distributed_mpi
.exe

===================================================================================
= BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES
= PID 20589 RUNNING AT ip-172-31-22-251
= EXIT CODE: 139
= CLEANING UP REMAINING PROCESSES
= YOU CAN IGNORE THE BELOW CLEANUP MESSAGES

YOUR APPLICATION TERMINATED WITH THE EXIT STRING: Segmentation fault (signal 11)
This typically refers to a problem with your application.
Please see the FAQ page for debugging suggestions

real 1m49.376s
user 6m27.988s
sys 0m44.424s
`

Any idea what may be the root cause of crash and hang?

By the way, when nIterations = 60, it seems the workers together train only nIterations * batchSizeLocal, which is 60 * 25, samples. The workers do not train ALL samples.

Machine Learning Algorithm User Inputs

Hi,

I am trying to use PCA and MLR for my project. I want to learn how to add the number of iterations, number of principal components, step size and such parameters to the program initialization. Is there any way to do this ?

If it is could you please guide me how to set them in specific classes in DAAL Java source code. Thanks a lot for your time.

Neural Network giving NaN values

When I am increasing the number of hidden values or increasing number of neurons last layer keeping the same number of layers, I am getting NaN as probabilities in results.
I am trying to run daal/examples/java/com/intel/daal/examples/neural_networks/NeuralNetDenseDistr.java
I am changing daal/examples/java/com/intel/daal/examples/neural_networks/NeuralNetConfiguratorDistr.java

Error installing pydaal

I've tried to install pydaal from the anaconda channel, but run into issues. This is a completely fresh conda environment.

conda install -c intel pydaal=2017.0.1.20161006

The following NEW packages will be INSTALLED:

    icc_rt:      16.0.3-intel_5                 intel [intel]
    intelpython: 2017.0.0-5                     intel
    mkl:         2017.0.1-intel_2               intel [intel]
    numpy:       1.11.2-py35_intel_2            intel [intel]
    openssl:     1.0.2j-intel_4                 intel [intel]
    pip:         8.1.2-py35_intel_4             intel [intel]
    pydaal:      2017.0.1.20161006-py35_intel_6 intel [intel]
    python:      3.5.2-intel_19                 intel [intel]
    setuptools:  23.0.0-py35_intel_4            intel [intel]
    sqlite:      3.13.0-intel_13                intel [intel]
    tbb:         2017.0.2-py35_intel_0          intel [intel]
    tcl:         8.6.4-intel_15                 intel [intel]
    tk:          8.6.4-intel_15                 intel [intel]
    wheel:       0.29.0-py35_intel_4            intel [intel]
    xz:          5.2.2-intel_14                 intel [intel]
    zlib:        1.2.8-intel_9                  intel [intel]

/home/andy/anaconda3/lib/python3.5/site-packages/conda/core/link.py:470: UserWarning: Package intel::intelpython-2017.0.0-5 uses a pre-link script. Pre-link scripts are potentially dangerous.
This is because pre-link scripts have the ability to change the package contents in the
package cache, and therefore modify the underlying files for already-created conda
environments.  Future versions of conda may deprecate and ignore pre-link scripts.

  """ % dist))
ERROR conda.core.link:_execute_actions(330): An error occurred while installing package 'intel::intelpython-2017.0.0-5'.
LinkError: post-link script failed for package intel::intelpython-2017.0.0-5
running your command again with `-v` will provide additional information
location of failed script: /home/andy/anaconda3/envs/intel_daal/bin/.intelpython-post-link.sh
==> script messages <==
<None>


Attempting to roll back.



LinkError: post-link script failed for package intel::intelpython-2017.0.0-5
running your command again with `-v` will provide additional information
location of failed script: /home/andy/anaconda3/envs/intel_daal/bin/.intelpython-post-link.sh
==> script messages <==
<None>



FreeBSD port

I'm trying to port daal into FreeBSD. The library itself compiles fine, but when I try to compile a sample, I'm getting a lot of unresolved references defined in "libdaal_mkl_*.a" libraries. Is it possible to obtain a source code of these libraries to compile them natively and finalize porting? Thanks.

MultClass classifier

Hi,

The multiclass-classifier requires binary classifier like SVM, but fails when assigning any of the others like adaboost, logitboost etc... Is this as expected?

Additionally attemp to serialize KNN model returns no error at start, but clearly causes memory corruption.

Thanks!
Atma

Extract nodes from trained Decision Tree

Hi,

I'm trying to extract the nodes learned from a classification decision tree model in order to export them to some UI and visualize them, unfortunately it seems that there is no way to access them from the Model class.

Did I miss something?

If not, is there any plan to let the user access the DecisionTreeTablePtr, as it is already possible for other models such as the betas of a linear model or the centroids of a kmeans model?

Thanks

Python Examples

As per the documentation , Python examples should be present in examples directory. I couldn't find them. Would be helpful if you could update this in documentation.

make daal PLAT=lnx32e COMPILER=gnu failed

[Error]

========= Building core ========= ar rs __work_gnu/lnx32e/kernel/libdaal_core_link.a @__work_gnu/lnx32e/kernel/libdaal_core_link.txt && printf '\n%s\n' '__work_gnu/lnx32e/kernel/libdaal_core_link.a.mkdeps += makefile build/cmplr.gnu.mk build/common.mk build/deps.mk makefile.ver' '$(__work_gnu/lnx32e/kernel/libdaal_core_link.a.mkdeps):' '__work_gnu/lnx32e/kernel/libdaal_core_link.a: $(__work_gnu/lnx32e/kernel/libdaal_core_link.a.mkdeps)' '__work_gnu/lnx32e/kernel/libdaal_core_link.a.trigger = ar rs __work_gnu/lnx32e/kernel/libdaal_core_link.a @__work_gnu/lnx32e/kernel/libdaal_core_link.txt' >> __work_gnu/lnx32e/kernel/libdaal_core_link.a.d.tmp && mv -f __work_gnu/lnx32e/kernel/libdaal_core_link.a.d.tmp __work_gnu/lnx32e/kernel/libdaal_core_link.a.d ar: creating __work_gnu/lnx32e/kernel/libdaal_core_link.a printf "create __work_gnu/lnx32e/daal/lib/libdaal_core.a\naddlib externals/mklfpk/lnx/lib/intel64/libdaal_vmlipp_core.a\n addlib __work_gnu/lnx32e/kernel/libdaal_core_link.a\n\n\n\nsave\n" | ar -M && printf '\n%s\n' '__work_gnu/lnx32e/daal/lib/libdaal_core.a.mkdeps += makefile build/cmplr.gnu.mk build/common.mk build/deps.mk makefile.ver' '$(__work_gnu/lnx32e/daal/lib/libdaal_core.a.mkdeps):' '__work_gnu/lnx32e/daal/lib/libdaal_core.a: $(__work_gnu/lnx32e/daal/lib/libdaal_core.a.mkdeps)' '__work_gnu/lnx32e/daal/lib/libdaal_core.a.trigger = printf "create __work_gnu/lnx32e/daal/lib/libdaal_core.a\naddlib externals/mklfpk/lnx/lib/intel64/libdaal_vmlipp_core.a\n addlib __work_gnu/lnx32e/kernel/libdaal_core_link.a\n\n\n\nsave\n" | ar -M' >> __work_gnu/lnx32e/daal/lib/libdaal_core.a.d.tmp && mv -f __work_gnu/lnx32e/daal/lib/libdaal_core.a.d.tmp __work_gnu/lnx32e/daal/lib/libdaal_core.a.d ar: externals/mklfpk/lnx/lib/intel64/libdaal_vmlipp_core.a: File format not recognized makefile:368: recipe for target '__work_gnu/lnx32e/daal/lib/libdaal_core.a' failed make: *** [__work_gnu/lnx32e/daal/lib/libdaal_core.a] Error 1

[Env]:

cc (Ubuntu 6.4.0-17ubuntu1~16.04) 6.4.0 20180424
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

LSB Version: core-9.20160110ubuntu0.2-amd64:core-9.20160110ubuntu0.2-noarch:security-9.20160110ubuntu0.2-amd64:security-9.20160110ubuntu0.2-noarch
Distributor ID: Ubuntu
Description: Ubuntu 16.04.4 LTS
Release: 16.04
Codename: xenial

[command to make]

make daal PLAT=lnx32e COMPILER=gnu

In Neural Network Example, parameter has no member named batchSize

I got this error when trying to compile the neural network dense batch example posted in:

https://github.com/01org/daal/blob/92f4dde5a1e2d7f132111588f4513cc7c4578052/examples/cpp/source/neural_networks/neural_net_dense_batch.cpp

error: 'struct daal::algorithms::optimization_solver::sgd::interface1::Parameter<(daal::algorithms::optimization_solver::sgd::Method)0u>' has no member named 'batchSize'

The error comes from trying to assign a batchSize parameter to the sgdAlgorithm pointer:

SharedPtr<optimization_solver::sgd::Batch<> > sgdAlgorithm(new optimization_solver::sgd::Batch<>());

float learningRate = 0.001f;

sgdAlgorithm->parameter.learningRateSequence = NumericTablePtr(new HomogenNumericTable<>(1, 1, NumericTable::doAllocate, learningRate));

/* Set the batch size for the neural network training */
sgdAlgorithm->parameter.batchSize = batchSize;

R Api?

Are there any plans for the release of an R Api?

Thanks!

Problems in building

I am trying to build DAAL, but encounter the following error
lang_service/java/com/intel/daal/algorithms/parameter.cpp:18:17: fatal error: jni.h: No such file or directory

The problem is my include path, but how would I set this in the build? I have tried the -I option of make and it does not work. I also tried CXXFLAGS.

getWeightsAndBiasesDerivatives(0) returns several BIG NUMBERS

After 3 epochs and totally 18 millions of samples were trained, i used the following snippet to print out the derivatives:

training::ModelPtr wbModel = netMaster.getPartialResult()->get(training::resultFromMaster)
         ->get(training::model);
checkPtr((void *)wbModel.get());
NumericTablePtr wb = wbModel->getWeightsAndBiasesDerivatives(0);
printNumericTable(wb, "Derivatives:");

The output shows several big numbers such like 7073943840582500603473690624.000 and -56498746778538650560049971200.000. (More is shown below)

Is it possible that something wrong with the derivative calculation? I am using the sample code neural_net_dense_asynch_distributed_mpi.cpp with modification only on input data file paths.

0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
-3.179
0.000
3.344
-0.000
1.924
7073943840582500603473690624.000
2.433
-0.000
2.279
0.000
1.875
190232055819272192.000
-3.090
0.000
0.000
0.000
0.000
-31561456.000
0.000
0.000
0.000
0.000
0.000
-56498746778538650560049971200.000
-3.248
-159816042060473388310200320.000
3.378
0.000
1.875
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
-3.303
0.000
3.305
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
-31561456.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
-31561456.000
0.000
0.000
0.000
0.000
0.000
0.000
-3.208
-0.000
3.371
0.000
1.902
0.000
1.875
0.000
2.250
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
238616614755368960.000
1.961
77415804471150116864.000
1.863
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000

Where (or How) to get accuracy after each "epoch"?

I noticed that there is a "accuracyThreshold" field in source code of several optimization solvers' parameter set.

My question is: where or how to get or calculate the "accuracy" of a on-going learning model of a distributed neural net after each epoch or after a certain number of iterations from the learning model?

I need the accuracy information so that i can have the model stop learning once when it reaches a threshold of accuracy (but how to know this???) instead of waiting for a fix number of "epochs" which can take very long time.

Any pointer will be very appreciated!

Wrong RowMatrix dimension [Spark SampleSVD]

In the SampleSVD.scala file, the RowMatrix passed to the computeSVD() function is defined with explicit dimensions calculated from these two lines:

val nRows = data.count()
val nCols = data.first.length

When looking at data, we notice that this is still the raw input text file, ergo the values have neither been converted to double, nor split at the blanks (this happens only in dataRDD).

Therefore, the returned value of nCols is actually 168 (number of characters in the first line of the text file), instead of the desired 18 "value dimensions".
Surprisingly, Spark does not seem to care too much, since the computations are performed fine. From what I got out of the results, this seems to simply pad the vector with zeros.

Simply replacing the nCols calculation with
val nCols = dataRDD.first.size
will correctly register the number of columns.

DAAL update 2017 K-MEANS Crash

libJavaApi.so sometimes crash when trying to retrieve the clusters center using HomogenousNumericTable getBlockOfColumnValues Java API.

what does NaN or -NaN mean in the predictions of implicit_als_csr_distributed_mpi.cpp?

I got a lot of NaN and -NaN in the predictions of implicit_als_csr_distributed_mpi.cpp as below:

User ID, Item ID: Expected Rating, Predicted Rating
6695, 2036 : 1, -nan
6786, 4234 : 0.67, -nan
6819, 2988 : 0.5, -nan
6872, 4162 : 0.6, nan
6889, 1348 : 1, nan
6923, 3400 : 0.4, -nan
6942, 1350 : 0.67, -nan
7009, 1414 : 1, nan
7031, 3662 : 0.89, nan
7032, 2850 : 1, nan
7045, 4638 : 1, nan
7073, 1880 : 1, nan
7074, 1344 : 0.8, -nan
7164, 2474 : 0.07, nan
7168, 2806 : 0.81, -nan

Any idea how to interpret them when my input matrices contain only real numbers in the range of (0...1)?

By the way, are these NaNs related with the 'all-zeros' rows and columns of my input matrices?

Build failed on gcc5.4 linux

'__work_gnu/lnx32e/kernel/service_atomic_int.o' failed to compile due to a syntax error:

__work_gnu/lnx32e/kernel/service_atomic_int.cpp:33:1: error: specializing member ‘daal::services::interface1::Atomic::Atomic’ requires ‘template<>’ syntax
daal::services::Atomic::Atomic() : _ptr(nullptr)
^

(repeated for each member function definition in that file)

Files in daal-daal_2018_update1.zip are corrupt

I downloaded the zip archive for the 2018_update1 and the files in ".\externals\mklfpk\win\lib" seem to be corrupt. The lib files just have a size of 1 kb and seem to contain build information. However, the files in the repo seem to be ok.

another failed test case with BIG numbers in weights and biases

I modified the sample code cpp/mpi/sources/neural_net_dense_allgather_distributed_mpi.cpp to train it with a data set with 6 features and 101 classes. When the training finished, prediction test failed on all test samples. The printTensors() call shows "nan" probability on all classes. How come?

I am curious what happened during the training, so i insert another printTensors() in the for-loop on line# 240 (the line has a comment /* FORWARD PASS */) to dump the wTensor[l] and bTensor[l] arrays on each iteration (batch). I am surprised to find that the weights and biases grow larger and larger and eventually became all "NaN".

For example, on the 5th iteration (ie., the one with 100th training sample), the two tensors on layer 0 shows the following values:

wTensor[0] i=100 bTensor[0] i=100
-0.310 0.504 0.008 0.005 0.027 0.004 0.120
-0.305 0.496 0.008 0.004 0.027 0.002 0.228
-0.304 0.496 0.009 0.004 0.027 0.003 0.228
-0.309 0.503 0.008 0.005 0.028 0.003 0.501
-0.304 0.496 0.009 0.003 0.027 0.003 0.190
-0.306 0.498 0.009 0.005 0.027 0.004 0.293
-0.303 0.492 0.009 0.004 0.026 0.003 0.140
-0.307 0.499 0.008 0.004 0.027 0.004 0.421
-0.314 0.510 0.009 0.003 0.028 0.004 0.173
-0.303 0.495 0.009 0.005 0.025 0.003 0.274
-0.309 0.503 0.009 0.004 0.026 0.003 0.382
-0.306 0.498 0.008 0.005 0.027 0.004 0.025
-0.300 0.488 0.008 0.004 0.025 0.002 0.467
-0.304 0.495 0.008 0.004 0.026 0.003 0.228
-0.315 0.511 0.008 0.005 0.028 0.003 0.462
-0.297 0.484 0.008 0.004 0.027 0.003 0.339

Then, on 10th iteration, the two tensors show the following values:

wTensor[0] i=250 bTensor[0] i=250
20423804928.000-24076877824.000-2788184064.000-2061500416.000-1226406912.000-257311488.000 -344658944.000
20031678464.000-23614617600.000-2734652672.000-2021921152.000-1202860800.000-252371264.000 -338041728.000
20134170624.000-23735443456.000-2748644608.000-2032265984.000-1209015040.000-253662512.000 -339771296.000
20345231360.000-23984257024.000-2777457920.000-2053569920.000-1221688704.000-256321616.000 -343333024.000
20118687744.000-23717189632.000-2746531072.000-2030703488.000-1208085248.000-253467488.000 -339510048.000
20129929216.000-23730440192.000-2748065024.000-2031837696.000-1208760192.000-253609056.000 -339699648.000
19878868992.000-23434477568.000-2713792000.000-2006497152.000-1193684864.000-250446096.000 -335463008.000
20237498368.000-23857250304.000-2762750976.000-2042696064.000-1215219840.000-254964336.000 -341515040.000
20707330048.000-24411115520.000-2826889728.000-2090118144.000-1243431936.000-260883520.000 -349443520.000
20010489856.000-23589636096.000-2731759872.000-2019782144.000-1201588096.000-252104320.000 -337684096.000
20424769536.000-24078016512.000-2788315904.000-2061597952.000-1226464640.000-257323664.000 -344675232.000
20189376512.000-23800524800.000-2756180992.000-2037838592.000-1212330112.000-254358064.000 -340702912.000
19812022272.000-23355670528.000-2704665856.000-1999749760.000-1189670528.000-249603936.000 -334334880.000
20055734272.000-23642976256.000-2737936384.000-2024348928.000-1204305152.000-252674352.000 -338447648.000
20682610688.000-24381980672.000-2823515392.000-2087623680.000-1241947648.000-260572096.000 -349026432.000
19703820288.000-23228116992.000-2689894400.000-1988828288.000-1183173376.000-248240688.000 -332508960.000
20096104448.000-23690567680.000-2743447808.000-2028423680.000-1206729088.000-253182912.000 -339128864.000
20273483776.000-23899676672.000-2767663104.000-2046327936.000-1217380608.000-255417696.000 -342122272.000
20409819136.000-24060395520.000-2786274560.000-2060088960.000-1225567104.000-257135312.000 -344422944.000
20317394944.000-23951441920.000-2773657600.000-2050760192.000-1220017280.000-255970912.000 -342863264.000

On the next batch, the same layer (0) has the following weights and biases:

wTensor[0] i=275 bTensor[0] i=275
-14304945344528515072.00013577232474173341696.000262415045722374144.000224360450068840448.0001348394056182398976.00078858193714806784.000234582867370311680.000
-14032691971840016384.00013318827450436681728.000257420617232416768.000220090324863680512.0001322731454790107136.00077357351752957952.000230118248866119680.000
-14100557128041234432.00013383242339149938688.000258665762611265536.000221154823918059520.0001329128413440507904.00077731486354112512.000231231143611990016.000
-14253787267511353344.00013528676941179125760.000261476578188328960.000223558064278601728.0001343571873060880384.00078576168982282240.000233743939998318592.000
-14090812156484255744.00013373992147825459200.000258486920173060096.000221001957442060288.0001328209908914454528.00077677756313239552.000231071388008448000.000
-14101796277645737984.00013384417717080031232.000258688491578195968.000221174288709844992.0001329245236550959104.00077738315352113152.000231251467397234688.000
-13925934890341105664.00013217501956378984448.000255462249584394240.000218415940453269504.0001312668449494794240.00076768838154190848.000228367585836531712.000
-14176242010939195392.00013455075632815800320.000260054067840024576.000222341884159197184.0001336262594637332480.00078148699477245952.000232472337620926464.000
-14501940444830629888.00013764206625499906048.000266028762485751808.000227450129282498560.0001366963158308093952.00079944159015731200.000237813335611932672.000
-14017006338958163968.00013303940062996594688.000257132923143061504.000219844343496704000.0001321252886528655360.00077270885471354880.000229861031864696832.000
-14306688070458540032.00013578887239173144576.000262447051818663936.000224387834780319744.0001348558433170751488.00078867814441549824.000234611471852503040.000
-14139290723664527360.00013420004510424629248.000259376201741631488.000221762286912536576.0001332779616678445056.00077944997768331264.000231866334915330048.000
-13878239175439810560.00013172235062663446528.000254587416285806592.000217667980488605696.0001308172683887771648.00076505926026133504.000227585472291930112.000
-14047856436210302976.00013333220057644269568.000257698845213851648.000220328180152532992.0001324160819906215936.00077440948996407296.000230366927472558080.000
-14490277924994809856.00013753135642919829504.000265814838754672640.000227267198035427328.0001365863921558224896.00079879863355310080.000237622140847783936.000
-13798587254588833792.00013096632643137568768.000253126148152623104.000216418626041806848.0001300664531298549760.00076066799979855872.000226279252478132224.000
-14074563573648982016.00013358569298222645248.000258188849442717696.000220747111262584832.0001326678289216962560.00077588171885379584.000230804911057534976.000
-14199532965750374400.00013477180214580609024.000260481279647023104.000222707093818310656.0001338457907041140736.00078277084639657984.000232854228933017600.000
-14296670420017872896.00013569376463592882176.000262263175678787584.000224230604617547776.0001347614227560398848.00078812572572188672.000234447180763496448.000
-14231540848746561536.00013507560820367687680.000261068436036124672.000223209106775736320.0001341474966947758080.00078453539076046848.000233379108296327168.000

Then, on 12th batch (i=300), all weights and biases become "nan" !!!

wTensor[0] i=300 bTensor[0] i=300
-nan -nan -nan -nan -nan -nan -nan
-nan -nan -nan -nan -nan -nan -nan
-nan -nan -nan -nan -nan -nan -nan
-nan -nan -nan -nan -nan -nan -nan
-nan -nan -nan -nan -nan -nan -nan
-nan -nan -nan -nan -nan -nan -nan
-nan -nan -nan -nan -nan -nan -nan
-nan -nan -nan -nan -nan -nan -nan
-nan -nan -nan -nan -nan -nan -nan
-nan -nan -nan -nan -nan -nan -nan
-nan -nan -nan -nan -nan -nan -nan
-nan -nan -nan -nan -nan -nan -nan
-nan -nan -nan -nan -nan -nan -nan
-nan -nan -nan -nan -nan -nan -nan
-nan -nan -nan -nan -nan -nan -nan
-nan -nan -nan -nan -nan -nan -nan
-nan -nan -nan -nan -nan -nan -nan
-nan -nan -nan -nan -nan -nan -nan
-nan -nan -nan -nan -nan -nan -nan
-nan -nan -nan -nan -nan -nan -nan

Apparently something is wrong either in the sample code or in DAAL library. I'm trying to figure out in which...but if anyone who is more familiar with the code base could take a look of the issue, i will very appreciate it!

PCA DAAL 2017

Hi,

Since daal update 2017 PCA doesn't work if the number of rows is inferior than the number of columns using HomogenousNumericTable.

Thanks,

Vivien

any plans to release to maven?

that could really spur usage among java devs . . . the binary download is not so easy to add to a standard java project . . .

PCA returning uninitialized memory in java

Doing PCA from java and using array-backed homogen tables I am getting random results.

When I do the PCA-transform, I get a full crash.

I hypothesize that the underlying systems are built with an expectation of native-backed homogen tables. I would use these if I could create/write to them from java.

INPUT!!
[0.13159585 0.31569946 0.6232644 0.010820592 0.19805706 0.3987138 0.50005794 0.5305799 0.6581651 0.7627357 0.7104393 0.57077545 0.6274359 0.66977036 0.43445513 0.6885395 0.86060476 0.49495244 0.4189684 0.28195474 0.35755748 0.71990365 0.98710334 0.16786002 0.67515635]
OUTPUT!!
[1.19614047E15 1.7808404 -1.0399677E38 1.7104841 1.8204983E25 -1.6404581 -3.841203E32 1.7695128 5.0967483E36 1.5204237 -1.7051354E23 -1.2805741 4.6427166E13 1.6540436 -8.29526 1.7968094 -0.06854222 -1.0929767 -7.634548E14 1.7891431 2.2111098E-18 1.6233151 1.1249596E-15 1.7784784 8.7900836E18]
TENS-INPUT #tech.compute.tensor.Tensor<float64>[5 5]
[[0.132 0.316 0.623 0.011 0.198]
 [0.399 0.500 0.531 0.658 0.763]
 [0.710 0.571 0.627 0.670 0.434]
 [0.689 0.861 0.495 0.419 0.282]
 [0.358 0.720 0.987 0.168 0.675]]
DAAL Variances: [-2.0855055E-32 1.3620152 4.923748E-5 1.2987437 -2.37078E31]
DAAL Eigenvectors: #tech.compute.tensor.Tensor<float32>[5 5]
[[         1196140473090048.000                                  1.781 -103996767309714100000000000000000000000.000                                     1.710 18204983351722523000000000.000]
 [                       -1.640 -384120298732981960000000000000000.000                                        1.770 5096748328367925000000000000000000000.000                          1.520]
 [-170513541694846300000000.000                                 -1.281                           46427166212096.000                                     1.654                         -8.295]
 [                        1.797                                 -0.069                                       -1.093                      -763454797381632.000                          1.789]
 [                        0.000                                  1.623                                        0.000                                     1.778        8790083641406390300.000]]
SMILE!!!
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Mar 03, 2019 10:55:35 AM com.github.fommil.netlib.LAPACK <clinit>
WARNING: Failed to load implementation from: com.github.fommil.netlib.NativeSystemLAPACK
Mar 03, 2019 10:55:35 AM com.github.fommil.netlib.LAPACK <clinit>
WARNING: Failed to load implementation from: com.github.fommil.netlib.NativeRefLAPACK
Mar 03, 2019 10:55:35 AM com.github.fommil.netlib.BLAS <clinit>
WARNING: Failed to load implementation from: com.github.fommil.netlib.NativeSystemBLAS
Mar 03, 2019 10:55:35 AM com.github.fommil.netlib.BLAS <clinit>
WARNING: Failed to load implementation from: com.github.fommil.netlib.NativeRefBLAS
Smile Variances [0.11878051662092194 0.058246194307802604 0.04376726277729931 0.008460767444494437 1.0408340828162882E-17]
Smile Eigenvectors  #tech.compute.tensor.Tensor<float64>[5 5]
[[ 0.561  0.281 -0.202  0.719  0.221]
 [ 0.257  0.009 -0.478 -0.082 -0.836]
 [-0.338 -0.725 -0.444  0.390  0.103]
 [-0.380  0.529 -0.674 -0.190  0.293]
 [ 0.601 -0.340 -0.282 -0.536  0.395]]

The PCA code is here.

neural network training batch problem causing issue in pydaal wrapper

The interface of the function initialize here unlike in most of the code takes directly Topology class object instead of the pointer to this object.
https://github.com/intel/daal/blob/daal_2019_beta/include/algorithms/neural_networks/neural_networks_training.h#L150

In the python wrapper it is only possible to work with classes as pointers. When constructor is used shared ptr to the object topology is returned and it is not possible to dereference this pointer in the python code.

So the usage of this function is not possible and there is no other public function in the class which will allow to set a topology for the network.

Possible solution could be override the function to support pointers instead of objects as input.

neural_net_dense_allgather_distributed_mpi tends to predict in a 'safety zone'

Hi,

I modified the file, simply to add an 'early stop' function to the code. Nothing else.

Then i trained the 4-layer DNN with 2M data samples. I ran it thru different configurations of nueron numbers. Please visit my result visualization.

You could see the predictions tend to stay in a zone between 65 and 75.

I tried to tune initial weight/bias distributions and learning rates (to avoid gradient 'explosion' to NaNs).

You could visit my github for the code i tested.

Any idea what may be wrong in DAAL code and in mine?

Thanks,
Peter

how-to use relu as activation function

Can anybody give an idea about how to use relu function as the activation function for all fully-connected layers instead of using sigmoid function? I appreciate it!!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.