Skip to content

Commit

Permalink
Merge pull request #20 from tjkessler/dev
Browse files Browse the repository at this point in the history
Bug fixes, addition of database creation tools
  • Loading branch information
tjkessler authored Jan 22, 2019
2 parents fd3f508 + f78627a commit d6b6bb9
Show file tree
Hide file tree
Showing 35 changed files with 2,430 additions and 47 deletions.
2 changes: 1 addition & 1 deletion ecnet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
import ecnet.error_utils
import ecnet.model
import ecnet.limit_parameters
__version__ = '2.0.0'
__version__ = '2.0.1'
2 changes: 1 addition & 1 deletion ecnet/data_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
2 changes: 1 addition & 1 deletion ecnet/error_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ecnet/fitness_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion ecnet/limit_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions ecnet/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
63 changes: 25 additions & 38 deletions ecnet/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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'
)
Expand Down Expand Up @@ -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
]
Expand All @@ -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()
Expand Down Expand Up @@ -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',
Expand All @@ -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))
Expand All @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='ecnet',
version='2.0.0',
version='2.0.1',
description='UMass Lowell Energy and Combustion Research Laboratory Neural Network Software',
url='http://github.com/tjkessler/ecnet',
author='Travis Kessler, Hernan Gelaf-Romer, Sanskriti Sharma',
Expand Down
Binary file added tools/PaDEL-Descriptor/Descriptors.xls
Binary file not shown.
Binary file added tools/PaDEL-Descriptor/PaDEL-Descriptor.jar
Binary file not shown.
86 changes: 86 additions & 0 deletions tools/PaDEL-Descriptor/descriptors.xml
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 added tools/PaDEL-Descriptor/lib/cdk-1.4.15.jar
Binary file not shown.
Binary file added tools/PaDEL-Descriptor/lib/commons-cli-1.2.jar
Binary file not shown.
Binary file added tools/PaDEL-Descriptor/lib/guava-17.0.jar
Binary file not shown.
Binary file added tools/PaDEL-Descriptor/lib/jama.jar
Binary file not shown.
Binary file added tools/PaDEL-Descriptor/lib/jgrapht-0.6.0.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added tools/PaDEL-Descriptor/lib/libPaDEL-Jobs.jar
Binary file not shown.
Binary file added tools/PaDEL-Descriptor/lib/libPaDEL.jar
Binary file not shown.
Binary file not shown.
Binary file added tools/PaDEL-Descriptor/lib/vecmath1.2-1.14.jar
Binary file not shown.
Binary file added tools/PaDEL-Descriptor/lib/xom-1.1.jar
Binary file not shown.
Loading

0 comments on commit d6b6bb9

Please sign in to comment.