Skip to content

Commit

Permalink
added requirements.txt, small modifications to allow for Python 3 and…
Browse files Browse the repository at this point in the history
… TensorFlow 2.0
  • Loading branch information
StSchulze committed May 8, 2019
1 parent 9e31d54 commit 4cf9fb4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion deepnovo_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
'V': 99.06841, # 19
}

mass_ID = [mass_AA[vocab_reverse[x]] for x in xrange(vocab_size)]
mass_ID = [mass_AA[vocab_reverse[x]] for x in range(vocab_size)]
mass_ID_np = np.array(mass_ID, dtype=np.float32)

mass_AA_min = mass_AA["G"] # 57.02146
Expand Down
6 changes: 3 additions & 3 deletions deepnovo_main_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import sys
import time
import re
import resource
# import resource

import numpy as np
#~ cimport numpy as np
Expand Down Expand Up @@ -2481,8 +2481,8 @@ def train():

#~ gc .collect()

print("RESOURCE-train_cycle: ",
resource.getrusage(resource.RUSAGE_SELF).ru_maxrss / 1000)
print("RESOURCE-train_cycle")
# resource.getrusage(resource.RUSAGE_SELF).ru_maxrss / 1000)

# stop training if >= 50 epochs
epoch = (model.global_step.eval()
Expand Down
9 changes: 5 additions & 4 deletions deepnovo_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import embedding_ops
from tensorflow.python.ops import rnn_cell
from tensorflow.python.ops import rnn_cell_impl
# from tensorflow.python.ops import rnn_cell_impl
from tensorflow.python.ops import variable_scope
from tensorflow.contrib.rnn.python.ops import core_rnn_cell

import deepnovo_config
import deepnovo_model_training
Expand Down Expand Up @@ -334,7 +335,7 @@ def build_network(self, input_dict, dropout_keep):
# linear transform to logit [128, 26]
# TODO(nh2tran): replace _linear and remove scope
with tf.variable_scope("output_logit"):
feature_logit = rnn_cell_impl._linear(args=feature,
feature_logit = core_rnn_cell._linear(args=feature,
output_size=self.vocab_size,
bias=True,
bias_initializer=None,#0.1,
Expand Down Expand Up @@ -437,7 +438,7 @@ def _build_cnn_ion(self, input_intensity, direction):
# linear transform to logit [128, 26], in case only cnn_ion model is used
# TODO(nh2tran): replace _linear and remove scope
with tf.variable_scope("intensity_output_projected"):
cnn_ion_logit = rnn_cell_impl._linear(args=cnn_ion_feature,
cnn_ion_logit = core_rnn_cell._linear(args=cnn_ion_feature,
output_size=self.vocab_size,
bias=True,
bias_initializer=None,#0.1,
Expand Down Expand Up @@ -616,7 +617,7 @@ def _build_lstm(self, cnn_spectrum, input_lstm_state, embedding_AAid, direction)
# linear transform to logit [128, 26], in case only lstm model is used
# TODO(nh2tran): replace _linear and remove scope
with tf.variable_scope("lstm_output_projected"):
lstm_logit = rnn_cell_impl._linear(
lstm_logit = core_rnn_cell._linear(
args=lstm_feature,
output_size=self.vocab_size,
bias=True,
Expand Down
7 changes: 7 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cython
tensorflow
lxml
numpy
matplotlib
pyteomics
biopython

0 comments on commit 4cf9fb4

Please sign in to comment.