Implement a Custom Loss Function
Create a custom loss function called MeanAbsolutePercentageError
(MAPE) in PyTorch. It should:
- Take predictions and targets as input tensors.
- Compute , with to avoid division by zero.
- Return a scalar tensor.
Test it on a random regression output.