pubmodsquared_error;pubmodcross_entropy;usematrix::Matrix;/// Available cost functions
/// The only reason for having this enum is to `match` it in `NeuralNetwork`
pubenumCostFunctions{
SquaredError,
CrossEntropy,}/// Trait of cost functions
pubtraitCostFunction{// calculates the value of cost function
fncalc(&self, prediction:&Matrix, target:&Matrix)->f64;// returns the corresponding enum
// TODO (afshinm): the only usage of this method is for `match`ing in NeuralNetwork
// can we find a better way to do this?
fnname(&self)-> CostFunctions;}