Tag: Developers

Analytics | Data Visualization | Programming Tips
SAS Software 0
SAS Viya: Package for Python API for deep learning and image processing: DLPy

Editor's Note: This article was translated and edited by SAS USA and was originally written by Makoto Unemi. The original text is here. SAS previously provided SAS Scripting Wrapper for Analytics Transfer (SWAT), a package for using SAS Viya functions from various general-purpose programming languages ​​such as Python. In addition

Programming Tips
Leonid Batkhan 0
Dividing by zero with SAS

Whether you are a strong believer in the power of dividing by zero, agnostic, undecided, a supporter, denier or anything in between and beyond, this blog post will bring all to a common denominator. History of injustice For how many years have you been told that you cannot divide by

Artificial Intelligence
DLPyを使用した、ディープラーニングのfunctional APIモデル構築

SAS Viyaの分析機能をPythonから利用するためのハイレベルAPIパッケージであるDLPyでは、kerasと同等の簡潔なコーディングで、複雑な画像処理やディープラーニングを実行することができます。 そして、DLPyでは、kerasと同様に、2つの手法でディープラーニングのモデルを構築することができます。 Sequential modelとfunctional API modelです。 Sequentialとは、その名の通り、レイヤーを順序通りに積み重ねて、順序通りに実行していくモデルです。 以下は、DLPyを用いて、PythonからSAS Viyaのディープラーニング機能を使用して画像分類向けsequential modelのネットワークを定義している例です。 In [10]: model1 = Sequential(sess, model_table='Simple_CNN') model1.add(InputLayer(3, 224, 224, offsets=tr_img.channel_means)) model1.add(Conv2d(8, 7)) model1.add(Pooling(2)) model1.add(Conv2d(8, 7)) model1.add(Pooling(2)) model1.add(Dense(16)) model1.add(OutputLayer(act='softmax', n=2)) In [11]: model1.print_summary() Out[11]: In [12]: model1.plot_network() Out[12]: 一方、functional APIは、sequentialでは、表現することが難しい、より複雑な構造のモデルを構築する際に利用されます。 以下は、kerasの公式サイトに記載されている文面です。 “functional APIは,複数の出力があるモデルや有向非巡回グラフ,共有レイヤーを持ったモデルなどの複雑なモデルを定義するためのインターフェースです.” そして、DLPyでは、kerasと同様にsequential modelだけでなく、functional API modelの構築も可能になっています。 以下はその一例として、複数の入力と出力を持つような画像分類のためのディープラーニングモデルのネットワーク例です。 まず、テンソルオブジェクトを返すInput()によって、2つのテンソル、グレースケール画像とカラー(RGB)画像、を定義します。 グレースケール画像は2つの畳み込み層に送り込まれます。カラー画像はそれらとは別の畳み込み層に送り込まれます。