Actually, It was a example code for my original code. I want to define a custom loss function in my original code but I couldn’t. Thus, I have tried to manipulate the loss function in a simple classification problem to solve the issue. may I put the original codes here? I need your kind support regarding the loss function. however, it is too long.