code: def test_common_initialization(self, implementation):
      sequences, lengths = get_sequences(
          50, 10, model=get_mcgrory_titterington()
      )
  
      with pytest.raises(ValueError):
          model = vhmm.VariationalGaussianHMM(
              4,
              n_iter=500,
              tol=1e-9,
              covariance_type="incorrect",
              implementation=implementation,
          )
          assert_log_likelihood_increasing(
              model, sequences, lengths, 10
          )
  
      with pytest.raises(ValueError):
          model = vhmm.VariationalGaussianHMM(
              4,
              n_iter=500,
              tol=1e-9,
              covariance_type="incorrect",
              init_params="",
              implementation=implementation,
          )
          model.startprob_ = np.asarray([0.25, 0.25, 0.25, 0.25])
          model.score(sequences, lengths)
  
      # Manually setup means - should converge
      model = vhmm.VariationalGaussianHMM(
          4,
          n_iter=500,
          tol=1e-9,
          init_params="stc",
          covariance_type=self.covariance_type,
          implementation=implementation,
      )
      model.means_prior_ = [[1], [1], [1], [1]]
      model.means_posterior_ = [[2], [1], [3], [4]]
      model.beta_prior_ = [1, 1, 1, 1]
      model.beta_posterior_ = [1, 1, 1, 1]
      assert_log_likelihood_increasing(model, sequences, lengths, 10)
  
      # Means have wrong shape
      with pytest.raises(ValueError):
          model = vhmm.VariationalGaussianHMM(
              4,
              n_iter=500,
              tol=1e-9,
              init_params="stc",
              covariance_type=self.covariance_type,
              implementation=implementation,
          )
          model.means_prior_ = [[1], [1], [1]]
          model.means_posterior_ = [[1], [1], [1], [1]]
          model.beta_prior_ = [1, 1, 1, 1]
          model.beta_posterior_ = [1, 1, 1, 1]
          assert_log_likelihood_increasing(
              model, sequences, lengths, 10
          )
  
      with pytest.raises(ValueError):
          model = vhmm.VariationalGaussianHMM(
              4,
              n_iter=500,
              tol=1e-9,
              init_params="stc",
              covariance_type=self.covariance_type,
              implementation=implementation,
          )
          model.means_prior_ = [[1], [1], [1], [1]]
          model.means_posterior_ = [[1], [1], [1]]
          model.beta_prior_ = [1, 1, 1, 1]
          model.beta_posterior_ = [1, 1, 1, 1]
          assert_log_likelihood_increasing(
              model, sequences, lengths, 10
          )
  
      # beta's have wrong shape
      with pytest.raises(ValueError):
          model = vhmm.VariationalGaussianHMM(
              4,
              n_iter=500,
              tol=1e-9,
              init_params="stc",
              covariance_type=self.covariance_type,
              implementation=implementation,
          )
          model.means_prior_ = [[1], [1], [1], [1]]
          model.means_posterior_ = [[2], [1], [3], [4]]
          model.beta_prior_ = [1, 1, 1]
          model.beta_posterior_ = [1, 1, 1, 1]
          assert_log_likelihood_increasing(
              model, sequences, lengths, 10
          )
  
      with pytest.raises(ValueError):
          model = vhmm.VariationalGaussianHMM(
              4,
              n_iter=500,
              tol=1e-9,
              init_params="stc",
              covariance_type=self.covariance_type,
              implementation=implementation,
          )
          model.means_prior_ = [[1], [1], [1], [1]]
          model.means_posterior_ = [[2], [1], [3], [4]]
          model.beta_prior_ = [1, 1, 1, 1]
          model.beta_posterior_ = [1, 1, 1]
          assert_log_likelihood_increasing(
              model, sequences, lengths, 10
          )
  
imports: import numpy
  import pytest
  from sklearn.utils import check_random_state
  from hmmlearn import hmm, vhmm
  from .None import assert_log_likelihood_increasing, compare_variational_and_em_models, make_covar_matrix, normalized, vi_uniform_startprob_and_transmat
label_desc: Use image node_id 3 for calling the _TestGaussian obj's underlying member method code with example usage: obj.test_common_initialization(implementation) without return types