Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #create an evaluation model, then load back the model state with the best validation result
- if config["model"] == "knrm":
- modelToEval = KNRM(word_embedder, n_kernels=11)
- elif config["model"] == "conv_knrm":
- modelToEval = Conv_KNRM(word_embedder, n_grams=3, n_kernels=11, conv_out_dim=128)
- elif config["model"] == "match_pyramid":
- 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]])
- modelToEval.load_state_dict(model.state_dict())
- modelToEval = modelToEval.to(device)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement