Crate gradients

Source

Modules§

devices
This module defines all available compute devices
nn
number
purpur
raw_ops
raw_prelude

Macros§

get_device
Return a device that implements the trait provided thus giving access to the functions implemented by the trait.

Structs§

Adam
Buffer
The underlying non-growable array structure. A Buffer may be encapsulated in other structs.
CLDevice
Used to perform calculations with an OpenCL capable device. To make new calculations invocable, a trait providing new operations should be implemented for CLDevice.
CPU
A CPU is used to perform calculations on the host CPU. To make new operations invocable, a trait providing new functions should be implemented for CPU.
Cache
Caches pointers that can be reconstructed into a Buffer.
CacheTrace
CachedLeaf
Count
used to reset the cache count
CountIntoIter
CudaDevice
Used to perform calculations with a CUDA capable device. To make new calculations invocable, a trait providing new operations should be implemented for CudaDevice.
Device
Device is another representation of a compute device.
It stores the type of the device and a pointer to the device from which Device originates from.
This is used instead of another “device” generic for Buffer.
Error
Graph
Ident
An Ident is used to identify a cached pointer.
InternCLDevice
Internal representation of an OpenCL Device with the capability of storing pointers.
KernelBlock
Linear
LinearReg
Matrix
A matrix using Buffer described with rows and columns
Node
Param
PolynomialReg
ReLU
SGD
Softmax
Tanh

Enums§

BufFlag
Descripes the type of a Buffer
DeviceError
DeviceType
Used to determine which device type Device is of.

Constants§

COUNT
GLOBAL_CPU

Traits§

AdamOp
AddGraph
AdditionalOps
Alloc
This trait is for allocating memory on the implemented device.
AsDev
This trait is a non-generic variant for calling Alloc’s Alloc::<T>::as_dev(..)
AsRangeArg
AssignOps
Assignment operations
BaseOps
Element-wise +, -, *, / operations for matrices.
CDatatype
enables easy generic kernel creation
CacheBuf
This trait is used to retrieve a cached buffer from a specific device type.
ClearBuf
Trait for implementing the clear() operation for the compute devices.
ClipOp
CloneBuf
This trait is used to clone a buffer based on a specific device type.
ColOp
CudaTranspose
DiagflatOp
FnsOps
Gemm
Matrix multiplication. Uses provided device.
GenericBlas
GetParam
GraphReturn
MaxOps
NeuralNetwork
OneHotMat
OnehotOp
RandBuf
RandOp
RowOp
SGDOp
ScalarAssign
SumOps
TransposeOp
VecRead
Trait for reading buffers.
WithDevice
WriteBuf
Trait for writing data to buffers.

Functions§

add_full_padding
assign_to_lhs
assign_to_lhs_scalar
bump_count
Increases the cache identifier / index by 1.
cached
Adds a Buffer to the “cache chain”. Following calls will return this Buffer, if the corresponding internal count matches with the id used in the cache.
cl_assign_scalar
cl_diagflat
cl_gemm
OpenCL matrix multiplication of two buffers / matrices.
cl_scalar_op
cl_scalar_op_mat
cl_str_op
cl_str_op_mat
cl_tew
Element-wise operations. The op/operation is usually “+”, “-”, “*”, “/”. “tensor element-wise”
cl_tew_self
Element-wise “assign” operations. The op/operation is usually “+”, “-”, “*”, “/”.
cl_to_cpu_lr
OpenCL
cl_to_cpu_s
OpenCL
cl_transpose
cl_write
col_op
correct_classes
correlate_valid_mut
cpu_exec
Compute operations on the CPU even though the matrix was created with an OpenCL device. There were some optimizations implemented regarding unified memory architectures.
cpu_exec_lhs_rhs
cpu_exec_lhs_rhs_mut
cpu_exec_mut
cpu_exec_scalar
create_line
create_sine
cu_assign_scalar
cu_clip
cu_ew
Element-wise operations. The op/operation is usually “+”, “-”, “*”, “/”.
cu_ew_self
Element-wise “assign” operations. The op/operation is usually “+”, “-”, “*”, “/”.
cu_scalar_op
cu_str_op
cu_to_cpu_lr
cu_to_cpu_lr_mut
cu_to_cpu_s
cu_to_cpu_s_mut
cu_to_cpu_scalar
diagflat
each_op
element_wise_op
element_wise_op_mut
ew_op
find_idxs
get_count
Returns current cache identifier / index
rand_slice
range
inclusive range used to reset the cache count in loops as every operation increases the cache count, which would break the “cache cycle” if the cache count would not be reset.
remove_value
rot_kernel
row_op
row_op_slice_lhs
row_op_slice_mut
scalar_apply
scalar_apply_slice
set_count
Sets current cache identifier / index. This function is usually called after an iteration in a loop -> Count or range
slice_transpose

Type Aliases§

CUdeviceptr
Result

Attribute Macros§

network

Derive Macros§

NeuralNetwork
NoParams