• Stars
    star
    228
  • Rank 175,267 (Top 4 %)
  • Language
    PHP
  • License
    MIT License
  • Created about 6 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

Tensor: Scientific Computing for PHP

PHP from Packagist Latest Stable Version Code Checks 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

Contributing

See CONTRIBUTING.md for guidelines.

License

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

More Repositories

1

ML

A high-level machine learning and deep learning library for the PHP language.
PHP
2,024
star
2

Sentiment

An example project using a feed-forward neural network for text sentiment classification trained with 25,000 movie reviews from the IMDB website.
PHP
104
star
3

Server

A standalone inference server for trained Rubix ML estimators.
PHP
62
star
4

CIFAR-10

Use the famous CIFAR-10 dataset to train a multi-layer neural network to recognize images of cats, dogs, and other things.
PHP
57
star
5

Housing

An example project that predicts house prices for a Kaggle competition using a Gradient Boosted Machine.
PHP
47
star
6

MNIST

Handwritten digit recognizer using a feed-forward neural network and the MNIST dataset of 70,000 human-labeled handwritten digits.
PHP
35
star
7

Iris

The original lightweight introduction to machine learning in Rubix ML using the famous Iris dataset and the K Nearest Neighbors classifier.
PHP
31
star
8

Credit

An example project that predicts risk of credit card default using a Logistic Regression classifier and a 30,000 sample dataset.
PHP
29
star
9

HAR

Recognize one of six human activities such as standing, sitting, and walking using a Softmax Classifier trained on mobile phone sensor data.
PHP
22
star
10

Colors

Demonstrating unsupervised clustering using the K Means algorithm and synthetic color data.
PHP
15
star
11

Dota2

Build a classifier to predict the outcome of Dota 2 games with the Naive Bayes algorithm and results from 102,944 sample games.
PHP
14
star
12

Divorce

Use the K Nearest Neighbors algorithm to predict the probability of a divorce with high accuracy.
PHP
13
star
13

Extras

Experimental features for the Rubix ML library.
PHP
10
star
14

Churn

Detect unhappy customers with Naive Bayes and 19 categorical features.
PHP
10
star
15

DNA

An example project demonstrating the use of machine learning to identify microbe taxonomies from their DNA sequences.
PHP
6
star
16

DL

A deep learning library for PHP powered by TensorFlow.
C
3
star
17

Client

Client-side SDK for Rubix ML Server to use in your PHP applications.
PHP
3
star
18

Signatures

Digital signatures made by humans.
2
star