Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions ERGO.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,8 @@ def predict(args):
pep_atox = {amino: index for index, amino in enumerate(['PAD'] + amino_acids)}
tcr_atox = {amino: index for index, amino in enumerate(amino_acids + ['X'])}

if args.ae_file == 'auto':
args.ae_file = 'TCR_Autoencoder/tcr_ae_dim_30.pt'
# if args.ae_file == 'auto':
args.ae_file = 'TCR_Autoencoder/tcr_ae_dim_100.pt'
if args.model_file == 'auto':
dir = 'models'
p_key = 'protein' if args.protein else ''
Expand Down Expand Up @@ -387,13 +387,13 @@ def predict(args):
# Load model
device = args.device
if args.model_type == 'ae':
model = AutoencoderLSTMClassifier(10, device, 28, 21, 30, 50, args.ae_file, False)
model = AutoencoderLSTMClassifier(10, device, 28, 21, 100, 50, args.ae_file, False)
checkpoint = torch.load(args.model_file, map_location=device)
model.load_state_dict(checkpoint['model_state_dict'])
model.to(device)
model.eval()
if args.model_type == 'lstm':
model = DoubleLSTMClassifier(10, 30, 0.1, device)
model = DoubleLSTMClassifier(10, 500, 0.1, device)
checkpoint = torch.load(args.model_file, map_location=device)
model.load_state_dict(checkpoint['model_state_dict'])
model.to(device)
Expand Down Expand Up @@ -442,4 +442,5 @@ def predict(args):
elif args.function == 'predict':
predict(args)

# example
# python ERGO.py train lstm mcpas specific cuda:0 --model_file=model.pt --train_data_file=train_data --test_data_file=test_data
Loading