diff --git a/Pilot2/P2B1/p2b1.py b/Pilot2/P2B1/p2b1.py index 66d69562..46634b47 100755 --- a/Pilot2/P2B1/p2b1.py +++ b/Pilot2/P2B1/p2b1.py @@ -254,6 +254,7 @@ def datagen(self, epoch=0, print_out=1, test=0): if print_out: print (files[f_ind], '\n') + print (files[f_ind], '\n') (X, nbrs, resnums) = helper.get_data_arrays(files[f_ind]) # normalizing the location coordinates and bond lengths and scale type encoding @@ -269,8 +270,13 @@ def datagen(self, epoch=0, print_out=1, test=0): xt_all = np.array([]) yt_all = np.array([]) + frames_all = np.array([]) - for i in range(num_frames): + num_active_frames = random.sample(range(num_frames), + int(self.sampling_density*num_frames)) + print ('Formating on the following frames', self.num_active_frames) + print ('Datagen on the following frames', num_active_frames) + for i in num_active_frames: if self.conv_net: xt = Xnorm[i] @@ -325,7 +331,10 @@ def train_ac(self): encoder_weight_file = '%s/%s.hdf5' % (current_path, 'encoder_weights') for curr_file, xt_all, yt_all in self.datagen(i): - for frame in random.sample(range(len(xt_all)), int(self.sampling_density*len(xt_all))): + print ('Training on the following frames', xt_all) + for frame in self.num_active_frames: +# for frame in random.sample(range(len(xt_all)), int(self.sampling_density*len(xt_all))): +# for frame in range(xt_all): history = self.molecular_model.fit(xt_all[frame], yt_all[frame], epochs=1, batch_size=self.batch_size, callbacks=self.callbacks[:2],