Skip to content

Commit 7bac6dc

Browse files
committed
Manually merged in commits that cleaned up the epoch count and how to
loop through the active frames and use the sampling density parameter from the frameworks branch into the release_01 branch.
1 parent b612422 commit 7bac6dc

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

Pilot2/P2B1/p2b1.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@
4040
{'name':'set_sel','help':'[3k_Disordered, 3k_Ordered, 3k_Ordered_and_gel, 6k_Disordered, 6k_Ordered, 6k_Ordered_and_gel]','type':str,'default':'3k_Disordered'},
4141
{'name':'conv_bool', 'type':candle.str2bool, 'default':True, 'help':'Invoke training using 1D Convs for inner AE'},
4242
{'name':'full_conv_bool', 'type':candle.str2bool, 'default':False, 'help':'Invoke training using fully convolutional NN for inner AE'},
43-
{'name':'type_bool', 'type':candle.str2bool, 'default':False, 'help':'Include molecule type information in desining AE'},
43+
{'name':'type_bool', 'type':candle.str2bool, 'default':True, 'help':'Include molecule type information in desining AE'},
4444
{'name':'nbr_type', 'type':str, 'default':'relative', 'help':'Defines the type of neighborhood data to use. [relative, invariant]'},
45-
{'name':'backend', 'help':'Keras Backend', 'type':str, 'default':'theano'}
45+
{'name':'backend', 'help':'Keras Backend', 'type':str, 'default':'tensorflow'}
4646
]
4747

4848
required = [
@@ -58,7 +58,6 @@
5858
# note 'cool' is a boolean
5959
'cool',
6060

61-
'molecular_epochs',
6261
'molecular_num_hidden',
6362
'molecular_nonlinearity',
6463
'molecular_nbrs',
@@ -267,7 +266,11 @@ def datagen(self, epoch=0, print_out=1, test=0):
267266
xt_all = np.array([])
268267
yt_all = np.array([])
269268

270-
for i in range(num_frames):
269+
num_active_frames = random.sample(range(num_frames), int(self.sampling_density*num_frames))
270+
271+
print('Datagen on the following frames', num_active_frames)
272+
273+
for i in num_active_frames:
271274

272275
if self.conv_net:
273276
xt = Xnorm[i]
@@ -308,7 +311,7 @@ def datagen(self, epoch=0, print_out=1, test=0):
308311

309312
def train_ac(self):
310313

311-
for i in range(self.mb_epochs):
314+
for i in range(1, self.mb_epochs+1):
312315
print ("\nTraining epoch: {:d}\n".format(i))
313316

314317
frame_loss = []
@@ -322,8 +325,8 @@ def train_ac(self):
322325
encoder_weight_file = '%s/%s.hdf5' % (current_path, 'encoder_weights')
323326

324327
for curr_file, xt_all, yt_all in self.datagen(i):
325-
for frame in random.sample(range(len(xt_all)), int(self.sampling_density*len(xt_all))):
326-
328+
#for frame in random.sample(range(len(xt_all)), int(self.sampling_density*len(xt_all))):
329+
for frame in range(len(xt_all)):
327330
history = self.molecular_model.fit(xt_all[frame], yt_all[frame], epochs=1,
328331
batch_size=self.batch_size, callbacks=self.callbacks[:2],
329332
verbose=0)

Pilot2/P2B1/p2b1_baseline_keras2.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828

2929
HOME = os.environ['HOME']
3030

31-
3231
def parse_list(option, opt, value, parser):
3332
setattr(parser.values, option.dest, value.split(','))
3433

@@ -163,7 +162,7 @@ def run(GP):
163162
type_feat_vect = []
164163
else:
165164
num_type_features = 5
166-
type_feat_vect = fields.keys()[3:8]
165+
type_feat_vect = list(fields.keys())[3:8]
167166

168167
num_features = num_loc_features + num_type_features + num_beads
169168
dim = np.prod([num_beads, num_features, molecular_nbrs+1])
@@ -226,7 +225,7 @@ def run(GP):
226225
molecular_model.summary()
227226
##### set up callbacks and cooling for the molecular_model ##########
228227
drop = 0.5
229-
mb_epochs = GP['molecular_epochs']
228+
mb_epochs = GP['epochs']
230229
initial_lrate = GP['learning_rate']
231230
epochs_drop = 1+int(np.floor(mb_epochs/3))
232231

Pilot2/P2B1/p2b1_default_model.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ activation='relu'
1212
molecular_nonlinearity='elu'
1313
molecular_num_hidden=[256, 128, 64, 32, 16, 8]
1414
molecular_nbrs = 10
15-
molecular_epochs=1
1615
base_memo='p2b1'
1716
drop_prob = 0.5
1817
data_set='3k_Ordered'
19-
sampling_density = 0.01
18+
sampling_density = 0.05
2019
save_path='.'

README.setup.linux

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ conda install -c conda-forge keras=2
2222
conda install -c anaconda pandas
2323
conda install -c anaconda scikit-learn
2424
conda install -c anaconda matplotlib
25+
---conda install -c conda-forge pygpu
2526

2627
# Install additional modules for Pilot2 benchmarks
2728
conda install -c conda-forge opencv

0 commit comments

Comments
 (0)