I'd like to write a custom metric for a spelling correction model that counts correctly substituted letters that were previously incorrect. And it should be counted incorrectly substituted letters that were previously correct.
这就是为什么我需要访问 x_input 数据。不幸的是,默认情况下只能访问 y_true 和 y_pred。是否有解决方法可以获取匹配的 x_input?
是:
def custom_metric(y_true, y_pred):
Run Code Online (Sandbox Code Playgroud)
通缉:
def custom_metric(x_input, y_true, y_pred):
Run Code Online (Sandbox Code Playgroud)