Tensor: Scientific Computing for PHP

Overview

Tensor: Scientific Computing for PHP

PHP from Packagist Latest Stable Version PHP Build Extension Build Downloads from Packagist GitHub

A library and extension that provides objects for scientific computing in PHP.

Installation

Follow the instructions below to install either Tensor PHP or the Tensor extension.

Tensor PHP

Install Tensor PHP into your project with Composer:

$ composer require rubix/tensor

Tensor Extension

Install the Tensor extension via PECL:

$ pecl install tensor

Note: If both the library and extension are installed, the extension will take precedence.

Requirements

  • PHP 7.4 or above

Optional To Compile Extension

Manually Compiling the Extension

Clone the repository locally using Git:

$ git clone https://github.com/RubixML/Tensor

Make sure you have all the necessary build tools installed such as a C compiler and make tools. For example, on an Ubuntu linux system you can enter the following on the command line to install the necessary dependencies.

$ sudo apt-get install make gcc gfortran php-dev libopenblas-dev liblapacke-dev re2c build-essential

Then, change into the ext directory from the project root and run the following commands from the terminal. See this guide for more information on compiling PHP extensions with PHPize.

$ cd ./ext
$ phpize
$ ./configure
$ make
$ sudo make install

Finally, add the following line to your php.ini configuration to install the extension.

extension=tensor.so

To confirm that the extension is loaded in PHP, you can run the following command.

php -m | grep tensor

Performance Comparison

Tensor Performance MNIST

Tensor Performance Benchmarks

Funding

Rubix ML is funded by donations from the community. You can become a sponsor by making a contribution to one of our funding sources below.

Contributing

See CONTRIBUTING.md for guidelines.

License

The code is licensed MIT and the documentation is licensed CC BY-NC 4.0.

