The real problem with getting negative cost values is that mixing integer and float types in TF/Keras has different type coercion rules than it does in python. Here’s a thread which gives details and examples.
1 Like