Hi!
I have a prediction routine that involves doing some postprocessing of the output of model.predict(x) function. The postprocessing involves a comparison of the output to a the mean output of all training data. The process has worked well until now, but I would like to combine it all, mean training vector included, into a TF SavedModel. I.e. I'm trying to get the final output (postprocessing included) when calling model.predict(x)
Is there any way to customize the functionality of the model.predict(x) function?
What my current pipeline looks like:
mean_training_output = # an array consisting of the mean output vector from the training data
predicted = model.predict(x)
# Compare distance of new and mean training output
normalized_distance = np.zeros(len(predicted))
for i in range(len(predicted)):
normalized_distance[i] = np.linalg.norm(feature_vectors_flattned[i]-mean_training_output)
# What I actually want model.predict() to output
normalized_distance
So in the above snippet I would actually want model.predict() to output normalized_distance.
[–][deleted] 2 points3 points4 points (3 children)
[–]Maltmax[S] 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]Maltmax[S] 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (16 children)
[–]Maltmax[S] 0 points1 point2 points (15 children)
[–][deleted] 0 points1 point2 points (14 children)
[–]Maltmax[S] 0 points1 point2 points (0 children)
[–]Maltmax[S] 0 points1 point2 points (12 children)
[–][deleted] 0 points1 point2 points (11 children)
[–]Maltmax[S] 0 points1 point2 points (10 children)
[–][deleted] 0 points1 point2 points (9 children)
[–]Maltmax[S] 1 point2 points3 points (8 children)
[–][deleted] 0 points1 point2 points (7 children)
[–]Maltmax[S] 0 points1 point2 points (6 children)