loredart_nn
library
Functions
abs (Tensor x )
→ Tensor
Computes absolute value of x element-wise.
acos (Tensor x )
→ Tensor
Computes arc cosine of x element-wise.
apply (Tensor x , num func (num ), {DType ? dType })
→ Tensor
Applies func on x element-wise.
argMax (Tensor x , {int axis = 0 , DType dType = DType.int32 })
→ Tensor
Returns the indices with the largest elements across the dimension given in the axis of a tensor x.
asin (Tensor x )
→ Tensor
Computes arc sine of x element-wise.
atan (Tensor x )
→ Tensor
Computes arc tan of x element-wise.
avgPool1D (Tensor input , int kSize , {List <int > strides = const [1, 1, 1] , Padding padding = Padding.valid })
→ Tensor
Performs 1D averaging pooling of 3D input across spatial dim with window of size kSize.
avgPool2D (Tensor input , List <int > kSize , {List <int > strides = const [1, 1, 1, 1] , Padding padding = Padding.valid })
→ Tensor
Performs 2D averaging pooling of 4D input across spatial dims with window of size kSize.
binaryCrossentropy (Tensor yTrue , Tensor yPred , {List <int > axis = const [-1] , double epsilon = 1e-7 })
→ Tensor
Computes the binary crossentropy between equal-shaped Tensors yTrue and yPred along given axis.
cast (Tensor x , DType dType )
→ Tensor
Casts x to a dType.
clipByValue (Tensor x , dynamic minValue , dynamic maxValue )
→ Tensor
Clips x to a specific minValue and maxValue.
concat (List <Tensor > tensors , {int axis = -1 })
→ Tensor
Concatenates Tensor s from tensors along one given axis.
conv1D (Tensor input , Tensor filter , {List <int > strides = const [1, 1, 1] , Padding padding = Padding.valid })
→ Tensor
Computes a 1D convolution of given 3D input with 3D filter.
conv2D (Tensor input , Tensor filter , {List <int > strides = const [1, 1, 1, 1] , Padding padding = Padding.valid })
→ Tensor
Computes a 2D convolution of given 4D input with 4D filter.
cos (Tensor x )
→ Tensor
Computes cosine of x element-wise.
cosh (Tensor x )
→ Tensor
Computes hyperbolic cosine of x element-wise.
crossEntropy (Tensor yTrue , Tensor yPred , {List <int > axis = const [-1] , double epsilon = 1e-7 })
→ Tensor
Computes the crossentropy between equal-shaped Tensors yTrue and yPred along given axis.
dropout (Tensor x , double rate , {List <int > ? noiseShape , int ? seed })
→ Tensor
Computes the dropout of x, i.e., with probability rate set each element to zero.
Remaining non-dropped elements are scaled by 1/(1-rate) to preserve the mean.
dropoutWithMask (Tensor x , double rate , {List <int > ? noiseShape , int ? seed })
→ List <Tensor >
Computes the dropout of x and additionally returns dropout mask.
For explanation see dropout function.
elu (Tensor x , double alpha )
→ Tensor
Applies the ELU activation function (with alpha) to the elements of x.
emptyBuffer (DType dType , int length )
→ List
Returns an empty buffer list of the given length according to the dType.
equal (Tensor x , dynamic y )
→ Tensor
Returns the "truth" value of x == y element-wise, represented as 1 for true and 0 for false.
exp (Tensor x )
→ Tensor
Computes exponent of x element-wise.
expandDims (Tensor x , int axis )
→ Tensor
Adds extra dim of length 1 into x at index axis.
expm1 (Tensor x )
→ Tensor
Computes e^x-1 element-wise.
greater (Tensor x , dynamic y )
→ Tensor
Returns the "truth" value of x > y element-wise, represented as 1 for true and 0 for false.
greaterEqual (Tensor x , dynamic y )
→ Tensor
Returns the "truth" value of x >= y element-wise, represented as 1 for true and 0 for false.
klDivergence (Tensor yTrue , Tensor yPred , {List <int > axis = const [-1] , double epsilon = 1e-7 })
→ Tensor
Computes the Kullback-Leibler divergence between equal-shaped Tensors yTrue and yPred along given axis.
leakyReLU (Tensor x , double alpha )
→ Tensor
Applies the LeakyReLU activation function (with alpha) to the elements of x.
less (Tensor x , dynamic y )
→ Tensor
Returns the "truth" value of x < y element-wise, represented as 1 for true and 0 for false.
lessEqual (Tensor x , dynamic y )
→ Tensor
Returns the "truth" value of x <= y element-wise, represented as 1 for true and 0 for false.
log (Tensor x )
→ Tensor
Computes the natural logarithm of x element-wise.
log1p (Tensor x )
→ Tensor
Computes the natural logarithm of (1+x) element-wise.
log2 (Tensor x )
→ Tensor
Computes the binary logarithm of x element-wise.
logCosh (Tensor yTrue , Tensor yPred , {List <int > axis = const [-1] })
→ Tensor
Computes the logarithm of the hyperbolic cosine of differences between equal-shaped Tensors yTrue and yPred along given axis.
matmul (Tensor a , Tensor b , {bool transposeA = false , bool transposeB = false })
→ Tensor
Multiplies matrix a by matrix b.
matrixTranspose (Tensor x )
→ Tensor
Transposes last two dimensions of x.
max (Tensor x , Tensor y )
→ Tensor
Computes max of x and y element-wise.
maximum (Tensor x )
→ Tensor
Computes max of x.
maxPool1D (Tensor input , int kSize , {List <int > strides = const [1, 1, 1] , Padding padding = Padding.valid })
→ Tensor
Performs 1D max pooling of 3D input across spatial dim with window of size kSize.
maxPool2D (Tensor input , List <int > kSize , {List <int > strides = const [1, 1, 1, 1] , Padding padding = Padding.valid })
→ Tensor
Performs 2D max pooling of 4D input across spatial dims with window of size kSize.
mean (Tensor x , {DType ? dType })
→ Tensor
Computes mean of x.
min (Tensor x , Tensor y )
→ Tensor
Computes min of x and y element-wise.
minimum (Tensor x )
→ Tensor
Computes min of x.
normal (List <int > shape , {num mean = 0.0 , num std = 1.0 , DType dType = DType.float32 , int ? seed })
→ Tensor
Outputs Tensor of given shape with random values from a normal distribution with mean mean and standard deviation std.
notEqual (Tensor x , dynamic y )
→ Tensor
Returns the "truth" value of x <= y element-wise, represented as 1 for true and 0 for false.
oneHotTensor (Tensor indices , {required int depth , num onValue = 1.0 , num offValue = 0.0 , int axis = -1 , DType ? dType })
→ Tensor
Constructs and returns one-hot tensor.
pad (Tensor x , Tensor padding , {num value = 0.0 })
→ Tensor
Pads tensor x with value according to the padding scheme.
pool1D (Tensor input , int kSize , {PoolingType type = PoolingType.max , required List <int > strides , required Padding padding })
→ Tensor
Computes a 1D pooling of given 3D input with 1D window of size kSize.
pool2D (Tensor input , List <int > kSize , {PoolingType type = PoolingType.max , required List <int > strides , required Padding padding })
→ Tensor
Computes a 2D pooling of given 4D input with 2D window of size kSize.
pow (Tensor x , Object exponent )
→ Tensor
Computes x to the power of exponent element-wise.
reduceLocalArgMax (Tensor x , {List <int > ? axis , bool keepDims = false })
→ Tensor
Returns the local indices with the largest elements across dimensions given in the axis of a tensor x.
reduceMax (Tensor x , {List <int > ? axis , bool keepDims = false })
→ Tensor
Computes max of elements across dimensions given in the axis of a tensor x.
reduceMean (Tensor x , {List <int > ? axis , bool keepDims = false , DType ? dType })
→ Tensor
Computes the mean of elements across dimensions given in the axis of a tensor x.
reduceMin (Tensor x , {List <int > ? axis , bool keepDims = false })
→ Tensor
Computes min of elements across dimensions given in the axis of a tensor x.
reduceProd (Tensor x , {List <int > ? axis , bool keepDims = false })
→ Tensor
Computes the product of elements across dimensions given in the axis of a tensor x.
reduceStd (Tensor x , {List <int > ? axis , bool keepDims = false , DType ? dType })
→ Tensor
Computes the standard deviation of elements across dimensions given in the axis of a tensor x.
reduceSum (Tensor x , {List <int > ? axis , bool keepDims = false })
→ Tensor
Computes the sum of elements across dimensions given in the axis of a tensor x.
reduceVariance (Tensor x , {List <int > ? axis , bool keepDims = false , DType ? dType })
→ Tensor
Computes the variance of elements across dimensions given in the axis of a tensor x.
relu (Tensor x )
→ Tensor
Applies the ReLU activation function to the elements of x.
reshape (Tensor x , List <int > shape )
→ Tensor
Reshapes a tensor x with new shape.
sech (Tensor x )
→ Tensor
Computes hyperbolic sec of x element-wise.
sigmoid (Tensor x )
→ Tensor
Computes sigmoid of x element-wise.
sign (Tensor x )
→ Tensor
Computes an element-wise indication of the sign of x.
sin (Tensor x )
→ Tensor
Computes sine of x element-wise.
sinh (Tensor x )
→ Tensor
Computes hyperbolic sine of x element-wise.
slice (Tensor x , List <int > begin , List <int > end )
→ Tensor
Extracts and returns strode slice of the tensor x
from begin (inclusively) to end (exclusively).
softmax (Tensor x , {int axis = -1 , bool ? stable })
→ Tensor
Applies the softmax activation function to the x along axis.
softminus (Tensor x )
→ Tensor
Computes softminus of x element-wise.
softplus (Tensor x )
→ Tensor
Computes softplus of x element-wise.
splitToFeaturesAndTargets (Tensor values , {required List <int > targetIndices , DType ? targetsDType , DType ? featuresDType })
→ (Tensor , Tensor )
Splits input Tensor into two (feature and targets) by columns and optionally casts any of those into specific DType s.
sqrt (Tensor x )
→ Tensor
Computes the positive square of x element-wise.
square (Tensor x )
→ Tensor
Computes square of x element-wise.
squareDifference (Tensor x , Tensor y )
→ Tensor
Computes (x-y)^2 element-wise.
squeeze (Tensor x , {List <int > ? axis })
→ Tensor
Removes dimensions of size 1 from the shape of a x.
tan (Tensor x )
→ Tensor
Computes tan of x element-wise.
tanh (Tensor x )
→ Tensor
Computes hyperbolic tan of x element-wise.
tensorFromBytes (List <int > bytes )
→ Tensor
Constructs a Tensor from bytes.
tensorFromJson (Map <String , dynamic > data )
→ Tensor
Constructs a Tensor from a Map data structure.
tensorToBytes (Tensor tensor )
→ List <int >
Converts tensor into a sequence of raw bytes.
tensorToJson (Tensor tensor )
→ Map <String , dynamic >
Converts tensor into a json-encodable Map.
truncatedNormal (List <int > shape , {num mean = 0.0 , num std = 1.0 , DType dType = DType.float32 , int ? seed })
→ Tensor
Outputs Tensor of given shape with random values from a truncated normal distribution.
uniform (List <int > shape , {num min = 0.0 , num max = 1.0 , DType dType = DType.float32 , int ? seed })
→ Tensor
Outputs Tensor of given shape with random values from a uniform distribution.
variance (Tensor x , {DType ? dType })
→ Tensor
Computes variance of x.
xlog1py (Tensor x , Tensor y )
→ Tensor
Computes x*log(y+1) element-wise.
xlogy (Tensor x , Tensor y )
→ Tensor
Computes x*log(y) element-wise.