BreakOutLYS

Results 1 comments of BreakOutLYS

def predict(config,model,data_iter): model.load_state_dict(torch.load(config.save_path)) model.eval() predict_all = np.array([],dtype=int) with torch.no_grad(): for texts,labels in data_iter: outputs = model(texts) predic = torch.max(outputs.data,1)[1].cpu().numpy() predict_all = np.append(predict_all,predic) return predict_all