Skip to content

Commit 99fcca3

Browse files
committed
cleanup TODO list
1 parent 3bc6f7b commit 99fcca3

File tree

5 files changed

+19
-20
lines changed

5 files changed

+19
-20
lines changed

corl/wc_data/input_fn.py

+1
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,7 @@ def getWorkloadForPredictionFromTags(corl_prior, max_step, time_shift, host, por
631631
'''
632632
Returns list of tuples (code, date, klid)
633633
'''
634+
# TODO need to compare corl_prior and max_step with snapshot values in db (secu.params), and opt to re-initialize tag table if 2 versions differ.
634635
global cnxpool
635636
_init_db(1, host, port, pwd)
636637
cnx = cnxpool.get_connection()

corl/wcc/worker.py

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040

4141

4242
def _init(db_pool_size=None, db_host=None, db_port=None, db_pwd=None):
43-
# FIXME too many db initialization message in the log and 'aborted clients' in mysql dashboard
4443
global cnxpool
4544
size = db_pool_size or 5
4645
print("{} initializing mysql connection pool of size {}".format(

pstk/data/data15.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
2-
31
import os
42
import sys
53
import psutil
@@ -10,6 +8,8 @@
108
from time import strftime
119
from mysql.connector.pooling import MySQLConnectionPool
1210

11+
#TODO establish data pipeline prototype for stock trend prediction
12+
1313
k_cols = ["lr"]
1414

1515
idxlst = None

pstk/model/model2.py

+14-14
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def wrapper(self):
3939

4040

4141
def length(data):
42-
# with tf.variable_scope("rnn_length"): #FIXME no scope?
42+
# with tf.variable_scope("rnn_length"):
4343
used = tf.sign(tf.reduce_max(input_tensor=tf.abs(data), axis=2))
4444
length = tf.reduce_sum(input_tensor=used, axis=1)
4545
length = tf.cast(length, tf.int32)
@@ -52,7 +52,7 @@ def fusedBN(input, scale, offset, mean, variance, training):
5252

5353

5454
def last_relevant(output, length):
55-
# with tf.variable_scope("rnn_last"): #FIXME no scope?
55+
# with tf.variable_scope("rnn_last"):
5656
batch_size = tf.shape(input=output)[0]
5757
max_length = int(output.get_shape()[1])
5858
output_size = int(output.get_shape()[2])
@@ -64,19 +64,19 @@ def last_relevant(output, length):
6464

6565
def conv2d(input, filters, seq):
6666
conv = tf.compat.v1.layers.conv2d(
67-
# name="conv_lv{}".format(seq), #FIXME perhaps no name?
67+
# name="conv_lv{}".format(seq),
6868
inputs=input,
6969
filters=filters,
7070
kernel_size=2,
7171
kernel_initializer=tf.compat.v1.truncated_normal_initializer(
7272
stddev=0.01),
7373
bias_initializer=tf.compat.v1.constant_initializer(0.1),
7474
padding="same",
75-
activation=tf.nn.elu) # FIXME or perhaps relu6??
75+
activation=tf.nn.elu)
7676
h_stride = 2 if int(conv.get_shape()[1]) >= 2 else 1
7777
w_stride = 2 if int(conv.get_shape()[2]) >= 2 else 1
7878
pool = tf.compat.v1.layers.max_pooling2d(
79-
# name="pool_lv{}".format(seq), #FIXME perhaps no name?
79+
# name="pool_lv{}".format(seq),
8080
inputs=conv, pool_size=2, strides=[h_stride, w_stride],
8181
padding="same")
8282
# can't use tf.nn.batch_normalization in a mapped function
@@ -119,33 +119,33 @@ def prediction(self):
119119
rnn = self.rnn(self, cnn)
120120
dense = tf.compat.v1.layers.dense(
121121
inputs=rnn,
122-
units=self._num_hidden * 3, # FIXME fallback to 3 * hidden size?
122+
units=self._num_hidden * 3,
123123
kernel_initializer=tf.compat.v1.truncated_normal_initializer(stddev=0.01),
124124
bias_initializer=tf.compat.v1.constant_initializer(0.1),
125-
activation=tf.nn.elu) # FIXME sure elu?
125+
activation=tf.nn.elu)
126126
dropout = tf.compat.v1.layers.dropout(
127127
inputs=dense, rate=0.5, training=self.training)
128128
output = tf.compat.v1.layers.dense(
129129
inputs=dropout,
130130
units=int(self.target.get_shape()[1]),
131131
kernel_initializer=tf.compat.v1.truncated_normal_initializer(stddev=0.01),
132132
bias_initializer=tf.compat.v1.constant_initializer(0.1),
133-
activation=tf.nn.relu6) # FIXME fall back to relu6?
133+
activation=tf.nn.relu6)
134134
return output
135135