Comments
  • Matrix multiplication by Strassen algorithm

    Matrix multiplication by Strassen algorithm

    Hello. I'd like to propose adding an alternative to the standard matrix multiplication, the multiplication using Strassen algorithm, which asymptotic complexity is lower, O(n^2.81) vs ϴ(n^3)

    opened by tuqqu 8
  • Failed to install PHP extension in PHP Docker images with pecl

    Failed to install PHP extension in PHP Docker images with pecl

    I can't install tensor in a PHP 7.2 Alpine image with pecl.

    Steps to reproduce inside the docker image (docker run --rm -it php:7.2-cli-alpine sh)

    apk update
    apk add $PHPIZE_DEPS lapack-dev libexecinfo-dev openblas-dev
    pecl install tensor
    

    Here's the last few lines of the output:

     cc -O3 -ffast-math -I. -I/tmp/pear/temp/tensor/ext -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-defaultuserDNKfcM/tensor-2.1.4/include -I/tmp/pear/temp/pear-build-defaultuserDNKfcM/tensor-2.1.4/main -I/tmp/pear/temp/tensor/ext -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/tensor/ext/tensor/tensor.zep.c  -fPIC -DPIC -o tensor/.libs/tensor.o
    /bin/sh /tmp/pear/temp/pear-build-defaultuserDNKfcM/tensor-2.1.4/libtool --mode=compile cc -O3 -ffast-math -I. -I/tmp/pear/temp/tensor/ext -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-defaultuserDNKfcM/tensor-2.1.4/include -I/tmp/pear/temp/pear-build-defaultuserDNKfcM/tensor-2.1.4/main -I/tmp/pear/temp/tensor/ext -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /tmp/pear/temp/tensor/ext/tensor/vector.zep.c -o tensor/vector.lo
     cc -O3 -ffast-math -I. -I/tmp/pear/temp/tensor/ext -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-defaultuserDNKfcM/tensor-2.1.4/include -I/tmp/pear/temp/pear-build-defaultuserDNKfcM/tensor-2.1.4/main -I/tmp/pear/temp/tensor/ext -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/tensor/ext/tensor/vector.zep.c  -fPIC -DPIC -o tensor/.libs/vector.o
    /bin/sh /tmp/pear/temp/pear-build-defaultuserDNKfcM/tensor-2.1.4/libtool --mode=compile cc -O3 -ffast-math -I. -I/tmp/pear/temp/tensor/ext -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-defaultuserDNKfcM/tensor-2.1.4/include -I/tmp/pear/temp/pear-build-defaultuserDNKfcM/tensor-2.1.4/main -I/tmp/pear/temp/tensor/ext -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /tmp/pear/temp/tensor/ext/tensor/columnvector.zep.c -o tensor/columnvector.lo
     cc -O3 -ffast-math -I. -I/tmp/pear/temp/tensor/ext -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-defaultuserDNKfcM/tensor-2.1.4/include -I/tmp/pear/temp/pear-build-defaultuserDNKfcM/tensor-2.1.4/main -I/tmp/pear/temp/tensor/ext -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/tensor/ext/tensor/columnvector.zep.c  -fPIC -DPIC -o tensor/.libs/columnvector.o
    /bin/sh /tmp/pear/temp/pear-build-defaultuserDNKfcM/tensor-2.1.4/libtool --mode=compile cc -O3 -ffast-math -I. -I/tmp/pear/temp/tensor/ext -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-defaultuserDNKfcM/tensor-2.1.4/include -I/tmp/pear/temp/pear-build-defaultuserDNKfcM/tensor-2.1.4/main -I/tmp/pear/temp/tensor/ext -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /tmp/pear/temp/tensor/ext/tensor/decompositions/cholesky.zep.c -o tensor/decompositions/cholesky.lo
    /tmp/pear/temp/pear-build-defaultuserDNKfcM/tensor-2.1.4/libtool: line 1283: can't create tensor/decompositions/cholesky.loT: nonexistent directory
    mkdir tensor/decompositions/.libs
    mkdir: can't create directory 'tensor/decompositions/.libs': No such file or directory
    make: *** [Makefile:252: tensor/decompositions/cholesky.lo] Error 1
    ERROR: `make' failed
    
    bug help wanted 
    opened by mlocati 7
  • Research paths to 20X and beyond

    Research paths to 20X and beyond

    We have decided to direct some efforts toward researching a new Tensor 3.0 extension with the API code written in Zephir and optimized code written in C with the goal of drastically accelerating tensor operations. The Tensor 2.0 extension gave us a 2.5X speedup over the PHP implementation, this research is to develop a set of minimum features necessary to achieve at least a 10X speedup. Possible ways to achieve this are BLAS library integration, cache-efficient blocking algorithms, a fixed or strided array implementation, and vectorized operations. Optional but desirable enhancements to the extension include n-d array operations and CPU and GPU parallelization. In addition, incremental backwards compatible optimizations can be applied to the 2.0.0 branch as part of this research.

    With a 10X+ speedup over the PHPland code we should be able to implement more advanced deep learning models including LSTMs and potentially Convnets (if we figure out a sensible n-d array implementation).

    Other things to consider ...

    • Will it be easier to reverse-engineer the Zephir-generated code or write it from scratch?
    • Will it be easier/better to interface to TensorFlow under the hood?

    Resources

    • https://github.com/RubixML/Tensor/tree/master/ext
    • https://www.zend.com/resources/writing-php-extensions
    • https://github.com/numpy/numpy
    Research 
    opened by andrewdalpino 6
  • modColumnVector remainder behaviour fix

    modColumnVector remainder behaviour fix

    modColumnVector does not return a correct result and PHPUnit is also expecting the wrong values. The true mod (checked using NumPy) for the implemented test (Tests/MatrixTest::modColumnVector) is:

    [
         [ 2. ,  0.5,  2. ],
         [-0. , -0. , -0. ],
         [ 0.8,  3.6,  0.6]
     ]
    

    PHP modulus operand "%" is made for integer only operations, witch can cause unexpected results when used for floating points.

    fmod for some reason also failed to return the correct value and it is also famous for having problems with floating points, so it had to be implemented manually.

    bug 
    opened by henrique-borba 6
  • Link against libopenblas.lib on Windows

    Link against libopenblas.lib on Windows

    Without a respective lib, linking would inevitably fail. We also add a check for cblas.h, and if either is not found, disable ext/tensor with a respective warning.

    See also https://github.com/RubixML/Tensor/issues/22.

    opened by cmb69 5
  • Make it so tests fail if PHP outputs warnings at startup

    Make it so tests fail if PHP outputs warnings at startup

    When using the tensor PHP extension with PHP 8.1, at startup PHP displays the warnings reported at #28

    For example. by simply running an empty PHP code, here's what we have:

    
    Deprecated: Return type of Tensor\Vector::offsetGet($index) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in Unknown on line 0
    
    Deprecated: Return type of Tensor\Vector::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in Unknown on line 0
    
    Deprecated: Return type of Tensor\Matrix::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in Unknown on line 0
    

    What about making it so tests fails in this case?

    opened by mlocati 2
  • Eigenvalues and vectors from JAMA implementation are wrong

    Eigenvalues and vectors from JAMA implementation are wrong

    After some failed tests with CRubix interface I realized the expected eigenvalues and vectors from MatrixTest are actually wrong compared to other libraries. The following matrix was used:

    [
          [22, -17, 12],
          [4, 11, -2],
          [20, -6, -9],
    ]
    

    Tensor with JAMA

    $values = [25.108706520450326, -15.096331148319537, 13.9876246278692];
    $vectors = [
                [-0.5029346679560592, -0.1309992382037118, -0.33107976181279675],
                [0.15580805853732102, -0.08643645234319261, -0.6918777439682378],
                [0.8501650243704214, 0.987607178637524, 0.641631809310763],
            ];
    

    Tensor with CArray

    $values = [-15.09633115,  25.10870652,  13.98762463];
    $vectors = [[  0.25848695, -0.86227193, -0.66844722 ]
                [ -0.11314538, -0.17721180, -0.61268791 ]
                [ -0.95936574,  -0.47442924, -0.42165370 ]];
    

    Computed using LAPACK_dgeev

    NumPy

    values = [-15.09633115,  25.10870652,  13.98762463]
    vectors = [[ 0.25848695, -0.86227193, -0.66844722],
               [-0.11314538, -0.1772118 , -0.61268791],
               [-0.95936574, -0.47442924, -0.4216537 ]]
    

    Computed using LAPACK_dgeev

    opened by henrique-borba 2
  • Warnings when using Tensor on PHP 8.1

    Warnings when using Tensor on PHP 8.1

    When using the tensor PHP extension with PHP 8.1 we have these PHP warnings:

    
    Deprecated: Return type of Tensor\Vector::offsetGet($index) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in Unknown on line 0
    
    Deprecated: Return type of Tensor\Vector::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in Unknown on line 0
    
    Deprecated: Return type of Tensor\Matrix::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in Unknown on line 0
    

    a simple fix is to simply add this line right before these methods:

    #[\ReturnTypeWillChange]
    

    See https://www.php.net/manual/en/migration81.incompatible.php#migration81.incompatible.core.type-compatibility-internal

    opened by mlocati 1
  • How to install Tensor extension dependencies on Linux

    How to install Tensor extension dependencies on Linux

    I got three errors when trying to install the tensor package using pecl. Error 1: /tmp/pear/temp/tensor/ext/tensor.c:25:10: fatal error: cblas.h: No such file or directory Error 2: /tmp/pear/temp/tensor/ext/include/linear_algebra.c:7:10: fatal error: lapacke.h: No such file or directory Error 3:

    /usr/bin/ld: cannot find -lgfortran
    collect2: error: ld returned 1 exit status
    

    The solution is to install libopenblas, libraries and gfortran.

    apt-get install libopenblas-dev
    apt-get install liblapacke-dev
    apt-get install gfortran
    
    not an issue 
    opened by bounmed 1
  • Singular Value Decomposition (SVD)

    Singular Value Decomposition (SVD)

    Singular Value Decomposition (SVD) is used in a few machine learning methods such as Latent Semantic Analysis (LSA), collaborative filtering recommender systems, and more. It generalizes the eigendecomposition of a square normal matrix to any m x n matrix via an extension of the polar decomposition. This ticket is to research the best SVD algorithm (or set of algorithms) to implement that covers the two aforementioned use cases. Note that we'll need both PHP and Zephir/C implementations of SVD, however, for the prototype it would be perfectly fine to focus on one (PHP) or the other (Zephir/C).

    https://en.wikipedia.org/wiki/Singular_value_decomposition

    https://en.wikipedia.org/wiki/Matrix_factorization_(recommender_systems)

    https://en.wikipedia.org/wiki/Latent_semantic_analysis

    https://numpy.org/devdocs/reference/generated/numpy.linalg.svd.html

    enhancement help wanted 
    opened by andrewdalpino 1
  • New eigenvalues/eigenvectors implementation

    New eigenvalues/eigenvectors implementation

    The code we use for eigenvalue/eigenvector computation is ancient and I have no idea how it works. I feel we can do better or at least if someone knew what they were doing could refactor the monster algorithm. I believe the code was written in the PHP 4 days.

    Here's what we're working with currently

    https://github.com/RubixML/Tensor/blob/master/lib/JAMA/EigenvalueDecomposition.php

    help wanted 
    opened by andrewdalpino 1
  • PHP 8.2 compatibility

    PHP 8.2 compatibility

    In case you need to move to PHP 8.2 before @andrewdalpino find's time to update Tensor:

    https://github.com/myfluxi/Tensor/commit/a6c229b762af5227a85db295e1d7451ab7edc8e9

    opened by myfluxi 1
  • Question: Future of RubixML/DL

    Question: Future of RubixML/DL

    Hello, How is the research on https://github.com/RubixML/DL/issues/1 going? Whole repository seems to be archived few years ago.. Will there ever be a GPU support on PHP with Tensor extension? Or is there already an alternative to it?

    Guys ar Tensorflow, according to https://discuss.tensorflow.org/t/tensorflow-for-php/1373 are not planning to implement it as independant wrapper. Instead they are advising to run TensorFlow Serving server for computing and interact with it through REST API

    Would be glad to hear your thoughts on what is current globally best approach to utilize GPU while using PHP. Can't find much info on internet aswell, most posts are 4years old..

    Multi-threading using RubixML/Tensor is a great oportunity, but CPU performance still can't compare to GPU, especially with specialised matrix multiplication cores from nvidia RTX.

    opened by Anecho 1
  • Docker php:7.4-fpm-alpine pecl install and build from source fails

    Docker php:7.4-fpm-alpine pecl install and build from source fails

    Versions according to https://pkgs.alpinelinux.org/packages

    .Dockerfile for pecl install tensor

    FROM php:7.4-fpm-alpine
    
    RUN apk update && apk --no-cache add --update \
        # Optional To Compile Extension
        # A C compiler v12.1.1_git20220630-r5
        autoconf gcc musl-dev g++ \
        # A Fortran compiler v12.1.1_git20220630-r5
        bash bash-doc bash-completion musl-dev gfortran gdb make \
        # OpenBLAS development package v0.3.21-r0
        openblas-dev \
        # LAPACKE C interface to LAPACK v3.10.1-r0
        lapack \
        # re2c v3.0-r0
        re2c \
        # make v4.3-r0
        make \
        # autoconf v2.71-r0
        autoconf \
        # automake v1.16.5-r1
        automake \
        # build-essentials for Alpine 
        alpine-sdk build-base
        # execinfo.h missing error: 
        # libexecinfo-dev
    
    RUN pecl install tensor
    

    Error from pecl install tensor:

    #0 10.20 /tmp/pear/temp/tensor/ext/kernel/backtrace.c:15:10: fatal error: execinfo.h: No such file or directory
    #0 10.20    15 | #include <execinfo.h>
    #0 10.20       |          ^~~~~~~~~~~~
    #0 10.20 compilation terminated.
    #0 10.20 make: *** [Makefile:202: kernel/backtrace.lo] Error 1
    #0 10.20 ERROR: `make' failed
    

    Fixed by apk add libexecinfo-dev https://github.com/awslabs/aws-lambda-cpp/issues/124#issuecomment-968302646

    But then other error pops up:

    #0 85.60 /usr/lib/gcc/x86_64-alpine-linux-musl/11.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -llapacke: No such file or directory
    #0 85.61 collect2: error: ld returned 1 exit status
    #0 85.61 make: *** [Makefile:289: tensor.la] Error 1
    #0 85.62 ERROR: `make' failed
    

    musl/bin/ld file is there.

    bash-5.1# ls /usr/lib/gcc/x86_64-alpine-linux-musl/11.2.1/../../../../x86_64-alpine-linux-musl/bin/ -l
    total 4936
    -rwxr-xr-x    2 root     root         59536 Jul  7 13:57 ar
    -rwxr-xr-x    2 root     root        659448 Jul  7 13:57 as
    -rwxr-xr-x    4 root     root       1469904 Jul  7 13:57 ld
    -rwxr-xr-x    4 root     root       1469904 Jul  7 13:57 ld.bfd
    -rwxr-xr-x    2 root     root         52392 Jul  7 13:57 nm
    -rwxr-xr-x    2 root     root        157808 Jul  7 13:57 objcopy
    -rwxr-xr-x    2 root     root        332720 Jul  7 13:57 objdump
    -rwxr-xr-x    2 root     root         59568 Jul  7 13:57 ranlib
    -rwxr-xr-x    2 root     root        620928 Jul  7 13:57 readelf
    -rwxr-xr-x    2 root     root        157808 Jul  7 13:57 strip
    

    Also tried building from source - same error on make step pops up.

    .Dockerfile for build tensor from source

    RUN apk update && apk --no-cache add --update \
        # A C compiler v12.1.1_git20220630-r5
        autoconf gcc musl-dev g++ cmake \
        # A Fortran compiler v12.1.1_git20220630-r5
        bash bash-doc bash-completion musl-dev gfortran gdb make \
        # OpenBLAS development package v0.3.21-r0
        openblas-dev \
        # LAPACKE C interface to LAPACK v3.10.1-r0
        lapack \
        # re2c v3.0-r0
        re2c \
        # make v4.3-r0
        make \
        # autoconf v2.71-r0
        autoconf \
        # automake v1.16.5-r1
        automake \
        # build-essentials for Alpine 
        alpine-sdk build-base \
        # execinfo.h missing: https://github.com/awslabs/aws-lambda-cpp/issues/124#issuecomment-968302646
        libexecinfo-dev
    
    # RUN pecl install tensor
    
    RUN git clone https://github.com/RubixML/Tensor Tensor
    
    WORKDIR /var/www/html/Tensor/ext
    
    RUN phpize \
        && ./configure \
        && make \
        && make install
    

    Error from build tensor from source:

    #0 86.23 /usr/lib/gcc/x86_64-alpine-linux-musl/11.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -llapacke: No such file or directory
    #0 86.27 collect2: error: ld returned 1 exit status
    #0 86.28 make: *** [Makefile:289: tensor.la] Error 1
    

    What am I missing here?

    opened by Anecho 4
  • Getting lapacke.h: No such file or directory doing manual build on centOS

    Getting lapacke.h: No such file or directory doing manual build on centOS

    here is the error i'm getting: /bin/sh /home/trendalix1/Tensor/ext/libtool --mode=compile cc -O3 -ffast-math -I. -I/home/trendalix1/Tensor/ext -DPHP_ATOM_INC -I/home/trendalix1/Tensor/ext/include -I/home/trendalix1/Tensor/ext/main -I/home/trendalix1/Tensor/ext -I/opt/cpanel/ea-php74/root/usr/include/php -I/opt/cpanel/ea-php74/root/usr/include/php/main -I/opt/cpanel/ea-php74/root/usr/include/php/TSRM -I/opt/cpanel/ea-php74/root/usr/include/php/Zend -I/opt/cpanel/ea-php74/root/usr/include/php/ext -I/opt/cpanel/ea-php74/root/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /home/trendalix1/Tensor/ext/include/linear_algebra.c -o include/linear_algebra.lo libtool: compile: cc -O3 -ffast-math -I. -I/home/trendalix1/Tensor/ext -DPHP_ATOM_INC -I/home/trendalix1/Tensor/ext/include -I/home/trendalix1/Tensor/ext/main -I/home/trendalix1/Tensor/ext -I/opt/cpanel/ea-php74/root/usr/include/php -I/opt/cpanel/ea-php74/root/usr/include/php/main -I/opt/cpanel/ea-php74/root/usr/include/php/TSRM -I/opt/cpanel/ea-php74/root/usr/include/php/Zend -I/opt/cpanel/ea-php74/root/usr/include/php/ext -I/opt/cpanel/ea-php74/root/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /home/trendalix1/Tensor/ext/include/linear_algebra.c -fPIC -DPIC -o include/.libs/linear_algebra.o /home/trendalix1/Tensor/ext/include/linear_algebra.c:7:21: fatal error: lapacke.h: No such file or directory #include <lapacke.h> ^ compilation terminated. make: *** [include/linear_algebra.lo] Error 1

    I can see that i have the lapacke.h files on the server with : find / -name lapacke.h which returns:

    /usr/include/openblas/lapacke.h
    /usr/include/lapacke/lapacke.h
    

    I also tried adding the include paths so it would find it with:

    export PATH="$HOME/usr/include:$PATH"
    export PATH="$HOME/usr/include/openblas:$PATH"
    export PATH="$HOME/usr/include/lapacke:$PATH"
    export PATH="$HOME/include:$PATH"
    

    but it doesn't seem to find the file. Sorry if this is something obvious, i don't spend much time in the command line.

    Thanks, Mark

    opened by MarkLuds 2
  • PECL Windows Build Fails (Missing Dependencies on Build Server)

    PECL Windows Build Fails (Missing Dependencies on Build Server)

    All versions fail to compile

    fatal error C1083: Cannot open include file: 'cblas.h': No such file or directory

    See https://windows.php.net/downloads/pecl/releases/tensor/

    help wanted 
    opened by P2T 32
