Advertisement
Dundre32

Untitled

Jun 19th, 2020
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. #create an evaluation model, then load back the model state with the best validation result
  2. if config["model"] == "knrm":
  3. modelToEval = KNRM(word_embedder, n_kernels=11)
  4. elif config["model"] == "conv_knrm":
  5. modelToEval = Conv_KNRM(word_embedder, n_grams=3, n_kernels=11, conv_out_dim=128)
  6. elif config["model"] == "match_pyramid":
  7. modelToEval = MatchPyramid(word_embedder, conv_output_size=[16,16,16,16,16], conv_kernel_size=[[3,3],[3,3],[3,3],[3,3],[3,3]], adaptive_pooling_size=[[36,90],[18,60],[9,30],[6,20],[3,10]])
  8. modelToEval.load_state_dict(model.state_dict())
  9. modelToEval = modelToEval.to(device)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement