From 24cdc4958c1d833ab10fc8d1c72d81fb86ef5d8f Mon Sep 17 00:00:00 2001 From: Mike Clark Date: Wed, 5 Jun 2019 05:39:12 +0000 Subject: [PATCH] Show changed outputs --- README.md | 55 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 31 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index e9c8ef1..1f14a14 100644 --- a/README.md +++ b/README.md @@ -36,18 +36,19 @@ class Net(nn.Module): summary(Net(), torch.zeros((1, 1, 28, 28))) ``` ``` ----------------------------------------------------------------------------------------------------- -Layer Kernel Shape Output Shape # Params (K) # Mult-Adds (M) ==================================================================================================== -0_Conv2d [1, 10, 5, 5] [1, 10, 24, 24] 0.26 0.14 -1_Conv2d [10, 20, 5, 5] [1, 20, 8, 8] 5.02 0.32 -2_Dropout2d - [1, 20, 8, 8] - - -3_Linear [320, 50] [1, 50] 16.05 0.02 -4_Linear [50, 10] [1, 10] 0.51 0.00 + Kernel Shape Output Shape Params (K) Mult-Adds (M) +Layer +0_conv1 [1, 10, 5, 5] [1, 10, 24, 24] 0.26 0.1440 +1_conv2 [10, 20, 5, 5] [1, 20, 8, 8] 5.02 0.3200 +2_conv2_drop - [1, 20, 8, 8] NaN NaN +3_fc1 [320, 50] [1, 50] 16.05 0.0160 +4_fc2 [50, 10] [1, 10] 0.51 0.0005 +==================================================================================================== +Params (K) 21.8400 +Mult-Adds (M) 0.4805 +dtype: float64 ==================================================================================================== -# Params: 21.84K -# Mult-Adds: 0.48M ----------------------------------------------------------------------------------------------------- ``` RNN @@ -74,20 +75,18 @@ inputs = torch.zeros((100, 1), dtype=torch.long) # [length, batch_size] summary(Net(), inputs) ``` ``` ----------------------------------------------------------------------------------------------------- -Layer Kernel Shape Output Shape # Params (K) # Mult-Adds (M) ==================================================================================================== -0_Embedding [300, 20] [100, 1, 300] 6.00 0.01 -1_LSTM - [100, 1, 512] 3,768.32 3.76 - weight_ih_l0 [2048, 300] - weight_hh_l0 [2048, 512] - weight_ih_l1 [2048, 512] - weight_hh_l1 [2048, 512] -2_Linear [512, 20] [100, 1, 20] 10.26 0.01 + Kernel Shape Output Shape Params (K) Mult-Adds (M) +Layer +0_embedding [300, 20] [100, 1, 300] 6.00 0.006000 +1_encoder - [100, 1, 512] 3768.32 3.760128 +2_decoder [512, 20] [100, 1, 20] 10.26 0.010240 ==================================================================================================== -# Params: 3,784.58K -# Mult-Adds: 3.78M ----------------------------------------------------------------------------------------------------- +Params (K) 3784.580000 +Mult-Adds (M) 3.776368 +dtype: float64 +==================================================================================================== + ``` Recursive NN @@ -107,8 +106,16 @@ summary(Net(), torch.zeros((1, 64, 28, 28))) ---------------------------------------------------------------------------------------------------- Layer Kernel Shape Output Shape # Params (K) # Mult-Adds (M) ==================================================================================================== -0_Conv2d [64, 64, 3, 3] [1, 64, 28, 28] 36.93 28.90 -1_Conv2d [64, 64, 3, 3] [1, 64, 28, 28] (recursive) 28.90 + Kernel Shape Output Shape Params (K) Mult-Adds (M) +Layer +0_conv1 [64, 64, 3, 3] [1, 64, 28, 28] 36.928 28.901376 +1_conv1 [64, 64, 3, 3] [1, 64, 28, 28] NaN 28.901376 +==================================================================================================== +Kernel Shape [64, 64, 3, 3, 64, 64, 3, 3] +Output Shape [1, 64, 28, 28, 1, 64, 28, 28] +Params (K) 36.928 +Mult-Adds (M) 57.8028 +dtype: object ==================================================================================================== # Params: 36.93K # Mult-Adds: 57.80M