(=== tensor)
(=== tensor1 tensor2)
(=== tensor1 tensor2 & more)
Tensor equality that works with NaN.
Tensor equality that works with NaN.
(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.
(average tensor)
The average of the values of the elements.
The average of the values of the elements.
(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.
(divide)
(divide tensor)
(divide tensor & more)
Performs element-wise division for one or more tensors.
Performs element-wise division for one or more tensors.
(ecount tensor)
Returns the total count of elements.
Returns the total count of elements.
(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.
(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.
(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.
(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.
(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.
(first-number tensor)
Returns the first number in the tensor.
Returns the first number in the tensor.
(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.
(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.
(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.
(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.
(norm1 tensor)
The sum of the absolute values of the elements.
The sum of the absolute values of the elements.
(normalize tensor)
Returns as length one in norm2
.
Returns as length one in [[norm2]].
(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.
(normalize1 tensor)
Returns as length one in norm1
.
Returns as length one in [[norm1]].
(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.
(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.
(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`.
(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.
(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.
(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.
(shape tensor)
Returns the shape of the tensor
.
Returns the shape of the `tensor`.
(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.
(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).
(to-tensor x)
Tries to convert any x
to tensor, otherwise returns nil.
Tries to convert any `x` to tensor, otherwise returns nil.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close