reductionista commented on a change in pull request #440: DL: Update
training_preprocessor_dl to use bytea
URL: https://github.com/apache/madlib/pull/440#discussion_r322486671
##########
File path: src/ports/postgres/modules/deep_learning/madlib_keras_helper.py_in
##########
@@ -174,4 +189,9 @@ def
get_image_count_per_seg_for_non_minibatched_data_from_db(table_name):
images_per_seg = [int(image["images_per_seg"]) for image in images_per_seg]
return gp_segment_id_col, seg_ids, images_per_seg
-
+def parse_shape(shape):
+ # Parse the shape format given by the sql into an int array
+ # [1:10][1:32][1:3] -> [10, 32, 3]
+ # Split on :, discard the first one [1:],
+ # split each piece on ], take the first piece [0], convert to int
+ return [int(a.split(']')[0]) for a in shape.split(':')[1:]]
Review comment:
(this code unnecessary if these were stored as arrays instead of TEXT)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services