-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
Description
The loss functions in ann return double type loss only. Can we have the template for that as well so that users can set the precision whatever they want? In general, we don't use precision up to 17 decimal points for calculating loss, so using just float should work fine I think.
For example
template<typename InputDataType, typename OutputDataType>
template<typename InputType, typename TargetType>
typename InputType::value_type MyLossFunction<InputDataType, OutputDataType>::Forward(
const InputType& input,
TargetType& target)
{
using RealType = typename InputType::value_type;
// Use RealType wherever loss variable has to be dealt with.
}
What do you think?
Reactions are currently unavailable