code
stringlengths
3
6.57k
self.model.predict(x,batch_size)
train(self,model)
model.load_weights("cifar10vgg.h5")
cifar10.load_data()
x_train.astype('float32')
x_test.astype('float32')
self.normalize(x_train, x_test)
keras.utils.to_categorical(y_train, self.num_classes)
keras.utils.to_categorical(y_test, self.num_classes)
lr_scheduler(epoch)
keras.callbacks.LearningRateScheduler(lr_scheduler)
range (degrees, 0 to 180)
horizontally (fraction of total width)
vertically (fraction of total height)
datagen.fit(x_train)
optimizers.SGD(lr=learning_rate, decay=lr_decay, momentum=0.9, nesterov=True)
model.compile(loss='categorical_crossentropy', optimizer=sgd,metrics=['accuracy'])
model.save_weights('cifar10vgg.h5')
cifar10.load_data()
x_train.astype('float32')
x_test.astype('float32')
keras.utils.to_categorical(y_train, 10)
keras.utils.to_categorical(y_test, 10)
cifar10vgg()
model.predict(x_test)
np.argmax(predicted_x,1)
np.argmax(y_test,1)
sum(residuals)
len(residuals)
print("the validation 0/1 loss is: ",loss)
get_EF_atom_indices(atoms)
NeighborList(natural_cutoffs(atoms)
nl.update(atoms)
np.concatenate((nl.get_neighbors(index_Al[0])
nl.get_neighbors(index_Al[1])
np.concatenate((nl.get_neighbors(index_EF_TM[0])
nl.get_neighbors(index_EF_TM[1])
list(TM_neigh_list)
count(x)
get_capped_cluster(atoms, folder_path, file_name, save_traj, EF_O_index)
capping (remove all caps for now, does not need this cluster to be physical)
cluster (the later two output index lists share the ordering)
ExtraFrameworkAnalyzer(atoms)
EFMaker.get_extraframework_cluster(EF_O_index)
get_EF_atom_indices(cluster)
cluster.get_positions()
EFMaker.recentering_atoms(cluster, centering_pos)
Zeolite(cluster)
cap_atoms()
proteindatabank.write_proteindatabank(folder_path + '/%s.pdb' % file_name, recentered_cluster)
write(folder_path + '/%s.traj' % file_name, recentered_cluster)
EFMaker.get_extraframework_cluster(EF_O_index)
label_pdb(folder_path, file_name, del_unlabeled_pdb)
file. (required step for openMM)
open(folder_path + '/%s.pdb' % file_name, 'r')
open(folder_path + '/%s_labeled.pdb' % file_name, 'w')
filein.readlines()
line.startswith('ATOM')
line.startswith('HETATM')
strip()
name_list.append(name)
str(name_list.count(name)
name.rjust(4)
line.replace(line[12:16], name, 1)
fileout.writelines(line)
filein.close()
fileout.close()
os.remove(folder_path + '/%s.pdb' % file_name)
get_bonds(cluster, mult=1, excluded_index=None, excluded_pair=None)
user (excluded_pair)
indices (excluded_index)
NeighborList(natural_cutoffs(cluster, mult=mult)
nl.update(cluster)
enumerate(Analysis(cluster, nl=nl)
bond_list.append([count, index])
all(single_index not in bond for single_index in excluded_index)
all(tuple(bond)
list(permutations(pair)
shortened_list.append(bond)
get_angles(cluster, mult=1, excluded_index=None, excluded_pair=None)
NeighborList(natural_cutoffs(cluster, mult=mult)
nl.update(cluster)
enumerate(Analysis(cluster, nl=nl)
all(list(val)
list(permutations([count, index[0], index[1]])
angle_list.append([count, index[0], index[1]])
all(single_index not in angle for single_index in excluded_index)
all(list(value)
list(permutations(angle, 2)
shortened_list.append(angle)
write_xml(atoms, bonds, save_as)
etree.Element('ForceField')
etree.SubElement(root, "AtomTypes")
join(filter(lambda x: not x.isdigit()
str(atomic_mass)
str(atomic_mass)
etree.SubElement(xml_section, 'Type', **properties)
etree.SubElement(root, 'Residues')
etree.SubElement(xml_section, 'Residue', name='MOL')
etree.SubElement(xml_residue, 'Atom', name=atom.name, type=atom.name)