Add model metric logging

This commit is contained in:
allegroai
2022-03-21 01:00:19 +02:00
parent d684169367
commit 4355c1b1f4
37 changed files with 1733 additions and 253 deletions

View File

@@ -7,14 +7,14 @@ class Preprocess(object):
# set internal state, this will be called only once. (i.e. not per request)
pass
def postprocess(self, data: List[dict]) -> dict:
def postprocess(self, data: List[dict], collect_custom_statistics_fn=None) -> dict:
# we will here average the results and return the new value
# assume data is a list of dicts greater than 1
# average result
return dict(y=0.5 * data[0]['y'][0] + 0.5 * data[1]['y'][0])
def process(self, data: Any) -> Any:
def process(self, data: Any, collect_custom_statistics_fn=None) -> Any:
"""
do something with the actual data, return any type of object.
The returned object will be passed as is to the postprocess function engine