pub fn call_regularizer<T: 'static, D: 'static>(
    regularizer_enum: RegularizerEnum<T>,
) -> Box<dyn RegularizerBase<T, A = Array<T, D>>>
where
    T: CrateFloat,
    D: Dimension,
{
    match regularizer_enum {
        RegularizerEnum::L1(decay_lambda) => Box::new(L1Norm::new(decay_lambda)),
        RegularizerEnum::L2(decay_lambda) => Box::new(L2Norm::new(decay_lambda)),
        RegularizerEnum::None => Box::new(L2Norm::new(cast_t2u(0.0))),
    }
}
/// validate RegularizerEnum and generate an appropriate regularizer

validate RegularizerEnum and generate an appropriate regularizer
validate RegularizerEnum and generate an appropriate regularizer
pub fn call_regularizer<T: 'static, D: 'static>(
    regularizer_enum: RegularizerEnum<T>,
) -> Box<dyn RegularizerBase<T, A = Array<T, D>>>
where
    T: CrateFloat,
    D: Dimension,
{
    match regularizer_enum {
        RegularizerEnum::L1(decay_lambda) => Box::new(L1Norm::new(decay_lambda)),
        RegularizerEnum::L2(decay_lambda) => Box::new(L2Norm::new(decay_lambda)),
        RegularizerEnum::None => Box::new(L2Norm::new(cast_t2u(0.0))),
    }
}
pub fn call_regularizer < T : ' static , D : ' static > ( regularizer_enum : RegularizerEnum < T > , ) -> Box < dyn RegularizerBase < T , A = Array < T , D > > > where T : CrateFloat , D : Dimension , { match regularizer_enum { RegularizerEnum :: L1 ( decay_lambda ) => Box :: new ( L1Norm :: new ( decay_lambda ) ) , RegularizerEnum :: L2 ( decay_lambda ) => Box :: new ( L2Norm :: new ( decay_lambda ) ) , RegularizerEnum :: None => Box :: new ( L2Norm :: new ( cast_t2u ( 0.0 ) ) ) , } }
validate RegularizerEnum and generate an appropriate regularizer
validate RegularizerEnum and generate an appropriate regularizer
regularizer_enum
RegularizerEnum<T>
regularizer_enum
RegularizerEnum<T>