MCPcopy Create free account

hub / github.com/TuckerBMorgan/can-t / functions

Functions825 in github.com/TuckerBMorgan/can-t

↓ 2 callersMethodones
Allocates a new tensor with provided shape, all with 1s # Arugments 'shape' - The shape of the allocated tensor
src/central/tensor.rs:214
↓ 2 callersFunctionpreprocess_images
Convert u8 pixel values to normalized f32 tensors
examples/autoencoder.rs:29
↓ 2 callersFunctionpreprocess_labels
Convert digit labels to one-hot encoded vectors
examples/autoencoder.rs:39
↓ 2 callersFunctionread_lines
(filename: &str)
src/lib.rs:142
↓ 2 callersMethodshould_broadcast
(&self, other: Shape)
src/central/shape.rs:373
↓ 2 callersFunctionsoftmax_internal
Internal function for calculation the softmax of a array along a particular axis Breaking it out into its own function, as both the forward and backwa
src/central/softmax_op.rs:9
↓ 2 callersMethodswap_axes
Helper function swap around two axis
src/central/equation.rs:361
↓ 2 callersFunctiontensor_add
Takes two tensors as flat buffers, adds them together at an elementwise level and returns the result # Arguments 'a' : The first vector 'b' : the seco
crates/cant_cpu/src/tensor_add.rs:5
↓ 2 callersFunctiontensor_matmul
( a: &[f32], a_shape: [usize; MAX_DIMS], b: &[f32], b_shape: [usize; MAX_DIMS], )
crates/cant_cpu/src/tensor_matmul.rs:44
↓ 2 callersFunctiontensor_mul
Takes two tensors as flat buffers, multiplies them together at an elementwise level and returns the result # Arguments 'a' : The first vector 'b' : th
crates/cant_cpu/src/tensor_mul.rs:5
↓ 2 callersMethodtopological_sort_util
a util function to preform topological sort on the tensors of the equation for the backward pass # Arugments 'node' - the id of the tensor that is goi
src/central/equation.rs:665
↓ 2 callersMethodzero_grad
Zeroes out the grad, important to call before calling backwards on a value
src/central/equation.rs:723
↓ 1 callersMethodadd_tensors
Takes two tensors as flat buffers, adds them together at an elementwise level and returns the result # Arguments 'a' : The first tensor 'b' : the seco
src/central/equation.rs:189
↓ 1 callersMethodallocate_from_element
Allocates a tensor, and returns the ID of it, so it can be looked up later, will be filled with element # Arguments 'shape' - the shape of the tensor.
src/central/equation.rs:134
↓ 1 callersMethodallocate_ones_tensor
Allocates a tensor, and returns the ID of it, so it can be looked up later, is all ones # Arguments 'shape' - the shape of the tensor. shape.total_siz
src/central/equation.rs:125
↓ 1 callersMethodallocate_random_tesnor
Allocates a tensor with random values # Arguments 'shape' - the shape of desired tensor
src/central/equation.rs:142
↓ 1 callersMethodallocate_tensor_id
Allocated a tensor id, this is unique id for each tensor, used to look in up later
src/central/equation.rs:164
↓ 1 callersFunctionbackward_for_add
Handles calculating and passing back the gradient of an add operation
src/central/add_op.rs:75
↓ 1 callersFunctionbackward_for_chunk
(packet: BackproagationPacket)
src/central/chunk_op.rs:58
↓ 1 callersFunctionbackward_for_clamp
(packet: BackproagationPacket)
src/central/clamp_op.rs:24
↓ 1 callersFunctionbackward_for_cos
Handles calculating and passing back the gradient of a cos operation The derivative of cos(x) is -sin(x)
src/central/cos_op.rs:25
↓ 1 callersFunctionbackward_for_gather
(packet: BackproagationPacket)
src/central/gather_op.rs:55
↓ 1 callersFunctionbackward_for_matmul
(backprop_backet: BackproagationPacket)
src/central/matmul_op.rs:38
↓ 1 callersFunctionbackward_for_mean
Handles calculating and passing back the gradient of a mean operation The gradient is distributed equally among all elements that contributed to the m
src/central/mean_op.rs:58
↓ 1 callersFunctionbackward_for_movedim
(packet: BackproagationPacket)
src/central/movedim_op.rs:46
↓ 1 callersFunctionbackward_for_mul
(backprop_backet: BackproagationPacket)
src/central/mul_op.rs:76
↓ 1 callersFunctionbackward_for_permute
(packet: BackproagationPacket)
src/central/permute.rs:112
↓ 1 callersFunctionbackward_for_pow
(backprop_backet: BackproagationPacket)
src/central/pow_op.rs:18
↓ 1 callersFunctionbackward_for_relu
(backprop_packet: BackproagationPacket)
src/central/relu_op.rs:21
↓ 1 callersFunctionbackward_for_reshape
Handles calculating and passing back the gardient of a reshape operation
src/central/reshape.rs:21
↓ 1 callersFunctionbackward_for_select
Handles calculating and passing back the gradient of a select operation For select operations, gradients are accumulated back to the source tensor at
src/central/select_op.rs:78
↓ 1 callersFunctionbackward_for_sigmoid
Handles calculating and passing back the gradient of a Sigmoid operation The derivative of sigmoid(x) is
src/central/sigmoid_op.rs:27
↓ 1 callersFunctionbackward_for_sin
Handles calculating and passing back the gradient of a sin operation The derivative of sin(x) is cos(x)
src/central/sin_op.rs:25
↓ 1 callersFunctionbackward_for_softmax
Handles calculating and passing back the gradient of a softmax operation The gradient computation involves the Jacobian of softmax For softmax S_i = e
src/central/softmax_op.rs:73
↓ 1 callersFunctionbackward_for_std
(backprop_packet: BackproagationPacket)
src/central/std_op.rs:84
↓ 1 callersFunctionbackward_for_sum
(backprop_backet: BackproagationPacket)
src/central/sum_op.rs:62
↓ 1 callersFunctionbackward_for_tanh
Handles calculating and passing back the gradient of a tanh operation The derivative of tanh(x) is 1 - tanh²(x)
src/central/tanh_op.rs:25
↓ 1 callersFunctionbackward_for_topk
(backprop_backet: BackproagationPacket)
src/central/topk_op.rs:155
↓ 1 callersFunctionbackward_for_unsqueeze
(packet: BackproagationPacket)
src/central/unsqueeze_op.rs:20
↓ 1 callersMethodbackward_for_value
Util function that handles passing back a single value in the equation # Arugments 'incoming_grad' - the tensor that we are passing back
src/central/equation.rs:513
↓ 1 callersFunctionbackwards_for_cat
(packet: BackproagationPacket)
src/central/cat_op.rs:74
↓ 1 callersFunctionbackwards_for_diagonal
(backprop_backet: BackproagationPacket)
src/central/diagonal_op.rs:122
↓ 1 callersFunctionbackwards_for_log
(backprop_packet: BackproagationPacket)
src/central/log.rs:19
↓ 1 callersFunctionbackwards_for_mask_fill
(packet: BackproagationPacket)
src/central/masked_fill.rs:34
↓ 1 callersFunctionbackwards_for_max
(packet: BackproagationPacket)
src/central/max_op.rs:69
↓ 1 callersFunctionbackwards_for_transpose
(packet: BackproagationPacket)
src/central/transpose_op.rs:76
↓ 1 callersMethodbuild_concentration_and_inv_freq
(&self)
src/nn/rotary_embedding.rs:68
↓ 1 callersMethodcan_matmul
Returns if two shapes can be matmuled together This only covers 2x2 cases or lower higher dimenions are considered "batched" matmul # Arguments 'other
src/central/shape.rs:180
↓ 1 callersFunctionclean_up_tensor_store
()
src/central/mod.rs:100
↓ 1 callersMethodclip_grad
(&mut self, max_norm: f32)
src/central/equation.rs:730
↓ 1 callersFunctioncreate_instance
(project, zone, instance_file, credentials_file=None)
utils/launch_nvidia_on_gcp.py:6
↓ 1 callersMethoddependencies
Returns which Tensors created this operation
src/central/tensor.rs:43
↓ 1 callersFunctiondraw_ui
(f: &mut Frame, loss_history: &[(f64, f64)], original_ascii: &str, recon_ascii: &str)
examples/autoencoder.rs:262
↓ 1 callersMethodend_clock_with_name
Ends a clock with a given name, giving it an offical length
src/utils/timing.rs:23
↓ 1 callersMethodend_timer
util function to end a time with a provided name # Aruguments 'name': the name of the timer
src/central/equation.rs:181
↓ 1 callersFunctionextract_batch
Extract batch from tensor by copying rows
examples/autoencoder.rs:51
↓ 1 callersMethodforward
(&mut self, input: Tensor)
src/optimizers/stochastic_gradient_descent.rs:78
↓ 1 callersMethodforward
(&mut self, input: Tensor)
src/optimizers/adamw.rs:147
↓ 1 callersMethodforward
(&mut self, input: Tensor)
src/optimizers/adam.rs:138
↓ 1 callersMethodforward
(&mut self, input: Tensor)
examples/autoencoder.rs:124
↓ 1 callersMethodget_item
(&self, index: usize)
src/utils/data_set.rs:47
↓ 1 callersMethodget_parameters
(&self)
src/nn/embedding.rs:28
↓ 1 callersMethodget_parameters
(&self)
src/nn/layer_norm.rs:72
↓ 1 callersMethodget_parameters
(&self)
src/nn/rmsnorm.rs:42
↓ 1 callersMethodget_parameters
(&mut self, model: &mut dyn Model)
src/optimizers/stochastic_gradient_descent.rs:31
↓ 1 callersMethodget_parameters
(&mut self, model: &mut dyn Model)
src/optimizers/adamw.rs:43
↓ 1 callersMethodget_parameters
(&mut self, model: &mut dyn Model)
src/optimizers/adam.rs:43
↓ 1 callersMethodget_random_batch
(&self, batch_size: usize)
src/utils/data_loader.rs:17
↓ 1 callersMethodget_tensor_dims
(&self, name: impl AsRef<str>)
src/utils/gguf.rs:40
↓ 1 callersMethodget_weight_for_tensor
(&self, name: impl AsRef<str>)
src/utils/gguf.rs:50
↓ 1 callersFunctionlerp_array
(start: f32, end: f32, steps: usize)
src/nn/sequential.rs:267
↓ 1 callersFunctionlerp_array
(start: f32, end: f32, steps: usize)
examples/autoencoder.rs:200
↓ 1 callersFunctionload_mnist_data
Helper function to load and preprocess MNIST data
examples/autoencoder.rs:84
↓ 1 callersFunctionloop_count
(shape: [usize; MAX_DIMS])
crates/cant_cpu/src/tensor_matmul.rs:39
↓ 1 callersFunctionloop_count
(shape: [usize; MAX_DIMS])
crates/cant_cuda/src/tensor_matmul.rs:42
↓ 1 callersFunctionloop_count
(shape: [usize; MAX_DIMS])
crates/cant_metal/src/tensor_matmul.rs:43
↓ 1 callersMethodmatmul_tensor
Takes two tensors are flat buffers and preforms matmul on them and returns the result # Arugments 'a' - the first tensor 'b' - The seconf tensor
src/central/equation.rs:203
↓ 1 callersMethodmul_tensors
Takes two tensors as flat buffers, multiplies them together at an elementwise level and returns the result # Arguments 'a' : The first tensor 'b' : th
src/central/equation.rs:295
↓ 1 callersMethodnumber_of_samples
(&self)
src/utils/data_loader.rs:38
↓ 1 callersMethodpartial_cmp
(&self, other: &Self)
src/central/topk_op.rs:25
↓ 1 callersFunctionproduct
(slice: &[usize])
crates/cant_cpu/src/tensor_matmul.rs:32
↓ 1 callersFunctionproduct
(slice: &[usize])
crates/cant_cuda/src/tensor_matmul.rs:35
↓ 1 callersFunctionproduct
(slice: &[usize])
crates/cant_metal/src/tensor_matmul.rs:36
↓ 1 callersMethodset_mask
(&mut self, mask: Tensor)
src/nn/multihead_attention.rs:155
↓ 1 callersMethodset_parameter
sets the weights of tensor Arguments 'param_id' : the Id of the Tensor we are updating 'new_parameters' : the new values
src/central/equation.rs:761
↓ 1 callersMethodset_single_value
(&mut self, tensor_id: TensorID, index: Indexable, value: f32)
src/central/equation.rs:480
↓ 1 callersMethodset_tensor_grad
Copies data into the grad of tensor_id # Arugments 'tensor_id' - Id of for the loopup on the tensor 'grad' - the grad we are copying in
src/central/equation.rs:442
↓ 1 callersFunctionshifted_batches
(data: &[u32], batch_size: usize)
src/nn/gpt2.rs:238
↓ 1 callersFunctionsingle_run
(input: Vec<f32>, expected_output: Vec<f32>, model: &mut GPT2, vocab_size: usize)
src/nn/gpt2.rs:260
↓ 1 callersMethodstart_clock_with_name
Starts a clock with a given name
src/utils/timing.rs:18
↓ 1 callersMethodstart_timer
util function to start a time with a provided name # Aruguments 'name': the name of the timer
src/central/equation.rs:174
↓ 1 callersMethodsub_vector
Takes two tensors as flat buffers, subs them together at an elementwise level and returns the result # Arguments 'a' : The first tensor 'b' : the seco
src/central/equation.rs:285
↓ 1 callersMethodswap_index
Returns a new shape with the dimensions changed to a new ones # Arguments 'index' - the 0base index we will be swapping 'new_dimension' the new dimen
src/central/shape.rs:141
↓ 1 callersFunctiontensor_sub
Takes two tensors as flat buffers, subs them together at an elementwise level and returns the result # Arguments 'a' : The first vector 'b' : the seco
crates/cant_cpu/src/tensor_sub.rs:5
↓ 1 callersMethodupdate
(&mut self)
src/optimizers/stochastic_gradient_descent.rs:35
↓ 1 callersMethodupdate
(&mut self)
src/optimizers/adamw.rs:58
↓ 1 callersMethodupdate
(&mut self)
src/optimizers/adam.rs:58
↓ 1 callersMethodupdate_parameters
Updates all parameters for all tensor that are marked for needed gradients(set_requires_grad) Arguments 'learning_rate': a singe learning rate applied
src/central/equation.rs:739
↓ 1 callersMethodupdate_single_parameter
Updates the paramaters of a single tensor Arugments 'parameter': the tensor that will have its weights updated 'learning_rate': the learning rate appl
src/central/equation.rs:784
↓ 1 callersMethodupdate_single_parameter_with_provided_gradient
Updates the paramaters of a single tensor using the provided gradient vector Arugments 'parameter': the tensor that will have its weights updated 'lea
src/central/equation.rs:819
← previousnext →101–200 of 825, ranked by callers