예제 #1
0
 def setUp(self):
     HOCON = """
         lr = 123.456
         pretrain_data_fraction = .123
         target_train_data_fraction = .1234
         mnli = {
             lr = 4.56,
             batch_size = 123
             max_epochs = 456
             training_data_fraction = .456
         }
         qqp = {
             max_epochs = 789
         }
     """
     DEFAULTS_PATH = "config/defaults.conf"  # To get other required values.
     params = params_from_file(DEFAULTS_PATH, HOCON)
     self.processed_pretrain_params = build_trainer_params(
         params, ["mnli", "qqp"], phase="pretrain"
     )
     self.processed_mnli_target_params = build_trainer_params(
         params, ["mnli"], phase="target_train"
     )
     self.processed_qqp_target_params = build_trainer_params(
         params, ["qqp"], phase="target_train"
     )
예제 #2
0
 def setUp(self):
     HOCON = """
         lr = 123.456
         pretrain_data_fraction = .123
         target_train_data_fraction = .1234
         mnli = {
             lr = 4.56,
             batch_size = 123
             max_epochs = 456
             training_data_fraction = .456
         }
         qqp = {
             max_epochs = 789
         }
     """
     DEFAULTS_PATH = resource_filename(
         "jiant",
         "config/defaults.conf")  # To get other required replacers.
     params = params_from_file(DEFAULTS_PATH, HOCON)
     cuda_device = -1
     self.processed_pretrain_params = build_trainer_params(params,
                                                           cuda_device,
                                                           ["mnli", "qqp"],
                                                           phase="pretrain")
     self.processed_mnli_target_params = build_trainer_params(
         params, cuda_device, ["mnli"], phase="target_train")
     self.processed_qqp_target_params = build_trainer_params(
         params, cuda_device, ["qqp"], phase="target_train")
 def setUp(self):
     HOCON = """
         lr = 123.456
         pretrain_data_fraction = .123
         target_train_data_fraction = .1234
         mnli = {
             lr = 4.56,
             batch_size = 123
             max_epochs = 456
             training_data_fraction = .456
         }
         qqp = {
             max_epochs = 789
         }
     """
     DEFAULTS_PATH = resource_filename(
         "jiant", "config/defaults.conf")  # To get other required values.
     params = params_from_file(DEFAULTS_PATH, HOCON)
     cuda_device = -1
     self.processed_pretrain_params = build_trainer_params(params,
                                                           cuda_device,
                                                           ["mnli", "qqp"],
                                                           phase="pretrain")
     self.processed_mnli_target_params = build_trainer_params(
         params, cuda_device, ["mnli"], phase="target_train")
     self.processed_qqp_target_params = build_trainer_params(
         params, cuda_device, ["qqp"], phase="target_train")
     self.pretrain_tasks = []
     pretrain_task_registry = {
         "sst": REGISTRY["sst"],
         "winograd-coreference": REGISTRY["winograd-coreference"],
         "commitbank": REGISTRY["commitbank"],
     }
     for name, (cls, _, kw) in pretrain_task_registry.items():
         task = cls("dummy_path",
                    max_seq_len=1,
                    name=name,
                    tokenizer_name="dummy_tokenizer_name",
                    **kw)
         self.pretrain_tasks.append(task)