-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from tjkessler/dev
Bug fixes, addition of database creation tools
- Loading branch information
Showing
35 changed files
with
2,430 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
# -*- coding: utf-8 -*- | ||
# | ||
# ecnet/data_utils.py | ||
# v.2.0.0 | ||
# v.2.0.1 | ||
# Developed in 2018 by Travis Kessler <[email protected]> | ||
# | ||
# Contains the "DataFrame" class, and functions for processing/importing/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
# -*- coding: utf-8 -*- | ||
# | ||
# ecnet/error_utils.py | ||
# v.2.0.0 | ||
# v.2.0.1 | ||
# Developed in 2018 by Travis Kessler <[email protected]> | ||
# | ||
# Contains functions for error calculations | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
# -*- coding: utf-8 -*- | ||
# | ||
# ecnet/fitness_functions.py | ||
# v.2.0.0 | ||
# v.2.0.1 | ||
# Developed in 2018 by Travis Kessler <[email protected]> | ||
# | ||
# Contains fitness functions used for input dimensionality reduction, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
# -*- coding: utf-8 -*- | ||
# | ||
# ecnet/limit_parameters.py | ||
# v.2.0.0 | ||
# v.2.0.1 | ||
# Developed in 2018 by Travis Kessler <[email protected]> | ||
# | ||
# Contains the functions necessary for reducing the input dimensionality of a | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
# -*- coding: utf-8 -*- | ||
# | ||
# ecnet/error_utils.py | ||
# v.2.0.0 | ||
# v.2.0.1 | ||
# Developed in 2018 by Travis Kessler <[email protected]> | ||
# | ||
# Contains functions necessary creating, training, saving, and reusing neural | ||
|
@@ -19,7 +19,6 @@ | |
from copy import deepcopy | ||
|
||
# 3rd party imports | ||
import tensorflow as tf | ||
from tensorflow import add, global_variables_initializer, matmul, nn | ||
from tensorflow import placeholder, random_normal, reset_default_graph | ||
from tensorflow import Session, square, train, Variable | ||
|
@@ -164,7 +163,7 @@ def fit(self, x_l, y_l, learning_rate=0.1, train_epochs=500, | |
sess.close() | ||
|
||
def fit_validation(self, x_l, y_l, x_v, y_v, learning_rate=0.1, | ||
max_epochs=10000, keep_prob=0.0): | ||
max_epochs=10000, keep_prob=1.0): | ||
'''Fits the neural network model using periodic (every 250 epochs) | ||
validation; if validation set performance does not improve, training | ||
stops | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
# -*- coding: utf-8 -*- | ||
# | ||
# ecnet/server.py | ||
# v.2.0.0 | ||
# v.2.0.1 | ||
# Developed in 2018 by Travis Kessler <[email protected]> | ||
# | ||
# Contains the "Server" class, which handles ECNet project creation, neural | ||
|
@@ -227,7 +227,7 @@ def import_data(self, data_filename, sort_type='random', | |
self.DataFrame.create_sets(random=False) | ||
else: | ||
raise ValueError('Invalid sort_type {}'.format(sort_type)) | ||
self.__sets = self.DataFrame.package_sets() | ||
self._sets = self.DataFrame.package_sets() | ||
self._logger.log( | ||
'info', | ||
'Imported data from {}'.format(data_filename), | ||
|
@@ -290,7 +290,7 @@ def limit_input_parameters(self, limit_num, output_filename=None, | |
self.DataFrame, limit_num, self.vars, logger=self._logger | ||
) | ||
self.DataFrame.set_inputs(params) | ||
self.__sets = self.DataFrame.package_sets() | ||
self._sets = self.DataFrame.package_sets() | ||
if output_filename is not None: | ||
self.DataFrame.save(output_filename) | ||
self._logger.log( | ||
|
@@ -339,7 +339,7 @@ def tune_hyperparameters(self, target_score=None, num_iterations=50, | |
|
||
cost_fn_args = { | ||
'DataFrame': self.DataFrame, | ||
'packaged_data': self.__sets, | ||
'packaged_data': self._sets, | ||
'shuffle': shuffle, | ||
'data_split': data_split, | ||
'num_processes': self.__num_processes, | ||
|
@@ -432,7 +432,7 @@ def train_model(self, validate=False, shuffle=None, | |
) | ||
ecnet.model.train_model( | ||
validate, | ||
self.__sets, | ||
self._sets, | ||
self.vars, | ||
save_path='./tmp/model' | ||
) | ||
|
@@ -465,7 +465,7 @@ def train_model(self, validate=False, shuffle=None, | |
ecnet.model.train_model, | ||
[ | ||
validate, | ||
self.__sets, | ||
self._sets, | ||
self.vars, | ||
model_path | ||
] | ||
|
@@ -480,14 +480,15 @@ def train_model(self, validate=False, shuffle=None, | |
) | ||
ecnet.model.train_model( | ||
validate, | ||
self.__sets, | ||
self._sets, | ||
self.vars, | ||
save_path=model_path | ||
) | ||
if shuffle is not None: | ||
self.DataFrame.shuffle( | ||
shuffle, split=data_split | ||
) | ||
self._sets = self.DataFrame.package_sets() | ||
|
||
if self.__num_processes > 1: | ||
train_pool.close() | ||
|
@@ -752,7 +753,7 @@ def __open_project(self, project_name): | |
self.DataFrame = pload(data_file) | ||
data_file.close() | ||
|
||
self.__sets = self.DataFrame.package_sets() | ||
self._sets = self.DataFrame.package_sets() | ||
self.__using_project = True | ||
self._logger.log( | ||
'info', | ||
|
@@ -775,26 +776,19 @@ def __determine_x_vals(self, dset): | |
'Invalid dset argument: {}'.format(dset) | ||
|
||
if dset == 'test': | ||
return self.__sets.test_x | ||
return self._sets.test_x | ||
elif dset == 'valid': | ||
return self.__sets.valid_x | ||
return self._sets.valid_x | ||
elif dset == 'learn': | ||
return self.__sets.learn_x | ||
return self._sets.learn_x | ||
elif dset == 'train': | ||
x_vals = [] | ||
for val in self.__sets.learn_x: | ||
x_vals.append(val) | ||
for val in self.__sets.valid_x: | ||
x_vals.append(val) | ||
x_vals = [val for val in self._sets.learn_x] | ||
x_vals.extend([val for val in self._sets.valid_x]) | ||
return asarray(x_vals) | ||
elif dset is None: | ||
x_vals = [] | ||
for val in self.__sets.learn_x: | ||
x_vals.append(val) | ||
for val in self.__sets.valid_x: | ||
x_vals.append(val) | ||
for val in self.__sets.test_x: | ||
x_vals.append(val) | ||
x_vals = [val for val in self._sets.learn_x] | ||
x_vals.extend([val for val in self._sets.valid_x]) | ||
x_vals.extend([val for val in self._sets.test_x]) | ||
return asarray(x_vals) | ||
else: | ||
raise ValueError('Unknown dset argument {}'.format(dset)) | ||
|
@@ -814,26 +808,19 @@ def __determine_y_vals(self, dset): | |
'Invalid dset argument: {}'.format(dset) | ||
|
||
if dset == 'test': | ||
return self.__sets.test_y | ||
return self._sets.test_y | ||
elif dset == 'valid': | ||
return self.__sets.valid_y | ||
return self._sets.valid_y | ||
elif dset == 'learn': | ||
return self.__sets.learn_y | ||
return self._sets.learn_y | ||
elif dset == 'train': | ||
y_vals = [] | ||
for val in self.__sets.learn_y: | ||
y_vals.append(val) | ||
for val in self.__sets.valid_y: | ||
y_vals.append(val) | ||
y_vals = [val for val in self._sets.learn_y] | ||
y_vals.extend([val for val in self._sets.valid_y]) | ||
return asarray(y_vals) | ||
elif dset is None: | ||
y_vals = [] | ||
for val in self.__sets.learn_y: | ||
y_vals.append(val) | ||
for val in self.__sets.valid_y: | ||
y_vals.append(val) | ||
for val in self.__sets.test_y: | ||
y_vals.append(val) | ||
y_vals = [val for val in self._sets.learn_y] | ||
y_vals.extend([val for val in self._sets.valid_y]) | ||
y_vals.extend([val for val in self._sets.test_y]) | ||
return asarray(y_vals) | ||
else: | ||
raise ValueError('Unknown dset argument {}'.format(dset)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<Root> | ||
<Group name="2D"> | ||
<Descriptor name="AcidicGroupCount" value="true"/> | ||
<Descriptor name="ALOGP" value="true"/> | ||
<Descriptor name="AminoAcidCount" value="false"/> | ||
<Descriptor name="APol" value="true"/> | ||
<Descriptor name="AromaticAtomsCount" value="true"/> | ||
<Descriptor name="AromaticBondsCount" value="true"/> | ||
<Descriptor name="AtomCount" value="true"/> | ||
<Descriptor name="Autocorrelation" value="true"/> | ||
<Descriptor name="BaryszMatrix" value="true"/> | ||
<Descriptor name="BasicGroupCount" value="true"/> | ||
<Descriptor name="BCUT" value="true"/> | ||
<Descriptor name="BondCount" value="true"/> | ||
<Descriptor name="BPol" value="true"/> | ||
<Descriptor name="BurdenModifiedEigenvalues" value="true"/> | ||
<Descriptor name="CarbonTypes" value="true"/> | ||
<Descriptor name="ChiChain" value="true"/> | ||
<Descriptor name="ChiCluster" value="true"/> | ||
<Descriptor name="ChiPathCluster" value="true"/> | ||
<Descriptor name="ChiPath" value="true"/> | ||
<Descriptor name="Constitutional" value="true"/> | ||
<Descriptor name="Crippen" value="true"/> | ||
<Descriptor name="DetourMatrix" value="true"/> | ||
<Descriptor name="EccentricConnectivityIndex" value="true"/> | ||
<Descriptor name="EStateAtomType" value="true"/> | ||
<Descriptor name="ExtendedTopochemicalAtom" value="true"/> | ||
<Descriptor name="FMF" value="true"/> | ||
<Descriptor name="FragmentComplexity" value="true"/> | ||
<Descriptor name="HBondAcceptorCount" value="true"/> | ||
<Descriptor name="HBondDonorCount" value="true"/> | ||
<Descriptor name="HybridizationRatio" value="true"/> | ||
<Descriptor name="InformationContent" value="true"/> | ||
<Descriptor name="IPMolecularLearning" value="false"/> | ||
<Descriptor name="KappaShapeIndices" value="true"/> | ||
<Descriptor name="KierHallSmarts" value="false"/> | ||
<Descriptor name="LargestChain" value="true"/> | ||
<Descriptor name="LargestPiSystem" value="true"/> | ||
<Descriptor name="LongestAliphaticChain" value="true"/> | ||
<Descriptor name="MannholdLogP" value="true"/> | ||
<Descriptor name="McGowanVolume" value="true"/> | ||
<Descriptor name="MDE" value="true"/> | ||
<Descriptor name="MLFER" value="true"/> | ||
<Descriptor name="PathCount" value="true"/> | ||
<Descriptor name="PetitjeanNumber" value="true"/> | ||
<Descriptor name="RingCount" value="true"/> | ||
<Descriptor name="RotatableBondsCount" value="true"/> | ||
<Descriptor name="RuleOfFive" value="true"/> | ||
<Descriptor name="Topological" value="true"/> | ||
<Descriptor name="TopologicalCharge" value="true"/> | ||
<Descriptor name="TopologicalDistanceMatrix" value="true"/> | ||
<Descriptor name="TPSA" value="true"/> | ||
<Descriptor name="VABC" value="true"/> | ||
<Descriptor name="VAdjMa" value="true"/> | ||
<Descriptor name="WalkCount" value="true"/> | ||
<Descriptor name="Weight" value="true"/> | ||
<Descriptor name="WeightedPath" value="true"/> | ||
<Descriptor name="WienerNumbers" value="true"/> | ||
<Descriptor name="XLogP" value="true"/> | ||
<Descriptor name="ZagrebIndex" value="true"/> | ||
</Group> | ||
<Group name="3D"> | ||
<Descriptor name="Autocorrelation3D" value="true"/> | ||
<Descriptor name="CPSA" value="true"/> | ||
<Descriptor name="GravitationalIndex" value="true"/> | ||
<Descriptor name="LengthOverBreadth" value="true"/> | ||
<Descriptor name="MomentOfInertia" value="true"/> | ||
<Descriptor name="PetitjeanShapeIndex" value="true"/> | ||
<Descriptor name="RDF" value="true"/> | ||
<Descriptor name="WHIM" value="true"/> | ||
</Group> | ||
<Group name="Fingerprint"> | ||
<Descriptor name="Fingerprinter" value="false"/> | ||
<Descriptor name="ExtendedFingerprinter" value="false"/> | ||
<Descriptor name="EStateFingerprinter" value="false"/> | ||
<Descriptor name="GraphOnlyFingerprinter" value="false"/> | ||
<Descriptor name="MACCSFingerprinter" value="false"/> | ||
<Descriptor name="PubchemFingerprinter" value="true"/> | ||
<Descriptor name="SubstructureFingerprinter" value="false"/> | ||
<Descriptor name="SubstructureFingerprintCount" value="false"/> | ||
<Descriptor name="KlekotaRothFingerprinter" value="false"/> | ||
<Descriptor name="KlekotaRothFingerprintCount" value="false"/> | ||
<Descriptor name="AtomPairs2DFingerprinter" value="false"/> | ||
<Descriptor name="AtomPairs2DFingerprintCount" value="false"/> | ||
</Group> | ||
</Root> |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.