BookmarkSubscribeRSS Feed
KJazem
Obsidian | Level 7

Hi. SAS novice here and have a couple of questions regarding migrating existing python code into SAS. Please move this thread if it's in the wrong subforum/topic.

 

I have a model architecture built on python. It's basically a simple model with an input layer, 3 LSTM layer with a dropout in between and an output layer. I went over SAS deeplearn action set documentation, and in general, I managed to do the same model on SAS. Just had a few confusions I hope you can help me with. This is how the layers are set up:

KJazem_1-1662034113367.png

 

  • 1st confusion: First LSTM layer takes the input layer as a srcLayer. Second LSTM however, can't just take the first LSTM layer as a source layer. It also needs something else, and adding the data layer in addition to LSTM layer 1 works. Why is that? I am trying to replicate the return_sequences=True behavior from python. First 2 LSTM layers will have it as True and third as False. 
  • 2nd confusion: for the output layer, my activation is softmax. From python, the output will be a vector of predicted probabilities for the class labels. Will that be the same in this case? How would I store those vectors (when predicting on my test dataset) and find the max argument index to get the predicted class? 
  • 3rd confusion: the input for my model isn't very 'simple'. For every unique ID, we have sequence (varying length, can padding be done?) and in each sequence there are 5 features. So something like this [[A, 2, 0, 0, 1, 0.512], [B, 12, 0, 0, 0, 0.221], [A, 14, 1, 1, 0, 0.741]] for ID 1. How should I reshape that input or what parameters should I have in the input layer to accept this shape and multiple features? There's is no shape parameter in the input layer as far as I've seen, only height and width for image data? 

Apologies for the many questions. Just trying to figure things out.

 

Thank you.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to choose a machine learning algorithm

Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 0 replies
  • 452 views
  • 0 likes
  • 1 in conversation