Yes, but the challenge is to learn the function that produces amortized thetas, theta_i = neural_net(input_i), that will also generalize well. log() acts like a gradient booster for small likelihoods, so samples with smaller “true probability” are not considered less important.
Networks with big enough capacity can learn optimal thetas without this “importance balancing”, but then they’re prone to overfitting.