def __init__(self, net1, net2): super().__init__() #HNN_base._obj_count += 1 #assert (HNN_base._obj_count == 1), type(self).__name__ + " has more than one object" self.net1 = net1 # network for dHdq1 self.net2 = net2 # network for dHdq2 # append term to calculate dHdq super().append(lennard_jones()) super().append(kinetic_energy()) # dhdq1 self.sumRx1 = 0. # set 0 to sum Rx over batch size self.sumRy1 = 0. # set 0 to sum Ry over batch size self.R_cnt1 = 0. # count the number of batch size # dhdq2 self.sumRx2 = 0. # set 0 to sum Rx over batch size self.sumRy2 = 0. # set 0 to sum Ry over batch size self.R_cnt2 = 0. # count the number of batch size print('HNN_base initialized') self.dt = 0 # set 0
def __init__(self, fhnn, pwhnn): super().__init__() self.fhnn = fhnn self.pwhnn = pwhnn super().append(lennard_jones()) super().append(kinetic_energy())
def __init__(self): noML_hamiltonian._obj_count += 1 assert (noML_hamiltonian._obj_count == 1), type(self).__name__ + " has more than one object" super().__init__() super().append(lennard_jones()) super().append(kinetic_energy()) print('noML_hamiltonian initialized')