NumC
|
|-- include/ # header files .h
| |-- tensor/
| | |-- tensor_factory.h
| | |-- tensor_operations.h
| | |-- tensor_utils.h
| |
| |-- config.h
| |-- errors.h
|
|-- src/ # source files .c
| |-- tensor/
| | |-- tensor_factory.c
| | |-- tensor_operations.c
| | |-- tensor_utils.c
| |
| |-- errors.c
| |-- main.c
|
|-- tests/ # test files .c
| |--tensor/
| | |-- test_tensor_factory.c
| | |-- test_tensor_operations.c
| | |-- test_tensor_utils.c
| |
| |-- Makefile # Makefile for tests
| |-- test_main.c
|
|-- .gitignore
|-- Makefile # Makefile for compiling
|-- README.md
> make # compile files specified in makefile to executable
> make clean # remove files used to create executable
> ./NumC # execute program (main.c)
- Basic Element-wise Operations:
- Addition, Subtraction, Multiplication, Division: Perform these operations element-wise between tensors or between a tensor and a scalar.
- Unary operations: Functions like abs, sin, cos, exp, log, etc., applied element-wise.
- Broadcasting:
- Implementing broadcasting rules allows element-wise operations to be performed on tensors of different shapes, automatically expanding them to compatible dimensions.
- Reduction Operations:
- Sum, Mean, Min, Max: Calculate these across the entire tensor or along specific axes.
- Standard Deviation and Variance.
- Matrix Operations:
- Matrix Multiplication: Both element-wise multiplication and dot product.
- Transpose: Swap axes of the tensor.
- Determinant and Inverse (for 2D matrices).
- Tensor Reshaping:
- Reshape: Change the shape of a tensor without changing its data.
- Squeeze and Unsqueeze: Add or remove dimensions of size 1.
- Flatten: Collapse a tensor into a 1D array.
- Indexing and Slicing:
- Advanced indexing and slicing capabilities to extract sub-tensors.
- Tensor Concatenation and Splitting:
- Concatenate: Join a sequence of tensors along an existing axis.
- Split: Divide a tensor into multiple sub-tensors.
- Linear Algebra Functions:
- Eigenvalues and Eigenvectors.
- Singular Value Decomposition (SVD).
- QR Decomposition.
- Convolution Operations (useful in deep learning):
- Convolutional operations over tensors, typically used for image and signal processing.
- Gradient Computation (for advanced machine learning applications):
- Ability to compute gradients, which is essential for optimization in machine learning.
- Random Tensor Generation:
- Generate tensors with random values following specific distributions.
- Saving and Loading Tensors:
- Functions to serialize tensors to disk and load them back.