linkedin / detext

DeText: A Deep Neural Text Understanding Framework for Ranking and Classification Tasks
BSD 2-Clause "Simplified" License
1.26k stars 133 forks source link

add total params to logging #22

Closed xwli-chelsea closed 4 years ago

xwli-chelsea commented 4 years ago

Description

Add total trainable params count to logging file network_structure.txt

Fixes # (issue)

Type of change

Please delete options that are not relevant.

List all changes

Please list all changes in the commit.

Testing

local test: network_structure.txt for toy example run:

# Trainable variables
  w_pretrained_embedding:0, (14, 32), /device:CPU:0
  cnn/query_cnn_3/kernel:0, (3, 32, 1, 50), /device:CPU:0
  cnn/query_cnn_3/bias:0, (50,), /device:CPU:0
  cnn/doc_cnn_0_3/kernel:0, (3, 32, 1, 50), /device:CPU:0
  cnn/doc_cnn_0_3/bias:0, (50,), /device:CPU:0
  wide_ftr_norm_w:0, (10,), /device:CPU:0
  wide_ftr_norm_b:0, (10,), /device:CPU:0
  hidden_projection_0/kernel:0, (11, 100), /device:CPU:0
  hidden_projection_0/bias:0, (100,), /device:CPU:0
  scoring/kernel:0, (100, 1), /device:CPU:0
  scoring/bias:0, (1,), /device:CPU:0

# Total trainable params: 11469
# Out of the total trainable params, the total cnn parameters: 9700

Test Configuration:

Checklist

StarWang commented 4 years ago

LGTM. Thanks!