def test_log(t: Tensor) -> Tensor: return ep.log(t.maximum(1e-8))
def calculate_fitness(logits: ep.TensorType) -> ep.TensorType: first = logits[range(N), classes] second = ep.log(ep.exp(logits).sum(1) - first) return first - second