예제 #1
0
        public override FloatTensor Forward(FloatTensor input)
        {
            FloatTensor output = input.Log();

            activation = output.Id;

            return(output);
        }
예제 #2
0
        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);
        }