src/utils/matrix/ComputableMatrix.java
public void initialize(Initialization initialization, int inputs, int outputs) {
        switch (initialization) {
            case ZERO -> initializer = (Initializer & Serializable) (row, col) -> 0;
            case ONE -> {
                initializer = (Initializer & Serializable) (row, col) -> 1;
                initialize(initializer);
            }
            case RANDOM -> {
                initializer = (Initializer & Serializable) (row, col) -> random.nextDouble();
                initialize(initializer);
            }
            case IDENTITY -> {
                initializer = (Initializer & Serializable) (row, col) -> (row == col) ? 1 : 0;
                initialize(initializer);
            }
            case NORMAL_XAVIER -> {
                initializer = (Initializer & Serializable) (row, col) -> normal(Math.sqrt(2 / (double) (getRows() + getColumns())));
                initialize(initializer);
            }
            case UNIFORM_XAVIER -> {
                initializer = (Initializer & Serializable) (row, col) -> uniform(Math.sqrt(6 / (double) (getRows() + getColumns())));
                initialize(initializer);
            }
            case NORMAL_HE -> {
                initializer = (Initializer & Serializable) (row, col) -> normal(Math.sqrt(2 / ((double) getRows())));
                initialize(initializer);
            }
            case UNIFORM_HE -> {
                initializer = (Initializer & Serializable) (row, col) -> uniform(Math.sqrt(6 / (double) (getRows())));
                initialize(initializer);
            }
            case NORMAL_LECUN -> {
                initializer = (Initializer & Serializable) (row, col) -> normal(Math.sqrt(1 / (double) (getRows())));
                initialize(initializer);
            }
            case UNIFORM_LECUN -> {
                initializer = (Initializer & Serializable) (row, col) -> uniform(Math.sqrt(3 / (double) (getRows())));
                initialize(initializer);
            }
            case NORMAL_XAVIER_CONV -> {
                initializer = (Initializer & Serializable) (row, col) -> normal(Math.sqrt(2 / (double) (outputs + inputs)));
                initialize(initializer);
            }
            case UNIFORM_XAVIER_CONV -> {
                initializer = (Initializer & Serializable) (row, col) -> uniform(Math.sqrt(6 / (double) (outputs + inputs)));
                initialize(initializer);
            }
            case NORMAL_HE_CONV -> {
                initializer = (Initializer & Serializable) (row, col) -> normal(Math.sqrt(2 / (double) (outputs)));
                initialize(initializer);
            }
            case UNIFORM_HE_CONV -> {
                initializer = (Initializer & Serializable) (row, col) -> uniform(Math.sqrt(6 / (double) (outputs)));
                initialize(initializer);
            }
            case NORMAL_LECUN_CONV -> {
                initializer = (Initializer & Serializable) (row, col) -> normal(Math.sqrt(1 / (double) (outputs)));
                initialize(initializer);
            }
            case UNIFORM_LECUN_CONV -> {
                initializer = (Initializer & Serializable) (row, col) -> uniform(Math.sqrt(3 / (double) (outputs)));
                initialize(initializer);
            }
            default -> {
            }
        }
    }
/**
     * Initializes matrix.
     *
     * @param initialization type of initialization defined in class Init.
     * @param inputs applied in convolutional initialization defined as channels * filter size * filter size.
     * @param outputs applied in convolutional initialization defined as filters * filter size * filter size.
     */
Initializes matrix.

@param initialization type of initialization defined in class Init.
@param inputs applied in convolutional initialization defined as channels * filter size * filter size.
@param outputs applied in convolutional initialization defined as filters * filter size * filter size.
Initializes matrix . @param initialization type of initialization defined in class Init . @param inputs applied in convolutional initialization defined as channels * filter size * filter size . @param outputs applied in convolutional initialization defined as filters * filter size * filter size .
public void initialize(Initialization initialization, int inputs, int outputs) {
        switch (initialization) {
            case ZERO -> initializer = (Initializer & Serializable) (row, col) -> 0;
            case ONE -> {
                initializer = (Initializer & Serializable) (row, col) -> 1;
                initialize(initializer);
            }
            case RANDOM -> {
                initializer = (Initializer & Serializable) (row, col) -> random.nextDouble();
                initialize(initializer);
            }
            case IDENTITY -> {
                initializer = (Initializer & Serializable) (row, col) -> (row == col) ? 1 : 0;
                initialize(initializer);
            }
            case NORMAL_XAVIER -> {
                initializer = (Initializer & Serializable) (row, col) -> normal(Math.sqrt(2 / (double) (getRows() + getColumns())));
                initialize(initializer);
            }
            case UNIFORM_XAVIER -> {
                initializer = (Initializer & Serializable) (row, col) -> uniform(Math.sqrt(6 / (double) (getRows() + getColumns())));
                initialize(initializer);
            }
            case NORMAL_HE -> {
                initializer = (Initializer & Serializable) (row, col) -> normal(Math.sqrt(2 / ((double) getRows())));
                initialize(initializer);
            }
            case UNIFORM_HE -> {
                initializer = (Initializer & Serializable) (row, col) -> uniform(Math.sqrt(6 / (double) (getRows())));
                initialize(initializer);
            }
            case NORMAL_LECUN -> {
                initializer = (Initializer & Serializable) (row, col) -> normal(Math.sqrt(1 / (double) (getRows())));
                initialize(initializer);
            }
            case UNIFORM_LECUN -> {
                initializer = (Initializer & Serializable) (row, col) -> uniform(Math.sqrt(3 / (double) (getRows())));
                initialize(initializer);
            }
            case NORMAL_XAVIER_CONV -> {
                initializer = (Initializer & Serializable) (row, col) -> normal(Math.sqrt(2 / (double) (outputs + inputs)));
                initialize(initializer);
            }
            case UNIFORM_XAVIER_CONV -> {
                initializer = (Initializer & Serializable) (row, col) -> uniform(Math.sqrt(6 / (double) (outputs + inputs)));
                initialize(initializer);
            }
            case NORMAL_HE_CONV -> {
                initializer = (Initializer & Serializable) (row, col) -> normal(Math.sqrt(2 / (double) (outputs)));
                initialize(initializer);
            }
            case UNIFORM_HE_CONV -> {
                initializer = (Initializer & Serializable) (row, col) -> uniform(Math.sqrt(6 / (double) (outputs)));
                initialize(initializer);
            }
            case NORMAL_LECUN_CONV -> {
                initializer = (Initializer & Serializable) (row, col) -> normal(Math.sqrt(1 / (double) (outputs)));
                initialize(initializer);
            }
            case UNIFORM_LECUN_CONV -> {
                initializer = (Initializer & Serializable) (row, col) -> uniform(Math.sqrt(3 / (double) (outputs)));
                initialize(initializer);
            }
            default -> {
            }
        }
    }
