Skip to content

Commit

Permalink
feat(arg_parse): added dropout_prot and pro_emb_dim
Browse files Browse the repository at this point in the history
  • Loading branch information
jyaacoub committed Dec 18, 2023
1 parent ae9aa8a commit e85aaa1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/train_test/distributed.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ def dtrain(args):
print(f"-------------- HYPERPARAMETERS -----------")
print(f" Learning rate: {args.learning_rate}")
print(f" Dropout: {args.dropout}")
print(f" dropout_prot: {args.dropout_prot}")
print(f" pro_emb_dim: {args.pro_emb_dim}")
print(f" Num epochs: {args.num_epochs}\n")

print(f"----------------- DISTRIBUTED ARGS -----------------")
Expand Down Expand Up @@ -87,7 +89,10 @@ def dtrain(args):
# ==== Load model ====
# args.gpu is the local rank for this process
model = Loader.init_model(model=MODEL, pro_feature=FEATURE, pro_edge=EDGEW,
dropout=args.dropout).cuda(args.gpu)
dropout=args.dropout,
dropout_prot=args.dropout_prot,
pro_emb_dim=args.pro_emb_dim).cuda(args.gpu)

cp_saver = CheckpointSaver(model=model, save_path=f'{cfg.MODEL_SAVE_DIR}/{MODEL_KEY}.model',
train_all=False,
patience=50, min_delta=0.2,
Expand Down
11 changes: 11 additions & 0 deletions src/utils/arg_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,17 @@ def add_hyperparam_args(parser: argparse.ArgumentParser):
action='store', type=float, default=0.4,
help='Dropout rate for training (default: 0.4)'
)
parser.add_argument('-dop',
'--dropout_prot',
action='store', type=float, default=0.4,
help='Dropout rate for protein GCN branch for training (default: 0.4)'
)
parser.add_argument('-embP',
'--pro_emb_dim',
action='stor', type=int, default=128,
help='Embedding dimension for protein GCN branch for training (default: 128)'
)

parser.add_argument('-ne',
'--num_epochs',
action='store', type=int, default=2000,
Expand Down

0 comments on commit e85aaa1

Please sign in to comment.