Skip to content

Commit

Permalink
Update Dataset.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhuLvs authored Nov 27, 2024
1 parent d19f65f commit a021e28
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions model/Dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def __getitem__(self, idx):
img = None

matrix = pd.read_csv(csv_path, skiprows=1, header=None).values.astype(np.float32)
# 计算残基个数

residue_count = np.count_nonzero(matrix[0, :]) + 1

return img, torch.tensor(matrix), torch.tensor(residue_count, dtype=torch.float32)
Expand Down Expand Up @@ -101,4 +101,4 @@ def forward(self, x):
out = torch.bmm(value, attention.permute(0, 2, 1))
out = out.view(batch_size, channels, height, width)

return out + x # skip connection
return out + x # skip connection

0 comments on commit a021e28

Please sign in to comment.