jingyimei opened a new pull request #400: DL: modify the logic to get number of 
output units from model_arch table
URL: https://github.com/apache/madlib/pull/400
 
 
   Previously, we always assume in model_arch the last layer contains the
   num_classes(units), which is not necessarily true. An example can be:
   
   ```
   ...
   model.add(Flatten())
   model.add(Dense(512))
   model.add(Activation('relu'))
   model.add(Dropout(0.5))
   model.add(Dense(num_classes))
   model.add(Activation('softmax'))
   
   ```
   
   where activation goes after dense layer and thus we can't get num_class
   from the last layer and our get_num_classes will fail to get units. The 
right way to deal with it
   is to assume the last dense layer contains the right num_classes(may
   need to validate it), and change the logic in our code to start from the
   last layer in model architecture, keep going above until we find the
   dense layer with key 'units' inside.
   
   Co-authored-by: Nandish Jayaram <[email protected]>

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to