Skip to content

Commit

Permalink
Improve printable infos
Browse files Browse the repository at this point in the history
  • Loading branch information
yzhangcs committed Sep 3, 2023
1 parent 1d7d0bb commit bebdd35
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions supar/modules/pretrained.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,13 @@ def __init__(
self.projection = nn.Linear(self.hidden_size, self.n_out, False) if self.hidden_size != n_out else nn.Identity()

def __repr__(self):
s = f"{self.name}, n_layers={self.n_layers}, n_out={self.n_out}, "
s += f"stride={self.stride}, pooling={self.pooling}, pad_index={self.pad_index}"
s = f"{self.name}"
if self.n_layers > 1:
s += f", n_layers={self.n_layers}"
s += f", n_out={self.n_out}, stride={self.stride}"
if self.pooling:
s += f", pooling={self.pooling}"
s += f", pad_index={self.pad_index}"
if self.mix_dropout > 0:
s += f", mix_dropout={self.mix_dropout}"
if self.finetune:
Expand Down

0 comments on commit bebdd35

Please sign in to comment.