Python gin.external_configurable() Examples

The following are 8 code examples of gin.external_configurable(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module gin , or try the search function .
Example #1
Source File: __init__.py    From BERT with Apache License 2.0 5 votes vote down vote up
def opt_configure(*args, **kwargs):
  kwargs["module"] = "trax.optimizers"
  return gin.external_configurable(*args, **kwargs)

# Optimizers (using upper-case names).
# pylint: disable=invalid-name 
Example #2
Source File: __init__.py    From BERT with Apache License 2.0 5 votes vote down vote up
def configure_and_register_env(env_class):
  register(
      id="{}-v0".format(env_class.__name__),
      entry_point="tensor2tensor.trax.rlax.envs:{}".format(env_class.__name__),
  )
  return gin.external_configurable(env_class, module="trax.rlax.envs")


# pylint: disable=invalid-name 
Example #3
Source File: __init__.py    From BERT with Apache License 2.0 5 votes vote down vote up
def model_configure(*args, **kwargs):
  kwargs["module"] = "trax.models"
  return gin.external_configurable(*args, **kwargs)


# pylint: disable=invalid-name 
Example #4
Source File: __init__.py    From BERT with Apache License 2.0 5 votes vote down vote up
def layer_configure(*args, **kwargs):
  kwargs["module"] = "trax.layers"
  return gin.external_configurable(*args, **kwargs)

# pylint: disable=used-before-assignment
# pylint: disable=invalid-name 
Example #5
Source File: __init__.py    From trax with Apache License 2.0 5 votes vote down vote up
def configure_rl(*args, **kwargs):
  kwargs['module'] = 'trax.rl'
  return gin.external_configurable(*args, **kwargs) 
Example #6
Source File: __init__.py    From trax with Apache License 2.0 5 votes vote down vote up
def opt_configure(*args, **kwargs):
  kwargs['module'] = 'trax.optimizers'
  return gin.external_configurable(*args, **kwargs)

# Optimizers (using upper-case names).
# pylint: disable=invalid-name 
Example #7
Source File: __init__.py    From trax with Apache License 2.0 5 votes vote down vote up
def model_configure(*args, **kwargs):
  kwargs['module'] = 'trax.models'
  return gin.external_configurable(*args, **kwargs)


# pylint: disable=invalid-name 
Example #8
Source File: __init__.py    From trax with Apache License 2.0 5 votes vote down vote up
def layer_configure(*args, **kwargs):
  kwargs['module'] = 'trax.layers'
  return gin.external_configurable(*args, **kwargs)

# pylint: disable=used-before-assignment
# pylint: disable=invalid-name