You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: base_mlp.rb
    path of file: ./repos/rumale/rumale-neural_network/lib/rumale/neural_network
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

require 'rumale/base/estimator'
require 'rumale/utils'

module Rumale
  module NeuralNetwork
    # @!visibility private
    # This module consists of the classes that implement layer functions of neural network.
    module Layer
      # @!visibility private
      # Affine is a class that calculates the linear transform.
      # This class is used internally.
      class Affi
    
        def forward(x)
          out = x.dot(@weight) + @bias

          backward = proc do |dout|
            dx = dout.dot(@weight.transpose)
            dw = x.transpose.dot(dout)
            db = dout.sum(axis: 0)

            @weight = @optimizer_weight.call(@weight, dw)
            @bias = @optimizer_bias.call(@bias, db)

            dx
          end

          [out, backward]
        end
      end

      # @!visibility private
      # Dropout is a class that performs dropout regularization.
      # This class is used internally.
      class Dropout
        # @!visibility private
        def initialize(rate: 0.3, rng: nil)
          @rate = rate
          @rng = rng
        end

        # @!visibility private
        def forward(x)
          rand_mat = ::Rumale::Utils.rand_uniform(x.shape, @rng)
          mask = rand_mat.ge(@rate)
          out = x * mask
          out *= 1.fdiv(1 - @rate) if @rate < 1.0

          backward = proc { |dout| dout * mask }

          [out, backward]
        end
      end

      # @!visibility private
      # ReLU is a class that calculates rectified linear function.
      # This class is used internally.
      class Relu
        # @!visibility private
        def forward(x)
          mask = x.gt(0)
          out = x * mask

          backward = proc { |dout| dout * mask }

          [out, backward]
        end
      end
    end