Releases(3.0.3)
  • 3.0.3(Apr 3, 2022)

  • 3.0.2(Apr 2, 2022)

  • 3.0.1(Oct 31, 2021)

  • 3.0.0(Jun 6, 2021)

  • 3.0.0-beta(May 25, 2021)

    • Add support for PHP 8.0 in the extension
    • Drop extension support for PHP 7.2 and 7.3
    • Tensors only compute floating point operations
    • Remove dependency on JAMA library
    • Remove previously deprecated items
    • Matrix returns vector on row access
    • Added Algebraic and Special function interfaces
    Source code(tar.gz)
    Source code(zip)
  • 2.2.3(May 25, 2021)

  • 2.2.2(Apr 1, 2021)

  • 2.2.1(Mar 8, 2021)

  • 2.2.0(Feb 28, 2021)

    • Implemented Singular Value Decomposition (SVD)
    • Implemented matrix (Moore-Penrose) pseudoinverse
    • Tensor objects now throw namespaced exceptions
    • Optimized Reduced Row Echelon Form (RREF)
    • Optimize eigendecomposition for symmetric matrices
    Source code(tar.gz)
    Source code(zip)
  • 2.1.4(Feb 20, 2021)

    • Implemented Eigen decomposition in extension
    • Optimize row echelon form (REF) of matrix
    • Optimize Cholesky decomposition
    • Fix memory leak in matrix inverse
    • Optimize LU decomposition
    Source code(tar.gz)
    Source code(zip)
  • 2.1.3(Feb 14, 2021)

  • 2.1.2(Feb 8, 2021)

  • 2.1.1(Feb 1, 2021)

  • 2.1.0(Jan 15, 2021)

    • Extension now compiles directly from C source code
    • Remove Zephir extension code
    • Update instructions for extension compilation using PHPize
    Source code(tar.gz)
    Source code(zip)
  • 2.0.5(Apr 17, 2020)

  • 2.0.4(Feb 29, 2020)

    • Individual Arithmetic and Comparison methods now public
    • Matrix reductions have their own namespace
    • Optimized Matrix structural operations
    • Added argmin and argmax custom optimizers
    • Added matrix/sub matrix insertion
    Source code(tar.gz)
    Source code(zip)
  • 2.0.3(Jan 14, 2020)

    • Matrix decomp methods now return decomp objects
    • Optimized matrix statistical operations
    • Optimized vector outer product
    • Optimized Matrix flatten
    • Cannot instantiate null/empty tensors
    Source code(tar.gz)
    Source code(zip)
  • 2.0.2(Jan 9, 2020)

  • 2.0.1(Dec 13, 2019)

  • 2.0.0(Nov 14, 2019)

    • Implemented the library as an extension using Zephir lang
    • Changed namespace from Rubix\Tensor to \Tensor
    • Matrix decompositions are now a separate abstraction
    • Removed Dimensionality Mismatch exception
    • Added inverse trigonomic methods to tensor interface
    • Added Array-Like interface
    • Removed Column/Row exclude methods from Matrix
    • Changed method signature of matrix determinant
    • Added return sub matrix
    • Added positive definite and semidefinite methods to Matrix
    • Added is symmetric method to Matrix
    • Added Statistical and Trigonometric interfaces
    • Added Arithmetic and Comparable interfaces
    • Added log1p and expm1 methods to the Arithmetic interface
    • Added matrix full rank method
    • Added generate random Poisson distribution
    • Added Cholesky decomposition
    • Variance now takes an optional mean argument
    Source code(tar.gz)
    Source code(zip)
  • 1.0.4(Jun 29, 2019)

    • Added transpose to Tensor API
    • Reduced memory footprint of matmul operation
    • Removed magic getters
    • Added shape string method to Tensor API
    • Improved error messages for matrix dimensionality mismatch
    Source code(tar.gz)
    Source code(zip)
  • 1.0.3(Apr 21, 2019)

  • 1.0.2(Nov 29, 2018)

  • 1.0.1(Nov 2, 2018)

    • Added Column Vector
    • Implemented Eigenvalue decomposition
    • Added solve system of linear equations
    • Integration with 3rd party JAMA libray
    • Fixed variance covariance calculation
    • Added percentile calculation for Vector and Matrix
    • Blanket optimizations
    Source code(tar.gz)
    Source code(zip)
  • 1.0.0(Oct 20, 2018)

    • Implemented LU decomposition
    • Added vector projection
    • Implemented Matrix inverse
    • Implemented Row Echelon and Reduced Row Echelon decomposition
    • Added Matrix determinant
    • Added Matrix rank
    • Added Matrix/Vector products
    • Implemented universal element-wise tensor operations
    • Added statistical functions
    • Added trigonometric functions
    • Added exponential and logarithmic functions
    • Added tensor factories
    Source code(tar.gz)
    Source code(zip)
