Skip to content

Commit

Permalink
Apply transform consistently between training and scoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Zotti authored and Ryan Zotti committed Oct 28, 2017
1 parent 048481d commit 069679e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions data_augmentation.py
Expand Up @@ -66,7 +66,15 @@ def normalize_contrast(images):
# Collapses multiple data transformations; primarily used in model training scritps
def process_data(data):
images, labels = data[0], data[1]
images = normalize_contrast(images)
images, labels = flip_enrichment(images, labels)
images = apply_transformations(images)
return images, labels


# I've separated this from `process_data` so that I can use it in both training
# and scoring. Relying on process_data alone wasn't sufficient for scoring
# because during scoring the true labels aren't known at runtime
def apply_transformations(images):
images = normalize_contrast(images)
images = images / 255
return images, labels
return images

0 comments on commit 069679e

Please sign in to comment.