| 318 | # generate dataset pipline |
| 319 | def build_model_input(filename, batch_size, num_epochs, seed, stock_tf, workqueue=None): |
| 320 | def parse_csv(value): |
| 321 | tf.logging.info('Parsing {}'.format(filename)) |
| 322 | columns = tf.io.decode_csv(value, record_defaults=defaults) |
| 323 | all_columns = collections.OrderedDict(zip(headers, columns)) |
| 324 | labels = [all_columns.pop(LABEL_COLUMNS[0]), all_columns.pop(LABEL_COLUMNS[1])] |
| 325 | label = tf.multiply(labels[0], labels[1]) |
| 326 | features = all_columns |
| 327 | return features, label |
| 328 | |
| 329 | def parse_parquet(value): |
| 330 | tf.logging.info('Parsing {}'.format(filename)) |