Owner
Rubix
Machine Learning and Deep Learning for the PHP language.
Rubix
A sampling profiler for PHP written in PHP, which reads information about running PHP VM from outside of the process.

Reli Reli is a sampling profiler (or a VM state inspector) written in PHP. It can read information about running PHP script from outside of the proces

null 272 Dec 22, 2022
PHP Meminfo is a PHP extension that gives you insights on the PHP memory content

MEMINFO PHP Meminfo is a PHP extension that gives you insights on the PHP memory content. Its main goal is to help you understand memory leaks: by loo

Benoit Jacquemont 994 Dec 29, 2022
A sampling profiler for PHP written in PHP, which reads information about running PHP VM from outside of the process.

Reli Reli is a sampling profiler (or a VM state inspector) written in PHP. It can read information about running PHP script from outside of the proces

null 258 Sep 15, 2022
A multithreaded application server for PHP, written in PHP.

appserver.io, a PHP application server This is the main repository for the appserver.io project. What is appserver.io appserver.io is a multithreaded

appserver.io 951 Dec 25, 2022
Easy to use utility functions for everyday PHP projects. This is a port of the Lodash JS library to PHP

Lodash-PHP Lodash-PHP is a port of the Lodash JS library to PHP. It is a set of easy to use utility functions for everyday PHP projects. Lodash-PHP tr

