- Notifications
You must be signed in to change notification settings - Fork1
A C++ machine learning framework/library.
License
Tensor-Array/Tensor-Array
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
A C++ Tensor library that can be used to work with machine learning or deep learning project.
Build your own neural network models with this library.
You need to clone repository by usingGit
You need to installTensor-Array withCMake
git clone https://github.com/Tensor-Array/Tensor-Array.gitcd Tensor-Arraymkdir buildcd buildcmake ..cmake --build.cmake --install.cd ..
We created a template struct that namedTensorArray. That struct is a multi-dimensional array wrapper.
#include<tensor-array/core/tensorbase.hh>usingnamespacetensor_array::value;intmain(){ TensorArray<float,4,4> example_tensor_array = {{ {{1,2,3,4 }}, {{5,6,7,8 }}, {{9,10,11,12 }}, {{13,14,15,16 }}, }};return0;}
That code is wrapping for:
intmain(){float example_tensor_array[4][4] = { {1,2,3,4 }, {5,6,7,8 }, {9,10,11,12 }, {13,14,15,16 }, };return0;}
TheTensor class is a storage that store value and calculate the tensor.
TheTensor::calc_grad() method can do automatic differentiation.
TheTensor::get_grad() method can get the gradient after callTensor::calc_grad().
#include<iostream>#include<tensor-array/core/tensor.hh>usingnamespacestd;usingnamespacetensor_array::value;intmain(){ TensorArray<float,4,4> example_tensor_array = {{ {{1,2,3,4 }}, {{5,6,7,8 }}, {{9,10,11,12 }}, {{13,14,15,16 }}, }}; TensorArray<float> example_tensor_array_scalar = {100}; Tensorexample_tensor_1(example_tensor_array); Tensorexample_tensor_2(example_tensor_array_scalar); Tensor example_tensor_sum = example_tensor_1 + example_tensor_2; cout << example_tensor_sum << endl; example_tensor_sum.calc_grad(); cout << example_tensor_1.get_grad() << endl; cout << example_tensor_2.get_grad() << endl;return0;}
About
A C++ machine learning framework/library.
Topics
Resources
License
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.