From 2ad8500210e8d5ccd331df8805bc84b0a5e90c0d Mon Sep 17 00:00:00 2001 From: hnu202409060624 <2804411502@qq.com> Date: Tue, 31 Dec 2024 12:55:43 +0800 Subject: [PATCH] ADD file via upload --- test.py | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 test.py diff --git a/test.py b/test.py new file mode 100644 index 0000000..1cbc31a --- /dev/null +++ b/test.py @@ -0,0 +1,97 @@ +import torch +import torch.nn.functional as F +import config +import json +import numpy as np +from date_build import Chem_Dataset +model=torch.load('models\model3.1(150).pt') + + +def padding( chemic, lens=config.seq_len): + + while len(chemic) < lens: + chemic.append(0) + return chemic + + +def target_padding( chemical, lens=config.seq_len): + chemical.append(1) + while len(chemical)