Lodash PHP 474 Dec 31, 2022
A PHP 5.3+ and PHP 7.3 framework for OpenGraph Protocol

Opengraph Test with Atoum cd Opengraph/ curl -s https://getcomposer.org/installer | php php composer.phar install --dev ./vendor/atoum/atoum/bin/atoum

Axel Etcheverry 89 Dec 27, 2022
A status monitor for Elite Dangerous, written in PHP. Designed for 1080p screens in the four-panel-view in panel.php, and for 7 inch screens with a resolution of 1024x600 connected to a Raspberry Pi.

EDStatusPanel A status monitor for Elite Dangerous, written in PHP. Designed for 1080p screens in the four-panel-view in panel.php, and for 7 inch scr

marcus-s 24 Oct 4, 2022
🐘 A probe program for PHP environment (一款精美的 PHP 探針, 又名X探針、劉海探針)

Simplified Chinese | 简体中文 Traditional Chinese(Taiwan) | 正體中文(臺灣) Traditional Chinese(Hong Kong) | 正體中文(香港) Japanese | 日本語 ?? X Prober This is a probe

Km.Van 1.2k Dec 28, 2022
PHP Text Analysis is a library for performing Information Retrieval (IR) and Natural Language Processing (NLP) tasks using the PHP language

php-text-analysis PHP Text Analysis is a library for performing Information Retrieval (IR) and Natural Language Processing (NLP) tasks using the PHP l

null 464 Dec 28, 2022
PHP generics written in PHP

PHP generics written in PHP Require PHP >= 7.4 Composer (PSR-4 Autoload) Table of contents How it works Quick start Example Features Tests How it work

Anton Sukhachev 173 Dec 30, 2022
PHP exercises from my course at ETEC and some of my own play-around with PHP

etec-php-exercises PHP exercises from my course at ETEC and some of my own play-around with PHP Translations: Português (BR) Projects Project Descript

Luis Felipe Santos do Nascimento 6 May 3, 2022
GitHub action to set up PHP with extensions, php.ini configuration, coverage drivers, and various tools.

GitHub action to set up PHP with extensions, php.ini configuration, coverage drivers, and various tools.

Shivam Mathur 2.4k Jan 6, 2023
php-echarts is a php library for the echarts 5.0.

php-echarts 一款支持Apache EChart5.0+图表的php开发库 优先ThinkPHP5/6的开发及测试。 Apache EChart5.0已经最新发布,在视觉效果、动画效果和大数据展示方面已经远超之前的版本; 故不考虑EChart5.0之前版本的兼容问题;建议直接尝试5.0+

youyiio 5 Aug 15, 2022
Minimalist PHP frame for Core-Library, for Developing PHP application that gives you the full control of your application.

