SiaNet/Losses/BaseLoss.cs
/// <summary>
/// Gets the specified loss type.
/// </summary>
/// <param name="lossType">Type of the loss.</param>
/// <returns></returns>
Gets the specified loss type.
Gets the specified loss type .
internal static BaseLoss Get(LossType lossType)
        {
            BaseLoss loss = null;
            switch (lossType)
            {
                case LossType.MeanSquaredError:
                    loss = new MeanSquaredError();
                    break;
                case LossType.MeanAbsoluteError:
                    loss = new MeanAbsoluteError();
                    break;
                case LossType.MeanAbsolutePercentageError:
                    loss = new MeanAbsolutePercentageError();
                    break;
                case LossType.MeanAbsoluteLogError:
                    loss = new MeanSquaredLogError();
                    break;
                case LossType.SquaredHinge:
                    loss = new SquaredHinge();
                    break;
                case LossType.Hinge:
                    loss = new Hinge();
                    break;
                case LossType.BinaryCrossEntropy:
                    loss = new BinaryCrossentropy();
                    break;
                case LossType.CategorialCrossEntropy:
                    loss = new CategoricalCrossentropy();
                    break;
                case LossType.CTC:
                    break;
                case LossType.KullbackLeiblerDivergence:
                    loss = new KullbackLeiblerDivergence();
                    break;
                case LossType.Logcosh:
                    loss = new LogCosh();
                    break;
                case LossType.Poisson:
                    loss = new Poisson();
                    break;
                case LossType.CosineProximity:
                    loss = new CosineProximity();
                    break;
                default:
                    break;
            }
            return loss;
        }
internal static BaseLoss Get ( LossType lossType ) { BaseLoss loss = null ; switch ( lossType ) { case LossType . MeanSquaredError : loss = new MeanSquaredError ( ) ; break ; case LossType . MeanAbsoluteError : loss = new MeanAbsoluteError ( ) ; break ; case LossType . MeanAbsolutePercentageError : loss = new MeanAbsolutePercentageError ( ) ; break ; case LossType . MeanAbsoluteLogError : loss = new MeanSquaredLogError ( ) ; break ; case LossType . SquaredHinge : loss = new SquaredHinge ( ) ; break ; case LossType . Hinge : loss = new Hinge ( ) ; break ; case LossType . BinaryCrossEntropy : loss = new BinaryCrossentropy ( ) ; break ; case LossType . CategorialCrossEntropy : loss = new CategoricalCrossentropy ( ) ; break ; case LossType . CTC : break ; case LossType . KullbackLeiblerDivergence : loss = new KullbackLeiblerDivergence ( ) ; break ; case LossType . Logcosh : loss = new LogCosh ( ) ; break ; case LossType . Poisson : loss = new Poisson ( ) ; break ; case LossType . CosineProximity : loss = new CosineProximity ( ) ; break ; default : break ; } return loss ; }
Gets the specified loss type.
Gets the specified loss type .
None
lossType
LossType
Type of the loss.
Type of the loss .