Liking cljdoc? Tell your friends :D

provisdom.math.tensor


===clj

(=== tensor)
(=== tensor1 tensor2)
(=== tensor1 tensor2 & more)

Tensor equality that works with NaN.

Tensor equality that works with NaN.
sourceraw docstring

addclj

(add)
(add tensor)
(add tensor1 tensor2)
(add tensor1 tensor2 & more)

Performs element-wise addition for one or more tensors.

Performs element-wise addition for one or more tensors.
sourceraw docstring

averageclj

(average tensor)

The average of the values of the elements.

The average of the values of the elements.
sourceraw docstring

compute-tensorclj

(compute-tensor shape indices->number)

indices->number is a function that takes a vector of indices and returns a number.

`indices->number` is a function that takes a vector of `indices` and returns
a number.
sourceraw docstring

divideclj

(divide)
(divide tensor)
(divide tensor & more)

Performs element-wise division for one or more tensors.

Performs element-wise division for one or more tensors.
sourceraw docstring

ecountclj

(ecount tensor)

Returns the total count of elements.

Returns the total count of elements.
sourceraw docstring

emapclj

(emap f tensor)
(emap f tensor1 tensor2)
(emap f tensor1 tensor2 tensor3)
(emap f tensor1 tensor2 tensor3 & more)

Element-wise mapping over all elements of one or more tensors. Returns nil if tensors can't be expanded as necessary.

Element-wise mapping over all elements of one or more tensors. Returns nil if
tensors can't be expanded as necessary.
sourceraw docstring

emap-kvclj

(emap-kv f tensor)
(emap-kv f tensor1 tensor2)
(emap-kv f tensor1 tensor2 tensor3)
(emap-kv f tensor1 tensor2 tensor3 & more)

Element-wise mapping over all elements of one or more tensors. Function f takes the indices and one number per tensor, and returns a number.

Element-wise mapping over all elements of one or more tensors. Function `f`
takes the indices and one number per tensor, and returns a number.
sourceraw docstring

every-kv?clj

(every-kv? indices+number->bool tensor)

Returns true if function indices+number->bool is true for every element in tensor, else false.

Returns true if function `indices+number->bool` is true for every element in
`tensor`, else false.
sourceraw docstring

fill-tensorclj

(fill-tensor shape numbers)

Creates a new tensor with a given shape from a sequence of numbers. If numbers doesn't fill tensor, will fill remaining elements with 0.0.

Creates a new tensor with a given `shape` from a sequence of `numbers`.
If `numbers` doesn't fill tensor, will fill remaining elements with 0.0.
sourceraw docstring

filter-kvclj

(filter-kv index+tensor->bool tensor-v)

Returns a vector of tensors of the tensors in tensor-v for which function index+tensor->bool returns true. index+tensor->bool must be free of side-effects.

Returns a vector of tensors of the tensors in `tensor-v` for which function
`index+tensor->bool` returns true. `index+tensor->bool` must be free of
side-effects.
sourceraw docstring

first-numberclj

(first-number tensor)

Returns the first number in the tensor.

Returns the first number in the tensor.
sourceraw docstring

inner-productclj

(inner-product tensor1 tensor2)

The inner product is the generalization of the [[dot-product]]. It is the tensor sum of the tensor products of the corresponding entries of two tensors. The count of both tensors must be the same.

The inner product is the generalization of the [[dot-product]]. It is the
tensor sum of the tensor products of the corresponding entries of two tensors.
The count of both tensors must be the same.
sourceraw docstring

mdlclj

source

multiplyclj

(multiply)
(multiply tensor)
(multiply tensor1 tensor2)
(multiply tensor1 tensor2 & more)

Performs element-wise multiplication for one or more tensors.

Performs element-wise multiplication for one or more tensors.
sourceraw docstring

normclj

(norm tensor)

The square-root of the sum of the squared values of the elements.

The square-root of the sum of the squared values of the elements.
sourceraw docstring

norm-pclj

(norm-p tensor p)

The 1/p power of the sum of the element values to the power p. To be a norm, p must be <= 1.0.

The 1/`p` power of the sum of the element values to the power `p`. To be a
norm, `p` must be <= 1.0.
sourceraw docstring

norm1clj

(norm1 tensor)

The sum of the absolute values of the elements.

The sum of the absolute values of the elements.
sourceraw docstring

norm2clj

See norm

See [[norm]]
sourceraw docstring

normalizeclj

(normalize tensor)

Returns as length one in norm2.

Returns as length one in [[norm2]].
sourceraw docstring

normalize-pclj

(normalize-p tensor p)

Returns as length one in norm-p. To be a norm, p must be <= 1.0.

Returns as length one in [[norm-p]]. To be a norm, `p` must be <= 1.0.
sourceraw docstring

normalize1clj

(normalize1 tensor)

Returns as length one in norm1.

Returns as length one in [[norm1]].
sourceraw docstring

normalize2clj

See [[normalize2]]
sourceraw docstring

partition-recursivelyclj

(partition-recursively n tensor)

Partitions recursively in sets of 'n' elements. There may be unused elements. For example, a 1000-element tensor could be partitioned into 10x10x10.

Partitions recursively in sets of 'n' elements. There may be unused elements.
For example, a 1000-element tensor could be partitioned into 10x10x10.
sourceraw docstring

rankclj

(rank tensor)

Returns the rank of a tensor. The rank is equal to the number of dimensions in the tensor's shape.

Returns the rank of a `tensor`. The rank is equal to the number of dimensions
in the `tensor`'s shape.
sourceraw docstring

repeat-tensorclj

(repeat-tensor shape)
(repeat-tensor shape seed-tensor)

Constructs a new tensor of zeros (doubles) with the given shape, or constructs a new tensor with a new shape that is the concat of shape and the shape of the seed-tensor by placing copies of seed-tensor into shape.

Constructs a new tensor of zeros (doubles) with the given `shape`, or
constructs a new tensor with a new shape that is the concat of `shape` and the
shape of the `seed-tensor` by placing copies of `seed-tensor` into `shape`.
sourceraw docstring

rnd-tensor!clj

(rnd-tensor! shape)

Creates a new tensor with a given shape with random doubles.

Creates a new tensor with a given `shape` with random doubles.
sourceraw docstring

roughly-distinctclj

(roughly-distinct tensor accu)

Returns a tensor with later duplicate top-level rows (or elements) removed.

Returns a tensor with later duplicate top-level rows (or elements) removed.
sourceraw docstring

roughly?clj

(roughly? tensor1 tensor2 accu)

Returns true if every element compared across two similarly-shaped tensors are within accu of each other.

Returns true if every element compared across two similarly-shaped tensors
are within `accu` of each other.
sourceraw docstring

shapeclj

(shape tensor)

Returns the shape of the tensor.

Returns the shape of the `tensor`.
sourceraw docstring

subtractclj

(subtract)
(subtract tensor)
(subtract tensor1 tensor2)
(subtract tensor1 tensor2 & more)

Performs element-wise subtraction for one or more tensors.

Performs element-wise subtraction for one or more tensors.
sourceraw docstring

tensor?clj

(tensor? x)

Returns true if a tensor (contains numbers only, and each dimension has rows of equal lengths).

Returns true if a tensor (contains numbers only, and each dimension has rows
of equal lengths).
sourceraw docstring

to-tensorclj

(to-tensor x)

Tries to convert any x to tensor, otherwise returns nil.

Tries to convert any `x` to tensor, otherwise returns nil.
sourceraw docstring

transposeclj

source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close