LazyPHP lightweight Pre-Made Frame for Core-library Install Run the below command in your terminal $ composer create-project ryzen/lazyphp my-first-pr

Ry-Zen 7 Aug 21, 2022
Zilliqa PHP is a typed PHP-7.1+ interface to Zilliqa JSON-RPC API.

Zilliqa PHP is a typed PHP-7.1+ interface to Zilliqa JSON-RPC API. Check out the latest API documentation. Add library in a composer.json file.

Patrick Falize 6 Oct 7, 2021
churn-php is a package that helps you identify php files in your project that could be good candidates for refactoring

churn-php Helps discover good candidates for refactoring. Table of Contents What Is it? Compatibility How to Install? How to Use? How to Configure? Si

Bill Mitchell 1.3k Dec 22, 2022
Run your WP site on github pages, php innovation award winner https://www.phpclasses.org/package/12091-PHP-Make-a-WordPress-site-run-on-GitHub-pages.html

Gitpress Run wordpress directly on github pages Gitpress won the innovation award for may 2021 Read more about this https://naveen17797.github.io/gitp

naveen 13 Nov 18, 2022
A pure PHP implementation of the MessagePack serialization format / msgpack.org[PHP]

msgpack.php A pure PHP implementation of the MessagePack serialization format. Features Fully compliant with the latest MessagePack specification, inc

Eugene Leonovich 368 Dec 19, 2022
SublimeLinter 3 plugin for PHP, using php -l.

SublimeLinter-php This linter plugin for SublimeLinter provides an interface to php -l. It will be used with files that have the "PHP", "HTML", or "HT

null 205 Jan 4, 2023