SAS Deep Learning Interface
Project description
DLPy - SAS Viya Deep Learning API for Python
An efficient way to apply deep learning methods to image, text, and audio data.
Overview
DLPy is a high-level Python library for the SAS Deep learning features available in SAS Viya. DLPy is designed to provide an efficient way to apply deep learning methods to image, text, and audio data. DLPy APIs created following the Keras APIs with a touch of PyTorch flavor.
What's Recently Added
- Text, audio, and time series support in addition to image
- New APIs for:
- RNN based tasks: text classification, text generation, and sequence labeling
- Object detection
- Image segmentation
- Time series processing and modeling
- Processing audio files and creating speech recognition models
- Additional pre-defined network architectures such as DenseNet, DarkNet, Inception, Yolo, FasterRCNN, U-Net, MobileNet, and ShuffleNet
- Enhanced data visualization and metadata handling
Prerequisites
- Python version 3 or greater is required
- Install SAS Scripting Wrapper for Analytics Transfer (SWAT) for Python using
pip install swat
orconda install -c sas-institute swat
- Access to a SAS Viya 3.4 environment with Visual Data Mining and Machine Learning (VDMML) is required
- A user login to your SAS Viya back-end is required. See your system administrator for details if you do not have a SAS Viya account.
- It is recommended that you install the open source graph visualization software called Graphviz to enable graphic visualizations of the DLPy deep learning models
- Install DLPy using
pip install sas-dlpy
orconda install -c sas-institute sas-dlpy
SAS Viya and VDMML versions vs. DLPY versions
DLPy versions are aligned with the SAS Viya and VDMML versions. Below is the versions matrix.
DLPy | SAS Viya | VDMML |
---|---|---|
1.1.x | 3.4 | 8.4 |
1.0.x | 3.4 | 8.3 |
The table above can be read as follows: DLPy versions between 1.0 (inclusive) to 1.1 (exclusive) are designed to work with the SAS Viya 3.4 and VDMML 8.3.
External Libraries
The following versions of external libraries are supported:
- ONNX: versions >= 1.5.0
- Keras: versions >= 2.1.3
Getting Started
To connect to a SAS Viya server, import SWAT and use the swat.CAS class to create a connection:
Note: The default CAS port is 5570.
>>> import swat
>>> sess = swat.CAS('mycloud.example.com', 5570)
Next, import the DLPy package, and then build a simple convolutional neural network (CNN) model.
Import DLPy model functions:
>>> from dlpy import Model, Sequential
>>> from dlpy.layers import *
Use DLPy to create a sequential model and name it Simple_CNN
:
>>> model1 = Sequential(sess, model_table = 'Simple_CNN')
Define an input layer to add to model1
:
# The input shape contains RGB images (3 channels)
# The model images are 224 px in height and 224 px in width
>>> model1.add(InputLayer(3,224,224))
NOTE: Input layer added.
Add a 2D convolution layer and a pooling layer:
# Add 2-Dimensional Convolution Layer to model1
# that has 8 filters and a kernel size of 7.
>>> model1.add(Conv2d(8,7))
NOTE: Convolutional layer added.
# Add Pooling Layer of size 2
>>> model1.add(Pooling(2))
NOTE: Pooling layer added.
Add an additional pair of 2D convolution and pooling layers:
# Add another 2D convolution Layer that has 8 filters and a kernel size of 7
>>> model1.add(Conv2d(8,7))
NOTE: Convolutional layer added.
# Add a pooling layer of size 2 to # complete the second pair of layers.
>>> model1.add(Pooling(2))
NOTE: Pooling layer added.
Add a fully connected layer:
# Add Fully-Connected Layer with 16 units
>>> model1.add(Dense(16))
NOTE: Fully-connected layer added.
Finally, add the output layer:
# Add an output layer that has 2 nodes and uses
# the Softmax activation function
>>> model1.add(OutputLayer(act='softmax',n=2))
NOTE: Output layer added.
NOTE: Model compiled successfully
Additional Resources
- DLPy examples: https://github.com/sassoftware/python-dlpy/tree/master/examples
- DLPy API documentation sassoftware.github.io/python-dlpy.
- SAS SWAT for Python
- SAS ESPPy
- Watch: DLPy videos:
- DLPy v1.0 examples:
- DLPy v1.1 examples:
- SAS Deep Learning with Python made easy using DLPy
Contributing
Have something cool to share? SAS gladly accepts pull requests on GitHub! See the Contributor Agreement for details.
Licensing
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at LICENSE.txt
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
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
File details
Details for the file sas-dlpy-1.2.0.tar.gz
.
File metadata
- Download URL: sas-dlpy-1.2.0.tar.gz
- Upload date:
- Size: 51.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.20.1 setuptools/39.1.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 897d3c80c9f0e4097c927927115d306ed9c6a9885ebe3e56b8a72130fde1536a |
|
MD5 | 6d1012375967404803dd3d87be0b92d8 |
|
BLAKE2b-256 | 86f6ba3b73fb43dedc88ba459f501122b94ff0c88a8123a5f194bc8b989b67d2 |