From dba6cbffcde3b65f1b1a8270377d05d9a9710b2b Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Mon, 28 Nov 2022 19:33:42 +0000 Subject: [PATCH] WHY. * facepalms * --- aimodel/src/lib/ai/components/LossCrossentropy.py | 2 +- aimodel/src/lib/dataset/dataset_mono.py | 2 ++ aimodel/src/subcommands/train.py | 2 +- aimodel/src/subcommands/train_mono.py | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/aimodel/src/lib/ai/components/LossCrossentropy.py b/aimodel/src/lib/ai/components/LossCrossentropy.py index 0ed5fd0..359e86f 100644 --- a/aimodel/src/lib/ai/components/LossCrossentropy.py +++ b/aimodel/src/lib/ai/components/LossCrossentropy.py @@ -18,7 +18,7 @@ class LossCrossentropy(tf.keras.losses.Loss): result = tf.keras.metrics.categorical_crossentropy(y_true, y_pred) result_reduce = tf.math.reduce_sum(result) label_nowater = tf.math.reduce_sum(tf.argmax(y_true, axis=-1)) - tf.print("DEBUG:TFPRINT:loss LABEL", y_true.shape, y_true, "LABEL_ARGMAX_COUNT_AXIS0", label_nowater, "PREDICT", y_pred.shape, y_pred, "BEFORE_REDUCE", result.shape, result, "AFTER_REDUCE", result_reduce.shape, result_reduce) + # tf.print("DEBUG:TFPRINT:loss LABEL", y_true.shape, y_true, "LABEL_ARGMAX_COUNT_AXIS0", label_nowater, "PREDICT", y_pred.shape, y_pred, "BEFORE_REDUCE", result.shape, result, "AFTER_REDUCE", result_reduce.shape, result_reduce) return result def get_config(self): diff --git a/aimodel/src/lib/dataset/dataset_mono.py b/aimodel/src/lib/dataset/dataset_mono.py index 1a397e9..5683b43 100644 --- a/aimodel/src/lib/dataset/dataset_mono.py +++ b/aimodel/src/lib/dataset/dataset_mono.py @@ -22,6 +22,8 @@ def parse_item(metadata, shape_water_desired=[100,100], water_threshold=0.1, wat print("DEBUG DATASET:rainfall shape", metadata["rainfallradar"]) print("DEBUG DATASET:water shape", metadata["waterdepth"]) + print("DEBUG DATASET:water_threshold", water_threshold) + print("DEBUG DATASET:water_bins", water_bins) def parse_item_inner(item): parsed = tf.io.parse_single_example(item, features={ diff --git a/aimodel/src/subcommands/train.py b/aimodel/src/subcommands/train.py index 0f6bafb..5b73b84 100644 --- a/aimodel/src/subcommands/train.py +++ b/aimodel/src/subcommands/train.py @@ -33,7 +33,7 @@ def run(args): if (not hasattr(args, "read_multiplier")) or args.read_multiplier == None: args.read_multiplier = 1.5 if (not hasattr(args, "water_threshold")) or args.water_threshold == None: - args.water_threshold = 1.5 + args.water_threshold = 0.1 if (not hasattr(args, "water_size")) or args.water_size == None: args.water_size = 1.5 if (not hasattr(args, "arch")) or args.arch == None: diff --git a/aimodel/src/subcommands/train_mono.py b/aimodel/src/subcommands/train_mono.py index bccbe03..cf5d18c 100644 --- a/aimodel/src/subcommands/train_mono.py +++ b/aimodel/src/subcommands/train_mono.py @@ -34,7 +34,7 @@ def run(args): if (not hasattr(args, "read_multiplier")) or args.read_multiplier == None: args.read_multiplier = 1.5 if (not hasattr(args, "water_threshold")) or args.water_threshold == None: - args.water_threshold = 1.5 + args.water_threshold = 0.1 if (not hasattr(args, "water_size")) or args.water_size == None: args.water_size = 1.5 if (not hasattr(args, "bottleneck")) or args.bottleneck == None: