Tensor for F#
A tensor is an n-dimensional array of an arbitrary data type (for example
Tensors of data type
'T are implemented by the Tensor<'T> type.
A tensor can be either stored in host memory or in the memory of a GPU computing device. Currently only nVidia cards implementing the CUDA API are supported. The API for host and GPU stored tensors is mostly equal, thus a program can make use of GPU accelerated operations without porting effort.
The tensor library provides functionality similar to Numpy's Ndarray and MATLAB arrays, including vector-wise operations, reshaping, slicing, broadcasting, masked assignment, reduction operations and BLAS operations.
Features provided by the core Tensor library
- Core features
- n-dimensional arrays (tensors) in host memory or on CUDA GPUs
- element-wise operations (addition, multiplication, absolute value, etc.)
- basic linear algebra operations (dot product, SVD decomposition, matrix inverse, etc.)
- reduction operations (sum, product, average, maximum, arg max, etc.)
- logic operations (comparison, and, or, etc.)
- views, slicing, reshaping, broadcasting (similar to NumPy)
- scatter and gather by indices
- standard functional operations (map, fold, etc.)
- Data exchange
- read/write support for HDF5 (.h5)
- interop with standard F# types (Seq, List, Array, Array2D, Array3D, etc.)
- host: SIMD and Intel MKL accelerated operations
- CUDA GPU: all operations performed locally on GPU and cuBLAS used for matrix operations
Additional features provided by Tensor.Algorithm
- Matrix algebra (integer, rational)
- Row echelon form
- Smith normal form
- Kernel, co-kernel and (pseudo-)inverse
- Matrix decomposition (floating point)
- Principal component analysis (PCA)
- ZCA whitening
- Bezout's identity
- Loading of NumPy's .npy and .npz files.
2018/05/05. The CUDA SDK is no longer required for using GPU acceleration. An up-to-date nVidia GPU driver must be installed, however.
2018/05/02. Initial benchmarks are available.
Check out our example project that demonstrates essential features of the library at https://github.com/DeepMLNet/Tensor.Sample.