136136
@staticmethod
137137
def rnn(self, input):
138138
# Recurrent network.
139139
cells = []
140-
state_size = self._num_hidden # FIXME fallback to 128
140+
state_size = self._num_hidden
141141
for _ in range(self._num_layers):
142142
# Or LSTMCell(num_units), or use ConvLSTMCell?
143143
cell = tf.compat.v1.nn.rnn_cell.GRUCell(
144144
state_size,
145145
kernel_initializer=tf.compat.v1.truncated_normal_initializer(
146146
stddev=0.01),
147147
bias_initializer=tf.compat.v1.constant_initializer(0.1))
148-
# activation=None) # FIXME fall back to None?
148+
# activation=None)
149149
cells.append(cell)
150150
cell = tf.compat.v1.nn.rnn_cell.MultiRNNCell(cells)
151151
_length = length(input)
@@ -167,7 +167,7 @@ def cnn2d(input, training, height):
167167
accepts input shape: [step_size, time_shift*features]
168168
transformed to: [step_size, time_shift(height), features(width), channel]
169169
"""
170-
# with tf.variable_scope("conv2d_parent"): #FIXME no scope?
170+
# with tf.variable_scope("conv2d_parent"):
171171
print("shape of cnn input: {}".format(input.get_shape()))
172172
width = int(input.get_shape()[1])//height
173173
input2d = tf.reshape(input, [-1, height, width, 1])
@@ -191,17 +191,17 @@ def cnn2d(input, training, height):
191191
convlayer = tf.squeeze(convlayer, [1, 2])
192192
print("squeeze: {}".format(convlayer.get_shape()))
193193
dense = tf.compat.v1.layers.dense(
194-
# name="cnn2d_dense", #FIXME no name?
194+
# name="cnn2d_dense",
195195
inputs=convlayer,
196196
units=convlayer.get_shape()[1]*2,
197197
kernel_initializer=tf.compat.v1.truncated_normal_initializer(
198198
stddev=0.01),
199199
bias_initializer=tf.compat.v1.constant_initializer(0.1),
200-
activation=tf.nn.elu # FIXME or perhaps elu?
200+
activation=tf.nn.elu
201201
)
202202
print("dense: {}".format(dense.get_shape()))
203203
dropout = tf.compat.v1.layers.dropout(
204-
# name="cnn2d_dropout", #FIXME no name?
204+
# name="cnn2d_dropout",
205205
inputs=dense, rate=0.5, training=training)
206206
return dropout
207207

test/test24_mdnc.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
from model import dnc_regressor
44
from common.common import next_power_of_2
55
# Path hack.
6-
import sys
7-
import os
86
import numpy as np
9-
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/..")
7+
# sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/..")
108

119
# pylint: disable-msg=E0401
1210

@@ -78,6 +76,7 @@ def create_regressor():
7876

7977

8078
if __name__ == '__main__':
79+
# TODO add data pipeline, make it fully runnable
8180

8281
np.random.seed(SEED)
8382

0 commit comments

Comments
 (0)