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: tsne.rb
    path of file: ./repos/rumale/rumale-manifold/lib/rumale/manifold
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

require 'rumale/base/estimator'
require 'rumale/base/transformer'
require 'rumale/utils'
require 'rumale/validat
    
      def gaussian_distributed_probability_matrix(distance_mat)
        # initialize some variables.
        n_samples = distance_mat.shape[0]
        prob_mat = Numo::DFloat.zeros(n_samples, n_samples)
        sum_beta = 0.0
        # calculate conditional probabilities.
        n_samples.times do |n|
          beta, probs = optimal_probabilities(n, distance_mat[n, true])
          prob_mat[n, true] = probs
          sum_beta += beta
          puts "[t-SNE] Computed conditional probabilities for sample #{n + 1} / #{n_samples}" if @params[:verbose] && ((n + 1) % 1000).zero?
        end
        puts "[t-SNE] Mean sigma: #{Math.sqrt(n_samples.fdiv(sum_beta))}" if @params[:verbose]
        # symmetrize and normalize probability matrix.
        prob_mat[prob_mat.diag_indices(0)] = 0.0
        prob_mat = 0.5 * (prob_mat + prob_mat.transpose)
        prob_mat / prob_mat.sum
      end