Thanks for sharing your code. I have a question concerning your code to compute validity without correction.
gen_mols, num_mols_wo_correction = gen_mol(x, adj, self.configt.data.data)
num_mols = len(gen_mols)
...
logger.log(f'validity w/o correction: {num_mols_wo_correction / num_mols}')
def gen_mol(x, adj, dataset, largest_connected_comp=True):
# x: 32, 9, 5; adj: 32, 4, 9, 9
x = x.detach().cpu().numpy()
adj = adj.detach().cpu().numpy()
if dataset == 'QM9':
atomic_num_list = [6, 7, 8, 9, 0]
else:
atomic_num_list = [6, 7, 8, 9, 15, 16, 17, 35, 53, 0]
mols, num_no_correct = [], 0
for x_elem, adj_elem in zip(x, adj):
mol = construct_mol(x_elem, adj_elem, atomic_num_list)
cmol, no_correct = correct_mol(mol)
if no_correct: num_no_correct += 1
vcmol = valid_mol_can_with_seg(cmol, largest_connected_comp=largest_connected_comp)
mols.append(vcmol)
mols = [mol for mol in mols if mol is not None]
return mols, num_no_correct
Is that a mistake from the MoFlow paper or is there something I haven't understood ?