[DDesigner API] Deep-learning Designer API
1. About
1.1. DDesignerAPI?
It is a API for deep-learning learning and inference, and an API for application development using multi-platform
1.2. Functions
1.2.1. Layers and Blocks
- Accelerator enabled layers and the ability to define special layers that are not defined in Keras and others
- A function that defines a combination of layers as a block and easily composes a block (ex. CONV + BN + ACT + DROPOUT= ConvBlock)
1.2.2. Optimization for Accelerator Usage (XWN)
- Optimized function to use accelerator
2. Support
2.1. Platforms
- Tensorflow 2.6.0
- PyTorch 1.13.1
2.2. Components of Network
2.2.1. Layers
- Accelerator enabled layers and Custom layers that perform specific functions
2.2.1.1. Summary
| Operation | Support Train Platform | Support TACHY Accelerator |
|---|---|---|
| Convolution | TF / Keras / PyTorch | O |
| TransposeConvolution | TF / Keras / PyTorch | O |
| CascadeConvolution | Keras / PyTorch | O |
2.2.1.2. Detail
- Convolution : 1D, 2D with XWN optimization
- TransposeConvolution : 1D, 2D with XWN optimization
- CascadeConvolution : A Layer that decomposes a layer with large kernel into multiple layers with smaller kernels to lighten the model / 1D, 2D with XWN optimization
2.2.2. Blocks
- A set of defined layers for user convenience
2.2.2.1. Summary
| Platform | ConvBlock | TConvBlock | FCBlock |
|---|---|---|---|
| TF-Keras | 1D/2D | 2D | TODO |
| PyTorch | TODO | TODO | TODO |
2.2.2.2. Detail
- ConvBlock : Convolution N-D Block (CONV + BN + ACT + DROPOUT), support Conv1DBlock, Conv2DBlock
- TConvBlock : Transpose Convolution 2D Block (TCONV + BN + ACT + DROPOUT), support TConv2DBlock
- CascadeConvBlock : Cascade Convolution N-D Block (CONV + BN + ACT + DROPOUT), support CascadeConv1DBlock, CascadeConv2DBlock
2.3. XWN (Applies only to convolution operations)
2.3.1. Transform Configuration (data type / default value / description)
- transform : bool / False / Choose whether to use
- bit : int / 4 / Quantization range (bit-1 ** 2)
- max_scale : float / 4.0 / Max value
2.3.2. Pruning Configuration
- pruning : bool / False / Choose whether to use
- prun_weight : float / 0.5 / Weights for puning edge generation
2.3.3. Summary
| Platform | Conv | TransposeConv | CascadeConv |
|---|---|---|---|
| TF | 1D/2D | 1D/2D | TODO |
| Keras | 1D/2D | 1D/2D | TODO |
| PyTorch | 1D/2D | 1D/2D | 1D/2D |
3. Command Usage
3.1. XWN
3.1.1. Single Convolution
3.1.1.1. Tensorflow
>>> from ddesigner_api.tensorflow.xwn import tf_nn as nn
>>> nn.conv2d(
x,
kernel,
...
use_transform=True,
bit=4,
max_scale=4.0,
use_pruning=False
)
3.1.1.2. Keras
>>> from ddesigner_api.tensorflow.xwn import keras_layers as klayers
>>> klayers.Conv2D(
2, 3,
...
use_transform=True,
bit=4,
max_scale=4.0
use_pruning=True,
prun_weight=0.5
)
3.1.1.3. PyTorch
>>> from ddesigner_api.pytorch.xwn import torch_nn as nn
>>> nn.Conv2d(
in_channels=1,
out_channels=2,
...
use_transform=True,
bit=4,
max_scale=4.0,
use_pruning=False
)
3.1.2. Custum Layer and Block (CascadeConv, ...)
3.1.2.1. Keras
>>> from ddesigner_api.tensorflow import dpi_layers as dlayers
>>> dlayers.CascadeConv2d(
2, 3,
...
transform=4,
max_scale=4.0,
pruning=None,
)
3.1.2.2. PyTorch
>>> from ddesigner_api.pytorch import dpi_nn as dnn
>>> dnn.CascadeConv2d(
16, # in_channels
32, # out_channels
7, # kernel_size
stride=(1,1),
bias=False,
...
transform=4,
max_scale=4.0,
pruning=None,
)
3.2. Blocks
3.2.1. Keras
3.2.1.1. Conv1DBlock
>>> from ddesigner_api.tensorflow import dpi_blocks as db
>>> dtype='mixed_float16'
>>> db.Conv1DBlock(
64, 3, strides=1, padding='SAME', use_bias=False,
activation=tf.keras.layers.ReLU(dtype=dtype),
batchnormalization=tf.keras.layers.BatchNormalization(dtype=dtype),
dtype=dtype,
transform=4, max_scale=4.0,
pruning=0.5
)
3.2.1.2. Conv2DBlock
>>> from ddesigner_api.tensorflow import dpi_blocks as db
>>> dtype='mixed_float16'
>>> db.Conv2DBlock(
64, (3,3), strides=(1,1), padding='SAME', use_bias=False,
activation=tf.keras.layers.ReLU(dtype=dtype),
batchnormalization=tf.keras.layers.BatchNormalization(dtype=dtype),
dtype=dtype,
transform=4, max_scale=4.0,
pruning=0.5
)
3.2.1.3. TConv2DBlock
>>> from ddesigner_api.tensorflow import dpi_blocks as db
>>> dtype='mixed_float16'
>>> db.TConv2DBlock(
64, (3,3), strides=(2,2), padding='SAME', use_bias=False,
activation=tf.keras.layers.ReLU(dtype=dtype),
batchnormalization=tf.keras.layers.BatchNormalization(dtype=dtype),
dtype=dtype,
transform=4, max_scale=4.0,
pruning=0.5
)
3.3. Examples
- An example of comparing and printing results before optimization(XWN) and after XWN for the same input on a supported platform.
3.3.1. Tensorflow
>>> import ddesigner_api.tensorflow.examples.examples_tensorflow as ex
>>> ex.main()
>>> ====== TENSORFLOW Examples======
>>> 1: Fixed Float32 Input Conv2D
>>> q: Quit
>>> Select Case: ...
3.3.2. Keras
>>> import ddesigner_api.tensorflow.examples.examples_keras as ex
>>> ex.main()
>>> ====== KERAS Examples======
>>> 1: Fixed Float32 Input Conv2D
>>> 2: Random Float32 Input Conv2D
>>> 3: Random Float32 Input Conv2DTranspose
>>> 4: Random Float16 Input Conv2D
>>> q: Quit
>>> Select Case: ...
3.3.3. PyTorch
>>> import ddesigner_api.pytorch.examples.examples_pytorch as ex
>>> ex.main()
>>> ====== PYTORCH Examples======
>>> 1: Fixed Float32 Input Conv2D
>>> 2: Random Float32 Input Conv2D
>>> 3: Fixed Float32 Input Conv1D
>>> 4: Fixed Float32 Input Conv1DTranspose
>>> 5: Random Float32 Input CascadeConv2D
>>> 6: Random Float32 Input CascadeConv1D
>>> q: Quit
>>> Select Case: ...
3.3.4. Numpy
>>> import ddesigner_api.numpy.examples.examples_numpy as ex
>>> ex.main()
>>> ====== NUMPY Examples======
>>> 1: XWN Transform
>>> 2: XWN Transform and Pruning
>>> q: Quit
>>> Select Case: ...
Metadata
Release files for DDesignerAPI 0.0.6.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| DDesignerAPI-0.0.6.3-py3-none-any.whl | Python 3 | none | any | Details for DDesignerAPI-0.0.6.3-py3-none-any.whl |
Release files / DDesignerAPI-0.0.6.3-py3-none-any.whl
| Download URL | DDesignerAPI-0.0.6.3-py3-none-any.whl |
|---|---|
| Size | 68.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
59e8c4c63f3f5d3d946ac029da0f120bc2963c365941fc483b06fe7c58090c55
|
|
BLAKE2b-256 checksum How to use checksums |
d8a7fb95821c5a061d364cd83df5057a760a2e9cf79a10772472f8bed5fa9c24
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.7.10
|
Security for DDesignerAPI 0.0.6.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.