Copyright | (c) Sam Stites 2017 |
---|---|
License | BSD3 |
Maintainer | sam@stites.io |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Element-wise functions.
Synopsis
- cross :: Dynamic -> Dynamic -> Word -> Dynamic
- sign_ :: Dynamic -> IO ()
- sign :: Dynamic -> Dynamic
- clamp_ :: Dynamic -> HsReal -> HsReal -> IO ()
- clamp :: Dynamic -> HsReal -> HsReal -> Dynamic
- cadd_ :: Dynamic -> HsReal -> Dynamic -> IO ()
- cadd :: Dynamic -> HsReal -> Dynamic -> Dynamic
- (^+^) :: Dynamic -> Dynamic -> Dynamic
- csub_ :: Dynamic -> HsReal -> Dynamic -> IO ()
- csub :: Dynamic -> HsReal -> Dynamic -> Dynamic
- (^-^) :: Dynamic -> Dynamic -> Dynamic
- cmul_ :: Dynamic -> Dynamic -> IO ()
- cmul :: Dynamic -> Dynamic -> Dynamic
- (^*^) :: Dynamic -> Dynamic -> Dynamic
- square :: Dynamic -> Dynamic
- cdiv_ :: Dynamic -> Dynamic -> IO ()
- cdiv :: Dynamic -> Dynamic -> Dynamic
- (^/^) :: Dynamic -> Dynamic -> Dynamic
- cpow_ :: Dynamic -> Dynamic -> IO ()
- cpow :: Dynamic -> Dynamic -> Dynamic
- clshift_ :: Dynamic -> Dynamic -> IO ()
- clshift :: Dynamic -> Dynamic -> Dynamic
- crshift_ :: Dynamic -> Dynamic -> IO ()
- crshift :: Dynamic -> Dynamic -> Dynamic
- cfmod_ :: Dynamic -> Dynamic -> IO ()
- cfmod :: Dynamic -> Dynamic -> Dynamic
- cremainder_ :: Dynamic -> Dynamic -> IO ()
- cremainder :: Dynamic -> Dynamic -> Dynamic
- cmax_ :: Dynamic -> Dynamic -> IO ()
- cmax :: Dynamic -> Dynamic -> Dynamic
- cmin_ :: Dynamic -> Dynamic -> IO ()
- cmin :: Dynamic -> Dynamic -> Dynamic
- cmaxValue_ :: Dynamic -> HsReal -> IO ()
- cmaxValue :: Dynamic -> HsReal -> Dynamic
- cminValue_ :: Dynamic -> HsReal -> IO ()
- cminValue :: Dynamic -> HsReal -> Dynamic
- cbitand_ :: Dynamic -> Dynamic -> IO ()
- cbitand :: Dynamic -> Dynamic -> Dynamic
- cbitor_ :: Dynamic -> Dynamic -> IO ()
- cbitor :: Dynamic -> Dynamic -> Dynamic
- cbitxor_ :: Dynamic -> Dynamic -> IO ()
- cbitxor :: Dynamic -> Dynamic -> Dynamic
- addcmul_ :: Dynamic -> HsReal -> Dynamic -> Dynamic -> IO ()
- addcmul :: Dynamic -> HsReal -> Dynamic -> Dynamic -> Dynamic
- addcdiv_ :: Dynamic -> HsReal -> Dynamic -> Dynamic -> IO ()
- addcdiv :: Dynamic -> HsReal -> Dynamic -> Dynamic -> Dynamic
Documentation
:: Dynamic | tensor a |
-> Dynamic | tensor b (same size as tensor a in dimension below) |
-> Word | dimension to operate over |
-> Dynamic | new return tensor |
returns the cross product of vectors in the specified dimension
a and b must have the same size, and both a:size(n)
and b:size(n)
must be 3.
sign_ :: Dynamic -> IO () Source #
Replaces all elements in-place with the sign of the elements of the tensor.
sign :: Dynamic -> Dynamic Source #
Returns a new Tensor with the sign (+/- 1) of the elements of a tensor
clamp_ :: Dynamic -> HsReal -> HsReal -> IO () Source #
Clamp all elements, inplace, in the tensor into the range [min_value, max_value]
. ie:
{ min_value, if x_i < min_value y_i = { x_i, if min_value ≤ x_i ≤ max_value { max_value, if x_i > max_value
clamp :: Dynamic -> HsReal -> HsReal -> Dynamic Source #
pure version of clamp_
returning a new tensor as output.
Multiply elements of tensor2 by the scalar value and add it to tensor1. The number of elements must match, but sizes do not matter.
Stores the result in tensor1.
Multiply elements of tensor2 by the scalar value and add it to tensor1. The number of elements must match, but sizes do not matter.
Multiply elements of tensor2 by the scalar value and subtract it from tensor1. The number of elements must match, but sizes do not matter.
Stores the result in tensor1.
Multiply elements of tensor2 by the scalar value and subtract it from tensor1. The number of elements must match, but sizes do not matter.
Performs the element-wise multiplication of tensor1 by tensor2. The number of elements must match, but sizes do not matter.
Stores the result in tensor1.
Performs the element-wise multiplication of tensor1 by tensor2. The number of elements must match, but sizes do not matter.
square :: Dynamic -> Dynamic Source #
square a tensor.
FIXME: this is a call to cmul
but it might be better to use pow
Performs the element-wise division of tensor1 by tensor2. The number of elements must match, but sizes do not matter.
Stores the result in tensor1.
Performs the element-wise division of tensor1 by tensor2. The number of elements must match, but sizes do not matter.
Element-wise power operation, taking the elements of tensor1 to the powers given by elements of tensor2. The number of elements must match, but sizes do not matter.
Stores the result in tensor1.
Element-wise power operation, taking the elements of tensor1 to the powers given by elements of tensor2. The number of elements must match, but sizes do not matter.
clshift_ :: Dynamic -> Dynamic -> IO () Source #
Element-wise, inplace, bitwise left shift. Mutates the first argument.
crshift_ :: Dynamic -> Dynamic -> IO () Source #
Element-wise, inplace, bitwise right shift. Mutates the first argument.
Computes the element-wise remainder of the division (rounded towards zero) of tensor1 by tensor2. The number of elements must match, but sizes do not matter.
Stores the result in tensor1.
Computes the element-wise remainder of the division (rounded towards zero) of tensor1 by tensor2. The number of elements must match, but sizes do not matter.
Computes element-wise remainder of the division (rounded to nearest) of tensor1 by tensor2. The number of elements must match, but sizes do not matter.
Stores the result in tensor1.
Computes element-wise remainder of the division (rounded to nearest) of tensor1 by tensor2. The number of elements must match, but sizes do not matter.
cmax_ :: Dynamic -> Dynamic -> IO () Source #
Element-wise, inplace, max function -- storing the higher value. Mutates the first argument.
cmax :: Dynamic -> Dynamic -> Dynamic Source #
Element-wise max function -- keeping the higher value.
cmin_ :: Dynamic -> Dynamic -> IO () Source #
Element-wise, inplace, min function -- storing the lower value. Mutates the first argument.
cmaxValue_ :: Dynamic -> HsReal -> IO () Source #
Store the maximum of the tensor and a scalar in the input tensor on an element-by-element basis.
cmaxValue :: Dynamic -> HsReal -> Dynamic Source #
Store the maximum of the tensor and a scalar in a new tensor on an element-by-element basis.
cminValue_ :: Dynamic -> HsReal -> IO () Source #
Store the minimum of the tensor and a scalar in the input tensor on an element-by-element basis.
cminValue :: Dynamic -> HsReal -> Dynamic Source #
Store the minimum of the tensor and a scalar in a new tensor on an element-by-element basis.
cbitand_ :: Dynamic -> Dynamic -> IO () Source #
Element-wise, inplace, bitwise and
. Mutates the first argument.
cbitor_ :: Dynamic -> Dynamic -> IO () Source #
Element-wise, inplace, bitwise or
. Mutates the first argument.
cbitxor_ :: Dynamic -> Dynamic -> IO () Source #
Element-wise, inplace, bitwise xor
. Mutates the first argument.
Performs the element-wise multiplication of tensor1 by tensor2, multiplies the result by the scalar value and adds it to tensor0, which it mutates inplace.
The number of elements must match, but sizes do not matter.
Performs the element-wise multiplication of tensor1 by tensor2, multiplies the result by the scalar value and adds it to tensor0.
The number of elements must match, but sizes do not matter.
Performs the element-wise multiplication of tensor1 by tensor2, multiplies the result by the scalar value and adds it to tensor0, which it mutates inplace.
The number of elements must match, but sizes do not matter.