# 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/methods/weak/train_weak_lib.py
# def simple_dynamics(z, ground_truth_data, random_state,
#                     return_index=False, k=gin.REQUIRED):
# def train_with_gin(model_dir,
#                    overwrite=False,
#                    gin_config_files=None,
#                    gin_bindings=None):
# def train(model_dir,
#           overwrite=False,
#           model=gin.REQUIRED,
#           training_steps=gin.REQUIRED,
#           random_seed=gin.REQUIRED,
#           batch_size=gin.REQUIRED,
#           name=""):
# def _make_input_fn(ground_truth_data, seed, num_batches=None):
#   def load_dataset(params):
# def weak_dataset_from_ground_truth_data(
#     ground_truth_data, random_seed):
#   def _generator():
# def visualize_weakly_supervised_dataset(
#     data, path, num_animations=10, num_frames=20, fps=10):
# 
# Path: disentanglement_lib/utils/resources.py
# def get_file(path):
# def get_files_in_folder(path):


from absl.testing import parameterized
from disentanglement_lib.data.ground_truth import dummy_data
from disentanglement_lib.methods.weak import train_weak_lib
from disentanglement_lib.utils import resources
import tensorflow as tf
import gin.tf
     "dynamics.k = 2", "mlvae.beta = 1."]]


def _config_generator():
  """Yields all model configurations that should be tested."""
  model_config_path = resources.get_file(
      "config/tests/methods/unsupervised/train_test.gin")
  for model in MODELS_TEST:
    yield [model_config_path], model


class TrainTest(parameterized.TestCase):

  @parameterized.parameters(list(_config_generator()))
  def test_train_model(self, gin_configs, gin_bindings):
    # We clear the gin config before running. Otherwise, if a prior test fails,
    # the gin config is locked and the current test fails.
    gin.clear_config()

    train_weak_lib.train_with_gin(
        self.create_tempdir().full_path, True, gin_configs, gin_bindings)


class WeakDataTest(parameterized.TestCase, tf.test.TestCase):

  def test_weak_data(self):
    ground_truth_data = dummy_data.DummyData()
    binding = ["dynamics.k = 1"]
    gin.parse_config_files_and_bindings([], binding)
    dataset = \

# 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/methods/weak/train_weak_lib.py
# def simple_dynamics(z, ground_truth_data, random_state,
#                     return_index=False, k=gin.REQUIRED):
# def train_with_gin(model_dir,
#                    overwrite=False,
#                    gin_config_files=None,
#                    gin_bindings=None):
# def train(model_dir,
#           overwrite=False,
#           model=gin.REQUIRED,
#           training_steps=gin.REQUIRED,
#           random_seed=gin.REQUIRED,
#           batch_size=gin.REQUIRED,
#           name=""):
# def _make_input_fn(ground_truth_data, seed, num_batches=None):
#   def load_dataset(params):
# def weak_dataset_from_ground_truth_data(
#     ground_truth_data, random_seed):
#   def _generator():
# def visualize_weakly_supervised_dataset(
#     data, path, num_animations=10, num_frames=20, fps=10):
# 
# Path: disentanglement_lib/utils/resources.py
# def get_file(path):
# def get_files_in_folder(path):


# Path: disentanglement_lib/methods/weak/train_weak_test.py
from absl.testing import parameterized
from disentanglement_lib.data.ground_truth import dummy_data
from disentanglement_lib.methods.weak import train_weak_lib
from disentanglement_lib.utils import resources
import tensorflow as tf
import gin.tf

     "dynamics.k = 2", "mlvae.beta = 1."]]


def _config_generator():
  """Yields all model configurations that should be tested."""
  model_config_path = resources.get_file(
      "config/tests/methods/unsupervised/train_test.gin")
  for model in MODELS_TEST:
    yield [model_config_path], model


class TrainTest(parameterized.TestCase):

  @parameterized.parameters(list(_config_generator()))
  def test_train_model(self, gin_configs, gin_bindings):
    # We clear the gin config before running. Otherwise, if a prior test fails,
    # the gin config is locked and the current test fails.
    gin.clear_config()

    train_weak_lib.train_with_gin(
        self.create_tempdir().full_path, True, gin_configs, gin_bindings)


class WeakDataTest(parameterized.TestCase, tf.test.TestCase):

  def test_weak_data(self):
    ground_truth_data = dummy_data.DummyData()
    binding = ["dynamics.k = 1"]
    gin.parse_config_files_and_bindings([], binding)
    dataset = \

      train_weak_lib.weak_dataset_from_ground_truth_data(