Created
November 17, 2020 07:46
-
-
Save naviocean/37d5cb35b4dff4541c6598ac152ffaf7 to your computer and use it in GitHub Desktop.
Revisions
-
naviocean renamed this gist
Nov 17, 2020 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ # reference # https://discuss.pytorch.org/t/how-do-i-check-the-number-of-parameters-of-a-model/4325 def get_n_params(model): @@ -12,4 +12,3 @@ def get_n_params(model): model = LambdaResNet50() print(get_n_params(model)) # 14.9M (Ours) / 15M(Paper) -
naviocean created this gist
Nov 17, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ ``` # reference # https://discuss.pytorch.org/t/how-do-i-check-the-number-of-parameters-of-a-model/4325 def get_n_params(model): pp=0 for p in list(model.parameters()): nn=1 for s in list(p.size()): nn = nn*s pp += nn return pp model = LambdaResNet50() print(get_n_params(model)) # 14.9M (Ours) / 15M(Paper) ```