# Path: disentanglement_lib/data/ground_truth/dummy_data.py
# class IdentityObservationsData(ground_truth_data.GroundTruthData):
# class DummyData(ground_truth_data.GroundTruthData):
#   def num_factors(self):
#   def observation_shape(self):
#   def factors_num_values(self):
#   def sample_factors(self, num, random_state):
#   def sample_observations_from_factors(self, factors, random_state):
#   def factor_names(self):
#   def num_factors(self):
#   def factors_num_values(self):
#   def observation_shape(self):
#   def sample_factors(self, num, random_state):
#   def sample_observations_from_factors(self, factors, random_state):
# 
# Path: disentanglement_lib/evaluation/udr/metrics/udr.py
# def relative_strength_disentanglement(corr_matrix):
# def spearman_correlation_conv(vec1, vec2):
# def lasso_correlation_matrix(vec1, vec2, random_state=None):
# def _generate_representation_batch(ground_truth_data, representation_functions,
#                                    batch_size, random_state):
# def _generate_representation_dataset(ground_truth_data,
#                                      representation_functions, batch_size,
#                                      num_data_points, random_state):
# def compute_udr_sklearn(ground_truth_data,
#                         representation_functions,
#                         random_state,
#                         batch_size,
#                         num_data_points,
#                         correlation_matrix="lasso",
#                         filter_low_kl=True,
#                         include_raw_correlations=True,
#                         kl_filter_threshold=0.01):


from absl.testing import absltest
from disentanglement_lib.data.ground_truth import dummy_data
from disentanglement_lib.evaluation.udr.metrics import udr
import numpy as np
    vec1 = random_state.random_sample((1000, 3))
    vec2 = np.copy(vec1)
    expected_matrix = np.array([[1.0, 0.0, 0.0], [0.0, 1.0, 0.0],
                                [0.0, 0.0, 1.0]])
    self.assertTrue(
        np.allclose(
            udr.spearman_correlation_conv(vec1, vec2),
            expected_matrix,
            atol=0.1))

    vec1 = random_state.random_sample((1000, 3))
    vec2 = np.copy(vec1)
    vec2[:, 1] = vec2[:, 0]

    expected_matrix = np.array([[1.0, 1.0, 0.0], [0.0, 0.0, 0.0],
                                [0.0, 0.0, 1.0]])
    self.assertTrue(
        np.allclose(
            udr.spearman_correlation_conv(vec1, vec2),
            expected_matrix,
            atol=0.1))

  def test_lasso_correlation(self):
    random_state = np.random.RandomState(0)
    vec1 = random_state.random_sample((1000, 3)) * 10.0
    vec2 = np.copy(vec1)
    expected_matrix = np.array([[1.0, 0.0, 0.0], [0.0, 1.0, 0.0],
                                [0.0, 0.0, 1.0]])
    self.assertTrue(
        np.allclose(

# Path: disentanglement_lib/data/ground_truth/dummy_data.py
# class IdentityObservationsData(ground_truth_data.GroundTruthData):
# class DummyData(ground_truth_data.GroundTruthData):
#   def num_factors(self):
#   def observation_shape(self):
#   def factors_num_values(self):
#   def sample_factors(self, num, random_state):
#   def sample_observations_from_factors(self, factors, random_state):
#   def factor_names(self):
#   def num_factors(self):
#   def factors_num_values(self):
#   def observation_shape(self):
#   def sample_factors(self, num, random_state):
#   def sample_observations_from_factors(self, factors, random_state):
# 
# Path: disentanglement_lib/evaluation/udr/metrics/udr.py
# def relative_strength_disentanglement(corr_matrix):
# def spearman_correlation_conv(vec1, vec2):
# def lasso_correlation_matrix(vec1, vec2, random_state=None):
# def _generate_representation_batch(ground_truth_data, representation_functions,
#                                    batch_size, random_state):
# def _generate_representation_dataset(ground_truth_data,
#                                      representation_functions, batch_size,
#                                      num_data_points, random_state):
# def compute_udr_sklearn(ground_truth_data,
#                         representation_functions,
#                         random_state,
#                         batch_size,
#                         num_data_points,
#                         correlation_matrix="lasso",
#                         filter_low_kl=True,
#                         include_raw_correlations=True,
#                         kl_filter_threshold=0.01):


# Path: disentanglement_lib/evaluation/udr/metrics/udr_test.py
from absl.testing import absltest
from disentanglement_lib.data.ground_truth import dummy_data
from disentanglement_lib.evaluation.udr.metrics import udr
import numpy as np

    vec1 = random_state.random_sample((1000, 3))
    vec2 = np.copy(vec1)
    expected_matrix = np.array([[1.0, 0.0, 0.0], [0.0, 1.0, 0.0],
                                [0.0, 0.0, 1.0]])
    self.assertTrue(
        np.allclose(
            udr.spearman_correlation_conv(vec1, vec2),
            expected_matrix,
            atol=0.1))

    vec1 = random_state.random_sample((1000, 3))
    vec2 = np.copy(vec1)
    vec2[:, 1] = vec2[:, 0]

    expected_matrix = np.array([[1.0, 1.0, 0.0], [0.0, 0.0, 0.0],
                                [0.0, 0.0, 1.0]])
    self.assertTrue(
        np.allclose(
            udr.spearman_correlation_conv(vec1, vec2),
            expected_matrix,
            atol=0.1))

  def test_lasso_correlation(self):
    random_state = np.random.RandomState(0)
    vec1 = random_state.random_sample((1000, 3)) * 10.0
    vec2 = np.copy(vec1)
    expected_matrix = np.array([[1.0, 0.0, 0.0], [0.0, 1.0, 0.0],
                                [0.0, 0.0, 1.0]])
    self.assertTrue(
        np.allclose(

            udr.lasso_correlation_matrix(vec1, vec2, random_state=random_state),