Python tensorflow.python.keras.initializers() Examples

The following are 1 code examples of tensorflow.python.keras.initializers(). 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 tensorflow.python.keras , or try the search function .
Example #1
Source File: util.py    From FATE with Apache License 2.0 5 votes vote down vote up
def _get_initializer(initializer, seed):
    if not seed:
        return initializer

    initializer_class = getattr(initializers, initializer, None)
    if initializer_class:
        initializer_instance = initializer_class()
        if hasattr(initializer_instance, "seed"):
            initializer_instance.seed = seed
        return initializer_instance

    return initializer