flashlight_tensor
Tensor library written in pure rust, designed mostly for matrix operations
project not related to similarly named flashlight. The name was coincidental and chosen independently.
Features
- n-dimensional tensors
- Element-wise operations
- Scalar multiplication and addition
- Tensor multiplication and addition
- Matrix transformation
- ReLU and sigmoid activations
- forward/backward propagation operations on gpu
- CPU and GPU support
- GpuRunner
- Chunking
Instalation
[]
= "0.4.3"
# Experimental(Not everything documented and working. Use at your own risk)
= { = "https://github.com/Bejmach/flashlight_tensor"}
Documentation
Quick Start
For gpu usage go to examples on github
use *;
Tests
Run tests with:
cargo test
Patch notes
V0.2.4:
- matrix_vec/col, now return a matrix, not vector
- matrix_col/row_sum/prod, return a sum/product of all collumns/rows in matrix
V0.2.5
- Propably something
V0.2.6
- better file structure
- mutable operations for iterative functions
V0.2.6
- activation functions for neural network
V0.3.0
- gpu operations + docs
V0.3.1
- gpu only backward/forward propagation merged operations, kinda hard to perform, will try to abstact it into gpu_runner
- examples, with merged machine learning operations runtime
V0.4.0
- gpu_chunking
- gpu_runner
V0.4.1
- more tests
- better docs
- no need to tell output size in sample
V0.4.2
- gpu ml crucial bug fixes(seriously. earlier versions were unusable for gpu ml)
- removed merged backprop
- better tests
V0.4.3
- better file structure
- ml derivative ops that I forgot to include before
What changed in 0.4.x
- less code for similar result
Old way
let mut gpu_data = new;
gpu_data.disable_shapes;
let sample = from_data;
gpu_data.append;
let mut buffers = init.await;
buffers.set_shader;
buffers.prepare;
let full_gpu_output: = buffers.run.await;
New way
New way also has integrated chunking, so if data you try to process it bigger than max buffer size, then it will run the operation in chunks and merge data at the end
let mut runner: GpuRunner = init;
//
// new in 0.4.1 No need to give output size -\
let sample = from_data;
runner.append;
let output_data: = runner.add.await;
Plans for 0.5.0
- nothing for now