code: def test_beta_likelihood(
      concentration1: float, concentration0: float
  ) -> None:
      """
      Test to check that maximizing the likelihood recovers the parameters
      """
  
      # generate samples
      concentration1s = torch.zeros((NUM_SAMPLES,)) + concentration1
      concentration0s = torch.zeros((NUM_SAMPLES,)) + concentration0
  
      distr = Beta(concentration1s, concentration0s)
      samples = distr.sample()
  
      init_biases = [
          inv_softplus(
              concentration1 - START_TOL_MULTIPLE * TOL * concentration1
          ),
          inv_softplus(
              concentration0 - START_TOL_MULTIPLE * TOL * concentration0
          ),
      ]
  
      (
          concentration1_hat,
          concentration0_hat,
      ) = maximum_likelihood_estimate_sgd(
          BetaOutput(),
          samples,
          init_biases=init_biases,
          learning_rate=PositiveFloat(0.05),
          num_epochs=PositiveInt(10),
      )
  
      assert (
          np.abs(concentration1_hat - concentration1)
          < TOL * concentration1
      ), f"concentration1 did not match: concentration1 = {concentration1}, concentration1_hat = {concentration1_hat}"
      assert (
          np.abs(concentration0_hat - concentration0)
          < TOL * concentration0
      ), f"concentration0 did not match: concentration0 = {concentration0}, concentration0_hat = {concentration0_hat}"
  
imports: from typing import List
  import numpy
  import pytest
  import torch
  import torch.nn
  from scipy.special import softmax
  from torch.distributions import Beta, Gamma, NegativeBinomial, Normal, Poisson, StudentT
  from torch.nn.utils import clip_grad_norm_
  from torch.optim import SGD
  from torch.utils.data import DataLoader, TensorDataset
  from gluonts.pydantic import PositiveFloat, PositiveInt
  from gluonts.torch.distributions import BetaOutput, DistributionOutput, GammaOutput, NegativeBinomialOutput, NormalOutput, PoissonOutput, SplicedBinnedPareto, SplicedBinnedParetoOutput, StudentTOutput
label_desc: Use image node_id 5 for calling a global function with example usage: test_beta_likelihood(concentration1, concentration0) without return types