src/core/optimization/OptimizerFactory.java
public static Optimizer create(String optimizationName, String params) throws DynamicParamException {
        return switch (optimizationName) {
            case "GradientDescent" -> (params == null) ? new GradientDescent() : new GradientDescent(params);
            case "MomentumGradientDescent" -> (params == null) ? new MomentumGradientDescent() : new MomentumGradientDescent(params);
            case "NesterovAcceleratedGradient" -> (params == null) ? new NesterovAcceleratedGradient() : new NesterovAcceleratedGradient(params);
            case "Adagrad" -> (params == null) ? new Adagrad() : new Adagrad(params);
            case "Adadelta" -> (params == null) ? new Adadelta() : new Adadelta(params);
            case "RMSProp" -> (params == null) ? new RMSProp() : new RMSProp(params);
            case "Adam" -> (params == null) ? new Adam() : new Adam(params);
            case "Adamax" -> (params == null) ? new Adamax() : new Adamax(params);
            case "NAdam" -> (params == null) ? new NAdam() : new NAdam(params);
            case "RAdam" -> (params == null) ? new RAdam() : new RAdam(params);
            case "AMSGrad" -> (params == null) ? new AMSGrad() : new AMSGrad(params);
            case "ResilientPropagation" -> new ResilientPropagation();
            default -> throw new DynamicParamException("Unknown optimizer name.");
        };
    }
/**
     * Constructs optimizer.
     *
     * @param optimizationName optimizer name.
     * @param params parameters for specific optimizer.
     * @return constructed optimizer.
     * @throws DynamicParamException throws exception if parameter (params) setting fails.
     */
Constructs optimizer.
@param optimizationName optimizer name.
@param params parameters for specific optimizer.
@return constructed optimizer.
@throws DynamicParamException throws exception if parameter (params) setting fails.
Constructs optimizer . @param optimizationName optimizer name . @param params parameters for specific optimizer . @return constructed optimizer . @throws DynamicParamException throws exception if parameter ( params ) setting fails .
public static Optimizer create(String optimizationName, String params) throws DynamicParamException {
        return switch (optimizationName) {
            case "GradientDescent" -> (params == null) ? new GradientDescent() : new GradientDescent(params);
            case "MomentumGradientDescent" -> (params == null) ? new MomentumGradientDescent() : new MomentumGradientDescent(params);
            case "NesterovAcceleratedGradient" -> (params == null) ? new NesterovAcceleratedGradient() : new NesterovAcceleratedGradient(params);
            case "Adagrad" -> (params == null) ? new Adagrad() : new Adagrad(params);
            case "Adadelta" -> (params == null) ? new Adadelta() : new Adadelta(params);
            case "RMSProp" -> (params == null) ? new RMSProp() : new RMSProp(params);
            case "Adam" -> (params == null) ? new Adam() : new Adam(params);
            case "Adamax" -> (params == null) ? new Adamax() : new Adamax(params);
            case "NAdam" -> (params == null) ? new NAdam() : new NAdam(params);
            case "RAdam" -> (params == null) ? new RAdam() : new RAdam(params);
            case "AMSGrad" -> (params == null) ? new AMSGrad() : new AMSGrad(params);
            case "ResilientPropagation" -> new ResilientPropagation();
            default -> throw new DynamicParamException("Unknown optimizer name.");
        };
    }
public static Optimizer create ( String optimizationName , String params ) throws DynamicParamException { return switch ( optimizationName ) { case "GradientDescent" -> ( params == null ) ? new GradientDescent ( ) : new GradientDescent ( params ) ; case "MomentumGradientDescent" -> ( params == null ) ? new MomentumGradientDescent ( ) : new MomentumGradientDescent ( params ) ; case "NesterovAcceleratedGradient" -> ( params == null ) ? new NesterovAcceleratedGradient ( ) : new NesterovAcceleratedGradient ( params ) ; case "Adagrad" -> ( params == null ) ? new Adagrad ( ) : new Adagrad ( params ) ; case "Adadelta" -> ( params == null ) ? new Adadelta ( ) : new Adadelta ( params ) ; case "RMSProp" -> ( params == null ) ? new RMSProp ( ) : new RMSProp ( params ) ; case "Adam" -> ( params == null ) ? new Adam ( ) : new Adam ( params ) ; case "Adamax" -> ( params == null ) ? new Adamax ( ) : new Adamax ( params ) ; case "NAdam" -> ( params == null ) ? new NAdam ( ) : new NAdam ( params ) ; case "RAdam" -> ( params == null ) ? new RAdam ( ) : new RAdam ( params ) ; case "AMSGrad" -> ( params == null ) ? new AMSGrad ( ) : new AMSGrad ( params ) ; case "ResilientPropagation" -> new ResilientPropagation ( ) ; default -> throw new DynamicParamException ( "Unknown optimizer name." ) ; } ; }
Constructs optimizer.
Constructs optimizer .