tensorneko 0.3.14__py3-none-any.whl → 0.3.16__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tensorneko/__init__.py +19 -6
- tensorneko/msg/__init__.py +3 -0
- tensorneko/version.txt +1 -1
- {tensorneko-0.3.14.dist-info → tensorneko-0.3.16.dist-info}/METADATA +42 -20
- {tensorneko-0.3.14.dist-info → tensorneko-0.3.16.dist-info}/RECORD +8 -7
- {tensorneko-0.3.14.dist-info → tensorneko-0.3.16.dist-info}/WHEEL +1 -1
- {tensorneko-0.3.14.dist-info → tensorneko-0.3.16.dist-info}/LICENSE +0 -0
- {tensorneko-0.3.14.dist-info → tensorneko-0.3.16.dist-info}/top_level.txt +0 -0
tensorneko/__init__.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import os.path
|
|
2
2
|
|
|
3
3
|
from . import backend
|
|
4
|
-
from . import callback
|
|
5
4
|
from . import dataset
|
|
6
5
|
from . import debug
|
|
7
6
|
from . import evaluation
|
|
@@ -14,14 +13,11 @@ from . import preprocess
|
|
|
14
13
|
from . import util
|
|
15
14
|
from . import visualization
|
|
16
15
|
from .io import read, write
|
|
17
|
-
from .neko_model import NekoModel
|
|
18
16
|
from .neko_module import NekoModule
|
|
19
|
-
from .neko_trainer import NekoTrainer
|
|
20
17
|
|
|
21
18
|
__version__ = io.read.text(os.path.join(util.get_tensorneko_path(), "version.txt"))
|
|
22
19
|
|
|
23
20
|
__all__ = [
|
|
24
|
-
"callback",
|
|
25
21
|
"dataset",
|
|
26
22
|
"backend",
|
|
27
23
|
"evaluation",
|
|
@@ -34,11 +30,28 @@ __all__ = [
|
|
|
34
30
|
"util",
|
|
35
31
|
"visualization",
|
|
36
32
|
"debug",
|
|
37
|
-
"NekoModel",
|
|
38
|
-
"NekoTrainer",
|
|
39
33
|
"NekoModule",
|
|
40
34
|
"read",
|
|
41
35
|
"write",
|
|
42
36
|
]
|
|
43
37
|
|
|
38
|
+
try:
|
|
39
|
+
from . import callback
|
|
40
|
+
except ImportError:
|
|
41
|
+
pass
|
|
42
|
+
else:
|
|
43
|
+
__all__.append("callback")
|
|
44
44
|
|
|
45
|
+
try:
|
|
46
|
+
from .neko_model import NekoModel
|
|
47
|
+
except ImportError:
|
|
48
|
+
pass
|
|
49
|
+
else:
|
|
50
|
+
__all__.append("NekoModel")
|
|
51
|
+
|
|
52
|
+
try:
|
|
53
|
+
from .neko_trainer import NekoTrainer
|
|
54
|
+
except ImportError:
|
|
55
|
+
pass
|
|
56
|
+
else:
|
|
57
|
+
__all__.append("NekoTrainer")
|
tensorneko/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.3.
|
|
1
|
+
0.3.16
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: tensorneko
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.16
|
|
4
4
|
Summary: Tensor Neural Engine Kompanion. An util library based on PyTorch and PyTorch Lightning.
|
|
5
5
|
Home-page: https://github.com/ControlNet/tensorneko
|
|
6
6
|
Author: ControlNet
|
|
@@ -8,13 +8,14 @@ Author-email: smczx@hotmail.com
|
|
|
8
8
|
License: UNKNOWN
|
|
9
9
|
Project-URL: Bug Tracker, https://github.com/ControlNet/tensorneko/issues
|
|
10
10
|
Project-URL: Source Code, https://github.com/ControlNet/tensorneko
|
|
11
|
-
Keywords: deep learning,pytorch,AI
|
|
11
|
+
Keywords: deep learning,pytorch,AI,data processing
|
|
12
12
|
Platform: UNKNOWN
|
|
13
13
|
Classifier: Programming Language :: Python :: 3
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.8
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.9
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.10
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
19
|
Classifier: License :: OSI Approved :: MIT License
|
|
19
20
|
Classifier: Operating System :: OS Independent
|
|
20
21
|
Classifier: Intended Audience :: Developers
|
|
@@ -22,19 +23,19 @@ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
|
22
23
|
Classifier: Topic :: Utilities
|
|
23
24
|
Requires-Python: >=3.8
|
|
24
25
|
Description-Content-Type: text/markdown
|
|
25
|
-
|
|
26
|
-
Requires-Dist:
|
|
27
|
-
Requires-Dist:
|
|
28
|
-
Requires-Dist:
|
|
29
|
-
Requires-Dist:
|
|
30
|
-
Requires-Dist:
|
|
31
|
-
Requires-Dist:
|
|
32
|
-
Requires-Dist:
|
|
33
|
-
Requires-Dist:
|
|
34
|
-
Requires-Dist:
|
|
35
|
-
|
|
36
|
-
Requires-Dist:
|
|
37
|
-
Requires-Dist:
|
|
26
|
+
Requires-Dist: av (>=8.0.3)
|
|
27
|
+
Requires-Dist: einops (>=0.3.0)
|
|
28
|
+
Requires-Dist: numpy (>=1.20.1)
|
|
29
|
+
Requires-Dist: pillow (>=8.1)
|
|
30
|
+
Requires-Dist: tensorneko-util (==0.3.16)
|
|
31
|
+
Requires-Dist: torch (>=1.9.0)
|
|
32
|
+
Requires-Dist: torchaudio (>=0.9.0)
|
|
33
|
+
Requires-Dist: torchmetrics (>=0.7.3)
|
|
34
|
+
Requires-Dist: torchvision (>=0.10.0)
|
|
35
|
+
Requires-Dist: pysoundfile (>=0.9.0) ; platform_system == "Windows"
|
|
36
|
+
Provides-Extra: lightning
|
|
37
|
+
Requires-Dist: lightning (<2.2,>=2.0) ; extra == 'lightning'
|
|
38
|
+
Requires-Dist: tensorboard (>=2.0.0) ; extra == 'lightning'
|
|
38
39
|
|
|
39
40
|
<h1 style="text-align: center">TensorNeko</h1>
|
|
40
41
|
|
|
@@ -63,8 +64,11 @@ Tensor Neural Engine Kompanion. An util library based on PyTorch and PyTorch Lig
|
|
|
63
64
|
|
|
64
65
|
## Install
|
|
65
66
|
|
|
67
|
+
The tensorneko requires pytorch and pytorch-lightning (optional), and you can install it with below command.
|
|
68
|
+
|
|
66
69
|
```shell
|
|
67
|
-
pip install tensorneko
|
|
70
|
+
pip install tensorneko # for PyTorch only
|
|
71
|
+
pip install tensorneko[lightning] # for PyTorch and Lightning
|
|
68
72
|
```
|
|
69
73
|
|
|
70
74
|
To use the library without PyTorch and PyTorch Lightning, you can install the util library (support Python 3.7 ~ 3.12 with limited features) with following command.
|
|
@@ -72,11 +76,18 @@ To use the library without PyTorch and PyTorch Lightning, you can install the ut
|
|
|
72
76
|
pip install tensorneko_util
|
|
73
77
|
```
|
|
74
78
|
|
|
75
|
-
Some cpu bound functions are implemented by `pyo3`, and you can install the optimized version with below command.
|
|
79
|
+
Some cpu bound functions are implemented by rust-based `pyo3`, and you can install the optimized version with below command.
|
|
76
80
|
```shell
|
|
77
81
|
pip install tensorneko_lib
|
|
78
82
|
```
|
|
79
83
|
|
|
84
|
+
Some CLI tools are provided in the `tensorneko_tool` package, and you can install it with below command.
|
|
85
|
+
```shell
|
|
86
|
+
pipx install tensorneko_tool # or `pip install tensorneko_tool`
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Then you can use the CLI tools `tensorneko` in the terminal.
|
|
90
|
+
|
|
80
91
|
## Neko Layers, Modules and Architectures
|
|
81
92
|
|
|
82
93
|
Build an MLP with linear layers. The activation and normalization will be placed in the hidden layers.
|
|
@@ -265,7 +276,7 @@ t0 = time.time()
|
|
|
265
276
|
with Server(view, port=8000):
|
|
266
277
|
for i, data in enumerate(data_list):
|
|
267
278
|
preprocessing(data) # do some processing here
|
|
268
|
-
|
|
279
|
+
|
|
269
280
|
x = time.time() - t0 # time since the start of the program
|
|
270
281
|
y = i # processed number of data
|
|
271
282
|
line_chart.add(x, y) # add to the line chart
|
|
@@ -486,7 +497,7 @@ def process_data(n: int):
|
|
|
486
497
|
return n
|
|
487
498
|
else:
|
|
488
499
|
return None
|
|
489
|
-
|
|
500
|
+
|
|
490
501
|
|
|
491
502
|
data = get_data()
|
|
492
503
|
data = data.map(process_data).get_or_else(-1) # if the response is None, return -1
|
|
@@ -519,7 +530,7 @@ This library provides event bus based reactive tools. The API integrates the Pyt
|
|
|
519
530
|
# useful decorators for default event bus
|
|
520
531
|
from tensorneko.util import subscribe
|
|
521
532
|
# Event base type
|
|
522
|
-
from tensorneko.util import Event
|
|
533
|
+
from tensorneko.util import Event, EventBus
|
|
523
534
|
|
|
524
535
|
class LogEvent(Event):
|
|
525
536
|
def __init__(self, message: str):
|
|
@@ -549,6 +560,7 @@ if __name__ == '__main__':
|
|
|
549
560
|
# emit an event, and then the event handler will be invoked
|
|
550
561
|
# The sequential order is not guaranteed
|
|
551
562
|
LogEvent("Hello world!")
|
|
563
|
+
EventBus.default.wait() # it's not blocking, need to call wait manually before exit.
|
|
552
564
|
# one possible output:
|
|
553
565
|
# Hello world! in another thread
|
|
554
566
|
# Hello world! async
|
|
@@ -685,4 +697,14 @@ Functions list (in `tensorneko`):
|
|
|
685
697
|
- `is_bad_num`
|
|
686
698
|
- `count_parameters`
|
|
687
699
|
|
|
700
|
+
## TensorNeko Tools
|
|
701
|
+
|
|
702
|
+
Some CLI tools are provided in the `tensorneko_tool` package.
|
|
703
|
+
|
|
704
|
+
The `gotify` can send a message to the Gotify server, with the environment variables `GOTIFY_URL` and `GOTIFY_TOKEN` set.
|
|
705
|
+
|
|
706
|
+
```shell
|
|
707
|
+
tensorneko gotify "Script finished!"
|
|
708
|
+
```
|
|
709
|
+
|
|
688
710
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
tensorneko/__init__.py,sha256=
|
|
1
|
+
tensorneko/__init__.py,sha256=uh1HNn1sNpX1bbOqAE_kNJfrH4eMtEzus0hO-Fh9tEw,990
|
|
2
2
|
tensorneko/neko_model.py,sha256=QTbdOAg9ki0ix6mDL_Qu8Wmd5WJOoUFF3M1SXEp3KGc,10551
|
|
3
3
|
tensorneko/neko_module.py,sha256=qELXvguSjWo_NvcRQibiFl0Qauzd9JWLSnT4dbGNS3Y,1473
|
|
4
4
|
tensorneko/neko_trainer.py,sha256=JC8qoKSZ5ngz3grf3S0SjvIFVktDIP_GExth5aFfbGA,10074
|
|
5
|
-
tensorneko/version.txt,sha256=
|
|
5
|
+
tensorneko/version.txt,sha256=XSXl8BxVFKqB3N-DasVRdbWcnpx7WRAyDr5dG_Eo7DA,6
|
|
6
6
|
tensorneko/arch/__init__.py,sha256=w4lTUeyBIZelrnSjlBFWUF0erzOmBFl9FqeWQuSOyKs,248
|
|
7
7
|
tensorneko/arch/auto_encoder.py,sha256=j6PWWyaNYaYNtw_zZ9ikzhCASqe9viXR3JGBIXSK92Y,2137
|
|
8
8
|
tensorneko/arch/binary_classifier.py,sha256=1MkEbReXKLdDksRG5Rsife40grJk08EVDcNKp54Xvb4,2316
|
|
@@ -63,6 +63,7 @@ tensorneko/module/inception.py,sha256=2p8AjgTIk5wLGC-JnrmXIehh6yNCu2tYc2axjzUTGM
|
|
|
63
63
|
tensorneko/module/mlp.py,sha256=AFN6xmvlrNWOflLqVl-zVkoOJRZpYxYB4bnI10JG5CU,3361
|
|
64
64
|
tensorneko/module/residual.py,sha256=S59TqiiD_310HQ3a6s3r49XY_7Dc4RGxONQtSvzEfN0,2958
|
|
65
65
|
tensorneko/module/transformer.py,sha256=h4NvH3zGa0rZt0bv6e8VM31SimbQKRcocSR42zJYVoY,7602
|
|
66
|
+
tensorneko/msg/__init__.py,sha256=GHrHjzw__0DcPBHBN6GzHrD8PD_7CwOZPRullOaZyW0,71
|
|
66
67
|
tensorneko/notebook/__init__.py,sha256=Pgz4aTJg5_3zTzBIaML4LHAMOFgrBOHw3o00ZuvNuQU,171
|
|
67
68
|
tensorneko/optim/__init__.py,sha256=89XjYQICij8SkrW5iryfZgmbxcTDxA3hhVZTgR4588o,33
|
|
68
69
|
tensorneko/optim/lr_scheduler/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -84,8 +85,8 @@ tensorneko/visualization/log_graph.py,sha256=NvOwWVc_petXWYdgaHosPFLa43sHBeacbYc
|
|
|
84
85
|
tensorneko/visualization/matplotlib.py,sha256=xs9Ssc44ojZX65QU8-fftA7Ug_pBuZ3TBtM8vETNq9w,1568
|
|
85
86
|
tensorneko/visualization/image_browser/__init__.py,sha256=AtykhAE3bXQS6SOWbeYFeeUE9ts9XOFMvrL31z0LoMg,63
|
|
86
87
|
tensorneko/visualization/watcher/__init__.py,sha256=Nq752qIYvfRUZ8VctKQRSqhxh5KmFbWcqPfZlijVx6s,379
|
|
87
|
-
tensorneko-0.3.
|
|
88
|
-
tensorneko-0.3.
|
|
89
|
-
tensorneko-0.3.
|
|
90
|
-
tensorneko-0.3.
|
|
91
|
-
tensorneko-0.3.
|
|
88
|
+
tensorneko-0.3.16.dist-info/LICENSE,sha256=Vd75kwgJpVuMnCRBWasQzceMlXt4YQL13ikBLy8G5h0,1067
|
|
89
|
+
tensorneko-0.3.16.dist-info/METADATA,sha256=Y2dgqx89FzcdEV8hkGrFeTNeCmdJ-YqbYWej5WxRSAg,19998
|
|
90
|
+
tensorneko-0.3.16.dist-info/WHEEL,sha256=g4nMs7d-Xl9-xC9XovUrsDHGXt-FT0E17Yqo92DEfvY,92
|
|
91
|
+
tensorneko-0.3.16.dist-info/top_level.txt,sha256=sZHwlP0iyk7_zHuhRHzSBkdY9yEgyC48f6UVuZ6CvqE,11
|
|
92
|
+
tensorneko-0.3.16.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|