-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadd_args.py
49 lines (46 loc) · 2.11 KB
/
add_args.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
def add_bigram_args(parser):
"""
Pass hyperparameters to the model from cmd line
"""
# System Hyperparameters
parser.add_argument("--data_name", type=str, default="wsj_bigram", help="data name")
parser.add_argument("--random_seed", type=int, default=0, help="random seed")
parser.add_argument(
"--test",
default=False,
action="store_true",
help="Test with smaller infersent embeddings",
)
parser.add_argument("--batch_size", type=int, default=128, help="batch_size")
parser.add_argument(
"--save", default=True, action="store_true", help="whether to save the model"
)
parser.add_argument(
"--portion", type=float, default=1.0, help="portion of negative samples to use"
)
# Model Hyperparameters
parser.add_argument("--loss", type=str, default="margin", help="training loss")
parser.add_argument(
"--input_dropout", type=float, default=0.6, help="input_dropout"
)
parser.add_argument("--hidden_state", type=int, default=500, help="hidden_state")
parser.add_argument("--hidden_layers", type=int, default=1, help="hidden_layers")
parser.add_argument(
"--hidden_dropout", type=float, default=0.3, help="hidden_dropout"
)
parser.add_argument("--num_epochs", type=int, default=50, help="num_epochs")
parser.add_argument("--margin", type=float, default=5.0, help="margin")
parser.add_argument("--lr", type=float, default=0.001, help="learning rate")
parser.add_argument(
"--l2_reg_lambda", type=float, default=0.0, help="l2_reg_lambda"
)
parser.add_argument("--use_bn", default=False, action="store_true", help="use_bn")
parser.add_argument("--embed_dim", type=int, default=100, help="embedi_dim")
parser.add_argument("--dpout_model", type=float, default=0.0, help="dpout_model")
parser.add_argument(
"--sent_encoder", type=str, default="sbert", help="sent_encoder"
)
parser.add_argument(
"--bidirectional", default=False, action="store_true", help="bidirectional"
)
parser.add_argument("--note", type=str, default="", help="human readable")