class EncoderConfig(hyperparams.OneOfConfig): """Encoder configuration.""" type: Optional[str] = "bert" albert: AlbertEncoderConfig = AlbertEncoderConfig() bert: BertEncoderConfig = BertEncoderConfig() bert_v2: BertEncoderConfig = BertEncoderConfig() bigbird: BigBirdEncoderConfig = BigBirdEncoderConfig() kernel: KernelEncoderConfig = KernelEncoderConfig() mobilebert: MobileBertEncoderConfig = MobileBertEncoderConfig() reuse: ReuseEncoderConfig = ReuseEncoderConfig() xlnet: XLNetEncoderConfig = XLNetEncoderConfig() # If `any` is used, the encoder building relies on any.BUILDER. any: hyperparams.Config = hyperparams.Config()
def foo(): """Multitask experiment for test.""" experiment_config = hyperparams.Config( default_params={ 'runtime': { 'tpu': 'fake', }, 'task': { 'model': { 'model_id': 'bar', }, }, 'trainer': { 'train_steps': -1, 'validation_steps': -1, }, }) return experiment_config
class TaskSamplingConfig(hyperparams.OneOfConfig): type: str = "" uniform: hyperparams.Config = hyperparams.Config() proportional: ProportionalSampleConfig = ProportionalSampleConfig() annealing: AnnealingSampleConfig = AnnealingSampleConfig()