Exemplo n.º 1
0
def register_lr_scheduler(cls, name=None):
    return register(cls, MEAD_LAYERS_LR_SCHEDULERS, name, "lr_scheduler")
Exemplo n.º 2
0
    PiecewiseDecaySchedulerTensorFlow = PiecewiseDecaySchedulerTensorFlow1
    ExponentialDecaySchedulerTensorFlow = ExponentialDecaySchedulerTensorFlow1
    InverseTimeDecaySchedulerTensorFlow = InverseTimeDecaySchedulerTensorFlow1
    ZarembaDecaySchedulerTensorFlow = ZarembaDecaySchedulerTensorFlow1
else:
    ConstantSchedulerTensorFlow = ConstantSchedulerTensorFlow2
    WarmupLinearSchedulerTensorFlow = WarmupLinearSchedulerTensorFlow2
    CyclicLRSchedulerTensorFlow = CyclicLRSchedulerTensorFlow2
    SGDRSchedulerTensorFlow = SGDRSchedulerTensorFlow2
    CompositeLRSchedulerTensorFlow = CompositeLRSchedulerTensorFlow2
    PiecewiseDecaySchedulerTensorFlow = PiecewiseDecaySchedulerTensorFlow2
    ExponentialDecaySchedulerTensorFlow = ExponentialDecaySchedulerTensorFlow2
    InverseTimeDecaySchedulerTensorFlow = InverseTimeDecaySchedulerTensorFlow2
    ZarembaDecaySchedulerTensorFlow = ZarembaDecaySchedulerTensorFlow2

register(ConstantSchedulerTensorFlow, MEAD_LAYERS_LR_SCHEDULERS, "default",
         "lr_scheduler")
register(WarmupLinearSchedulerTensorFlow, MEAD_LAYERS_LR_SCHEDULERS,
         "warmup_linear", "lr_scheduler")
register(CyclicLRSchedulerTensorFlow, MEAD_LAYERS_LR_SCHEDULERS, "clr",
         "lr_scheduler")
register(SGDRSchedulerTensorFlow, MEAD_LAYERS_LR_SCHEDULERS, "sgdr",
         "lr_scheduler")
register(CompositeLRSchedulerTensorFlow, MEAD_LAYERS_LR_SCHEDULERS,
         "composite", "lr_scheduler")
register(PiecewiseDecaySchedulerTensorFlow, MEAD_LAYERS_LR_SCHEDULERS,
         "piecewise", "lr_scheduler")
register(ZarembaDecaySchedulerTensorFlow, MEAD_LAYERS_LR_SCHEDULERS, "zaremba",
         "lr_scheduler")
register(CosineDecaySchedulerTensorFlow, MEAD_LAYERS_LR_SCHEDULERS, "cosine",
         "lr_scheduler")
register(InverseTimeDecaySchedulerTensorFlow, MEAD_LAYERS_LR_SCHEDULERS,
Exemplo n.º 3
0
def register_decoder(cls, name=None):
    """Register a function as a plug-in"""
    return register(cls, BASELINE_SEQ2SEQ_DECODERS, name, 'decoder')
Exemplo n.º 4
0
def register_progress(cls, name=None):
    return register(cls, MEAD_LAYERS_PROGRESS, name, 'progress')
Exemplo n.º 5
0
def register_arc_policy(cls, name=None):
    """Register a function as a plug-in"""
    return register(cls, BASELINE_SEQ2SEQ_ARC_POLICY, name, 'decoder')
Exemplo n.º 6
0
def register_cache_backend(cls, name):
    """Register a function as a plug-in"""
    return register(cls, ODIN_CACHE_BACKENDS, name, 'cache')
Exemplo n.º 7
0
def register_store_backend(cls, name):
    """Register a function as a plug-in"""
    return register(cls, ODIN_STORE_BACKENDS, name, 'backend')
Exemplo n.º 8
0
def register_tokenizer(cls, name=None):
    r = register(cls, TOKENIZER_DEFS, name, "tokenizer defs")
    return r
Exemplo n.º 9
0
def register_masking(cls, name=None):
    """Register a class as a handler for masking rules by key name"""
    r = register(cls, MASKING_RULE_DEFS, name, "masking rule defs")
    return r