import numpy as npimport seaborn as snsdef poisson_loss(input, target):return np.exp(input)-target*input
Code
inputs = [10**x for x inrange(-2,2)]log_inputs = [np.log10(x) for x in inputs]targets = [poisson_loss(x, 1) for x in inputs]
Code
import torch# loss = torch.nn.functional.poisson_nll_loss()losses = [float(torch.nn.functional.poisson_nll_loss(torch.Tensor([x]), torch.Tensor([1]),log_input=False)) for x in inputs]