A mini Tensor framework for tensor operations on GPU.
Project description
DeepOps
A Mini Deep learning library, accelerated on GPUs with PyCuda.
No no no.. I havent wrote this library on tensorflow or torch, it is a standalone machine. :P
Implemented backpropogations using reverse traversal, Support gradients and GPU operations, You can make a mini neural network (FNN) and use the in-house optimizer to train it on a dataset (e.g MNIST).
Tip: always give your tensor a funny name! :)
Note: Only for Educational Usage.
Installation.
pip install deepops
Tensor.
a = Tensor([1,2,3,4,5])
# deepop tensor
Attach to a cuda device.
a = Tensor([1,2,3,4,5])
a.device("gpu:0") # attach to gpu device.
Check the Device.
a.where
# 'cpu'
Addition.
a = Tensor([1.0,2.0])
print(a + a)
# GPU Operation
Multiplication.
a = Tensor([1.0, 2.0])
print(a.mul(a))
print(a * a)
Calculate Gradients.
Tensor = dp.Tensor
a1 = Tensor([1.0, 3.0, 1.0])
b1 = Tensor([7.0, 3.0, 5.0])
a2 = Tensor([4.0, 3.0, 1.0])
a3 = Tensor([3.0, 3.0, 1.0])
a4 = Tensor([7.0, 1.0, 6.0])
b2 = Tensor([1.0, 21.0, 12.0])
c = a1 * b1 + a3
d = a2 * b2 + a4
out = c * d
# backward
out.backward()
print(out.grad)
print(a1.grad)
Run Tests.
python -m pytest -s
Contribution is highly appreciated.
Please contribute to my work.
TODOs
- write more tests...
- need a optimizer.
- support more operations.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
deepop-0.1.dev0.tar.gz
(6.5 kB
view details)
Built Distribution
File details
Details for the file deepop-0.1.dev0.tar.gz
.
File metadata
- Download URL: deepop-0.1.dev0.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.23.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ed71938683ef1b31b623dbf9f06453d87de07e6350a4bcaca0a76830cfe358a |
|
MD5 | 43bbffd378a6cef3f8e033e82b92efb2 |
|
BLAKE2b-256 | 3b547dd59518ad5c9894d1fa1d09d51a0da78462111234cd974a8b6e6bb49855 |
File details
Details for the file deepop-0.1.dev0-py3-none-any.whl
.
File metadata
- Download URL: deepop-0.1.dev0-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.23.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4109bbcd0b3101c4ad3679ed676596b68c7750ac2a073b8f1b1110e2548b90de |
|
MD5 | eec65a9fb35a4c3142c8661f92e7002f |
|
BLAKE2b-256 | 3710e8a6b38979526b8ae3e761f77dce2adcb47fe2946df1d9c3cf68ad8a1e0d |