public override FloatTensor Forward(FloatTensor input) { FloatTensor output = input.Log(); activation = output.Id; return(output); }
public override FloatTensor Forward(FloatTensor prediction, FloatTensor target) { // Note: prediction should be logits, basically pre-softmax. This method applies softmax first. // TODO check shapes FloatTensor output = ((target.Mul(prediction.Log())).Sum()).Neg(); return(output); }