knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-"
)

tensorr: sparse tensors in R

CRAN_Status_Badge Build Status AppVeyor Build Status Coverage Status

tensorr provides methods to manipulate and store sparse tensors. Tensors are multi-dimensional generalizations of matrices (two dimensional) and vectors (one dimensional).

It has three main goals:

Installation

The development version of tensorr is available on github.

devtools::install_github("zamorarr/tensorr")

Usage

See the introduction vignette for a comprehensive overview. To create a sparse tensor you have to provide the non-zero values, subscripts to the non-zero values, and the overall dimensions of the tensor.

library(tensorr)

subs <- list(c(1,1,1), c(1,1,2))
vals <- c(10, 20)
dims <- c(2,2,2)
x <- sptensor(subs, vals, dims)
x

Tensor References

Many of the dense and sparse implementation ideas were adpated from:

For a review on tensors, see:



zamorarr/tensorr documentation built on May 4, 2019, 9:08 p.m.