Scénario de test & Cas d'usage
Creation and training of deep neural networks.
Discover all actions of deepLearnThis scenario does not require pre-existing data in a table, as the 'addLayer' action operates on a model definition table. We will create an empty model table named 'product_cnn_model' to start.
| 1 | /* The action builds the model architecture in a CAS table. No |
| 2 | data step is needed for this specific test. */ |
| 1 | PROC CAS; |
| 2 | DEEPLEARN.addLayer / |
| 3 | modelTable={name='product_cnn_model', replace=true} |
| 4 | layer={type='input', nchannels=3, width=128, height=128, scale=1.0/255.0} |
| 5 | name='data'; |
| 6 | RUN; |
| 1 | PROC CAS; |
| 2 | DEEPLEARN.addLayer / |
| 3 | modelTable={name='product_cnn_model'} |
| 4 | name='conv1' |
| 5 | layer={type='convolution', nFilters=16, width=3, height=3, stride=1, act='relu'} |
| 6 | srcLayers={'data'}; |
| 7 | RUN; |
| 1 | PROC CAS; |
| 2 | DEEPLEARN.addLayer / |
| 3 | modelTable={name='product_cnn_model'} |
| 4 | name='pool1' |
| 5 | layer={type='pooling', width=2, height=2, stride=2, pool='max'} |
| 6 | srcLayers={'conv1'}; |
| 7 | RUN; |
| 1 | PROC CAS; |
| 2 | DEEPLEARN.addLayer / |
| 3 | modelTable={name='product_cnn_model'} |
| 4 | name='fc1' |
| 5 | layer={type='fullconnect', n=128, act='relu'} |
| 6 | srcLayers={'pool1'}; |
| 7 | RUN; |
| 1 | PROC CAS; |
| 2 | DEEPLEARN.addLayer / |
| 3 | modelTable={name='product_cnn_model'} |
| 4 | name='output' |
| 5 | layer={type='output', n=3, act='softmax'} |
| 6 | srcLayers={'fc1'}; |
| 7 | RUN; |
A complete, sequential CNN model architecture is successfully created in the 'product_cnn_model' CAS table. The final model summary should show five layers: 'data' (Input), 'conv1' (Convolution), 'pool1' (Pooling), 'fc1' (FullConnect), and 'output' (Output), connected in that order.