public void initialize ( Initialization initialization , int inputs , int outputs ) { switch ( initialization ) { case ZERO -> initializer = ( Initializer & Serializable ) ( row , col ) -> 0 ; case ONE -> { initializer = ( Initializer & Serializable ) ( row , col ) -> 1 ; initialize ( initializer ) ; } case RANDOM -> { initializer = ( Initializer & Serializable ) ( row , col ) -> random . nextDouble ( ) ; initialize ( initializer ) ; } case IDENTITY -> { initializer = ( Initializer & Serializable ) ( row , col ) -> ( row == col ) ? 1 : 0 ; initialize ( initializer ) ; } case NORMAL_XAVIER -> { initializer = ( Initializer & Serializable ) ( row , col ) -> normal ( Math . sqrt ( 2 / ( double ) ( getRows ( ) + getColumns ( ) ) ) ) ; initialize ( initializer ) ; } case UNIFORM_XAVIER -> { initializer = ( Initializer & Serializable ) ( row , col ) -> uniform ( Math . sqrt ( 6 / ( double ) ( getRows ( ) + getColumns ( ) ) ) ) ; initialize ( initializer ) ; } case NORMAL_HE -> { initializer = ( Initializer & Serializable ) ( row , col ) -> normal ( Math . sqrt ( 2 / ( ( double ) getRows ( ) ) ) ) ; initialize ( initializer ) ; } case UNIFORM_HE -> { initializer = ( Initializer & Serializable ) ( row , col ) -> uniform ( Math . sqrt ( 6 / ( double ) ( getRows ( ) ) ) ) ; initialize ( initializer ) ; } case NORMAL_LECUN -> { initializer = ( Initializer & Serializable ) ( row , col ) -> normal ( Math . sqrt ( 1 / ( double ) ( getRows ( ) ) ) ) ; initialize ( initializer ) ; } case UNIFORM_LECUN -> { initializer = ( Initializer & Serializable ) ( row , col ) -> uniform ( Math . sqrt ( 3 / ( double ) ( getRows ( ) ) ) ) ; initialize ( initializer ) ; } case NORMAL_XAVIER_CONV -> { initializer = ( Initializer & Serializable ) ( row , col ) -> normal ( Math . sqrt ( 2 / ( double ) ( outputs + inputs ) ) ) ; initialize ( initializer ) ; } case UNIFORM_XAVIER_CONV -> { initializer = ( Initializer & Serializable ) ( row , col ) -> uniform ( Math . sqrt ( 6 / ( double ) ( outputs + inputs ) ) ) ; initialize ( initializer ) ; } case NORMAL_HE_CONV -> { initializer = ( Initializer & Serializable ) ( row , col ) -> normal ( Math . sqrt ( 2 / ( double ) ( outputs ) ) ) ; initialize ( initializer ) ; } case UNIFORM_HE_CONV -> { initializer = ( Initializer & Serializable ) ( row , col ) -> uniform ( Math . sqrt ( 6 / ( double ) ( outputs ) ) ) ; initialize ( initializer ) ; } case NORMAL_LECUN_CONV -> { initializer = ( Initializer & Serializable ) ( row , col ) -> normal ( Math . sqrt ( 1 / ( double ) ( outputs ) ) ) ; initialize ( initializer ) ; } case UNIFORM_LECUN_CONV -> { initializer = ( Initializer & Serializable ) ( row , col ) -> uniform ( Math . sqrt ( 3 / ( double ) ( outputs ) ) ) ; initialize ( initializer ) ; } default -> { } } }
Initializes matrix.
Initializes matrix .