Skip to content

Instantly share code, notes, and snippets.

@NP-chaonay
Created September 10, 2020 13:55
Show Gist options
  • Save NP-chaonay/919e7862df48461e233c5f60a3dc9f66 to your computer and use it in GitHub Desktop.
Save NP-chaonay/919e7862df48461e233c5f60a3dc9f66 to your computer and use it in GitHub Desktop.
Snippet for ML/DL/AI
# Check for data entries amount of dense layer (count weight+bias+output)
def dense_layer_datanum(in_shape,dense_out,axis=-1):
in_shape=list(in_shape)
dense_in=in_shape[axis]
in_shape[axis]=dense_out
result_out=1
for i in in_shape: result_out*=i
return (dense_in+1)*dense_out+result_out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment