Make Keras maintain its own initializer classes.
Initializer classes are fundamentally Keras objects (e.g. featuring Keras serialization logic), that were implemented in the TF codebase because of technical details. This meant that the docstrings were disconnected from Keras usage and signatures could not conform to Keras defaults. For instance, the docstring for `tf.keras.initializers.Zeros()` would show examples using `tf.zeros_initializer()`, which made no sense. We are keeping the logic in TF (to avoid code redundancy), but moving class definitions to Keras. Benefits: - Docstrings now corresponding to the objects in `tf.keras.initializers` and show Keras use cases. - Call signature now defaults `dtype` to `floatx()`. - Class names stay the same independently of TF version (e.g. keras.initializers.RandomNormal.__name__ == 'RandomNormal', not 'RandomNormalV2'). - Various edge cases surrounding classes aliased to functions are now fixed (lecun_uniform & friends). PiperOrigin-RevId: 303156255 Change-Id: Idf4171e12e6a9afe231eb38892737d603bcbb851
This commit is contained in:
parent
f611758124
commit
fccc0ae3f8
@ -16,7 +16,6 @@ py_library(
|
||||
"__init__.py",
|
||||
"estimator/__init__.py",
|
||||
"keras_parameterized.py",
|
||||
"ops.py",
|
||||
],
|
||||
srcs_version = "PY2AND3",
|
||||
deps = [
|
||||
@ -189,7 +188,9 @@ py_library(
|
||||
py_library(
|
||||
name = "initializers",
|
||||
srcs = [
|
||||
"initializers.py",
|
||||
"initializers/__init__.py",
|
||||
"initializers/initializers_v1.py",
|
||||
"initializers/initializers_v2.py",
|
||||
],
|
||||
srcs_version = "PY2AND3",
|
||||
deps = [
|
||||
|
@ -47,6 +47,8 @@ keras_packages = [
|
||||
"tensorflow.python.keras.engine.training",
|
||||
"tensorflow.python.keras.estimator",
|
||||
"tensorflow.python.keras.initializers",
|
||||
"tensorflow.python.keras.initializers.initializers_v1",
|
||||
"tensorflow.python.keras.initializers.initializers_v2",
|
||||
"tensorflow.python.keras.layers.advanced_activations",
|
||||
"tensorflow.python.keras.layers.convolutional",
|
||||
"tensorflow.python.keras.layers.convolutional_recurrent",
|
||||
@ -71,7 +73,6 @@ keras_packages = [
|
||||
"tensorflow.python.keras.mixed_precision.experimental.loss_scale_optimizer",
|
||||
"tensorflow.python.keras.mixed_precision.experimental.policy",
|
||||
"tensorflow.python.keras.models",
|
||||
"tensorflow.python.keras.ops",
|
||||
"tensorflow.python.keras.optimizer_v2.adadelta",
|
||||
"tensorflow.python.keras.optimizer_v2.adagrad",
|
||||
"tensorflow.python.keras.optimizer_v2.adam",
|
||||
|
@ -818,6 +818,9 @@ def name_scope(name):
|
||||
"""
|
||||
return ops.name_scope_v2(name)
|
||||
|
||||
# Export V1 version.
|
||||
keras_export(v1=['keras.backend.name_scope'])(ops.name_scope_v1)
|
||||
|
||||
|
||||
@keras_export('keras.backend.variable')
|
||||
def variable(value, dtype=None, name=None, constraint=None):
|
||||
|
@ -1,234 +0,0 @@
|
||||
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
# ==============================================================================
|
||||
"""Keras initializer serialization / deserialization.
|
||||
"""
|
||||
# pylint: disable=unused-import
|
||||
# pylint: disable=line-too-long
|
||||
# pylint: disable=g-import-not-at-top
|
||||
# pylint: disable=g-bad-import-order
|
||||
# pylint: disable=invalid-name
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
import six
|
||||
|
||||
from tensorflow.python import tf2
|
||||
from tensorflow.python.framework import dtypes
|
||||
from tensorflow.python.keras.utils.generic_utils import deserialize_keras_object
|
||||
from tensorflow.python.keras.utils.generic_utils import serialize_keras_object
|
||||
from tensorflow.python.ops import init_ops_v2
|
||||
|
||||
# These imports are brought in so that keras.initializers.deserialize
|
||||
# has them available in module_objects.
|
||||
from tensorflow.python.ops.init_ops_v2 import Constant as ConstantV2
|
||||
from tensorflow.python.ops.init_ops_v2 import GlorotNormal as GlorotNormalV2
|
||||
from tensorflow.python.ops.init_ops_v2 import GlorotUniform as GlorotUniformV2
|
||||
from tensorflow.python.ops.init_ops_v2 import he_normal as he_normalV2
|
||||
from tensorflow.python.ops.init_ops_v2 import he_uniform as he_uniformV2
|
||||
from tensorflow.python.ops.init_ops_v2 import Identity as IdentityV2
|
||||
from tensorflow.python.ops.init_ops_v2 import Initializer as InitializerV2
|
||||
from tensorflow.python.ops.init_ops_v2 import lecun_normal as lecun_normalV2
|
||||
from tensorflow.python.ops.init_ops_v2 import lecun_uniform as lecun_uniformV2
|
||||
from tensorflow.python.ops.init_ops_v2 import Ones as OnesV2
|
||||
from tensorflow.python.ops.init_ops_v2 import Orthogonal as OrthogonalV2
|
||||
from tensorflow.python.ops.init_ops_v2 import RandomNormal as RandomNormalV2
|
||||
from tensorflow.python.ops.init_ops_v2 import RandomUniform as RandomUniformV2
|
||||
from tensorflow.python.ops.init_ops_v2 import TruncatedNormal as TruncatedNormalV2
|
||||
from tensorflow.python.ops.init_ops_v2 import VarianceScaling as VarianceScalingV2
|
||||
from tensorflow.python.ops.init_ops_v2 import Zeros as ZerosV2
|
||||
|
||||
if tf2.enabled():
|
||||
Constant = ConstantV2
|
||||
GlorotNormal = GlorotNormalV2
|
||||
GlorotUniform = GlorotUniformV2
|
||||
he_normal = he_normalV2
|
||||
he_uniform = he_uniformV2
|
||||
Identity = IdentityV2
|
||||
Initializer = InitializerV2
|
||||
lecun_normal = lecun_normalV2
|
||||
lecun_uniform = lecun_uniformV2
|
||||
Ones = OnesV2
|
||||
Orthogonal = OrthogonalV2
|
||||
VarianceScaling = VarianceScalingV2
|
||||
Zeros = ZerosV2
|
||||
else:
|
||||
from tensorflow.python.ops.init_ops import Constant
|
||||
from tensorflow.python.ops.init_ops import GlorotNormal
|
||||
from tensorflow.python.ops.init_ops import GlorotUniform
|
||||
from tensorflow.python.ops.init_ops import he_normal
|
||||
from tensorflow.python.ops.init_ops import he_uniform
|
||||
from tensorflow.python.ops.init_ops import Identity
|
||||
from tensorflow.python.ops.init_ops import Initializer
|
||||
from tensorflow.python.ops.init_ops import lecun_normal
|
||||
from tensorflow.python.ops.init_ops import lecun_uniform
|
||||
from tensorflow.python.ops.init_ops import Ones
|
||||
from tensorflow.python.ops.init_ops import Orthogonal
|
||||
from tensorflow.python.ops.init_ops import VarianceScaling
|
||||
from tensorflow.python.ops.init_ops import Zeros
|
||||
|
||||
from tensorflow.python.ops.init_ops import RandomNormal as TFRandomNormalV1
|
||||
from tensorflow.python.ops.init_ops import RandomUniform as TFRandomUniformV1
|
||||
from tensorflow.python.ops.init_ops import TruncatedNormal as TFTruncatedNormalV1
|
||||
|
||||
from tensorflow.python.util.tf_export import keras_export
|
||||
|
||||
|
||||
@keras_export(v1=['keras.initializers.TruncatedNormal',
|
||||
'keras.initializers.truncated_normal'])
|
||||
class TruncatedNormalV1(TFTruncatedNormalV1):
|
||||
"""Initializer that generates a truncated normal distribution.
|
||||
|
||||
These values are similar to values from a `random_normal_initializer`
|
||||
except that values more than two standard deviations from the mean
|
||||
are discarded and re-drawn. This is the recommended initializer for
|
||||
neural network weights and filters.
|
||||
|
||||
Args:
|
||||
mean: a python scalar or a scalar tensor. Mean of the random values to
|
||||
generate. Defaults to 0.
|
||||
stddev: a python scalar or a scalar tensor. Standard deviation of the random
|
||||
values to generate. Defaults to 0.05.
|
||||
seed: A Python integer. Used to create random seeds. See
|
||||
`tf.compat.v1.set_random_seed` for behavior.
|
||||
dtype: The data type. Only floating point types are supported.
|
||||
|
||||
Returns:
|
||||
A TruncatedNormal instance.
|
||||
"""
|
||||
|
||||
def __init__(self, mean=0.0, stddev=0.05, seed=None, dtype=dtypes.float32):
|
||||
super(TruncatedNormalV1, self).__init__(
|
||||
mean=mean, stddev=stddev, seed=seed, dtype=dtype)
|
||||
|
||||
|
||||
@keras_export(v1=['keras.initializers.RandomUniform',
|
||||
'keras.initializers.uniform',
|
||||
'keras.initializers.random_uniform'])
|
||||
class RandomUniformV1(TFRandomUniformV1):
|
||||
"""Initializer that generates tensors with a uniform distribution.
|
||||
|
||||
Args:
|
||||
minval: A python scalar or a scalar tensor. Lower bound of the range of
|
||||
random values to generate. Defaults to -0.05.
|
||||
maxval: A python scalar or a scalar tensor. Upper bound of the range of
|
||||
random values to generate. Defaults to 0.05.
|
||||
seed: A Python integer. Used to create random seeds. See
|
||||
`tf.compat.v1.set_random_seed` for behavior.
|
||||
dtype: The data type.
|
||||
|
||||
Returns:
|
||||
A RandomUniform instance.
|
||||
"""
|
||||
|
||||
def __init__(self, minval=-0.05, maxval=0.05, seed=None,
|
||||
dtype=dtypes.float32):
|
||||
super(RandomUniformV1, self).__init__(
|
||||
minval=minval, maxval=maxval, seed=seed, dtype=dtype)
|
||||
|
||||
|
||||
@keras_export(v1=['keras.initializers.RandomNormal',
|
||||
'keras.initializers.normal',
|
||||
'keras.initializers.random_normal'])
|
||||
class RandomNormalV1(TFRandomNormalV1):
|
||||
"""Initializer that generates tensors with a normal distribution.
|
||||
|
||||
Args:
|
||||
mean: a python scalar or a scalar tensor. Mean of the random values to
|
||||
generate. Defaults to 0.
|
||||
stddev: a python scalar or a scalar tensor. Standard deviation of the random
|
||||
values to generate. Defaults to 0.05.
|
||||
seed: A Python integer. Used to create random seeds. See
|
||||
`tf.compat.v1.set_random_seed` for behavior.
|
||||
dtype: The data type. Only floating point types are supported.
|
||||
|
||||
Returns:
|
||||
RandomNormal instance.
|
||||
"""
|
||||
|
||||
def __init__(self, mean=0.0, stddev=0.05, seed=None, dtype=dtypes.float32):
|
||||
super(RandomNormalV1, self).__init__(
|
||||
mean=mean, stddev=stddev, seed=seed, dtype=dtype)
|
||||
|
||||
|
||||
if tf2.enabled():
|
||||
RandomNormal = RandomNormalV2
|
||||
RandomUniform = RandomUniformV2
|
||||
TruncatedNormal = TruncatedNormalV2
|
||||
else:
|
||||
RandomNormal = RandomNormalV1
|
||||
RandomUniform = RandomUniformV1
|
||||
TruncatedNormal = TruncatedNormalV1
|
||||
|
||||
# Compatibility aliases
|
||||
zero = zeros = Zeros
|
||||
one = ones = Ones
|
||||
constant = Constant
|
||||
uniform = random_uniform = RandomUniform
|
||||
normal = random_normal = RandomNormal
|
||||
truncated_normal = TruncatedNormal
|
||||
identity = Identity
|
||||
orthogonal = Orthogonal
|
||||
glorot_normal = GlorotNormal
|
||||
glorot_uniform = GlorotUniform
|
||||
|
||||
# Utility functions
|
||||
|
||||
|
||||
@keras_export('keras.initializers.serialize')
|
||||
def serialize(initializer):
|
||||
return serialize_keras_object(initializer)
|
||||
|
||||
|
||||
@keras_export('keras.initializers.deserialize')
|
||||
def deserialize(config, custom_objects=None):
|
||||
"""Return an `Initializer` object from its config."""
|
||||
if tf2.enabled():
|
||||
# Class names are the same for V1 and V2 but the V2 classes
|
||||
# are aliased in this file so we need to grab them directly
|
||||
# from `init_ops_v2`.
|
||||
module_objects = {
|
||||
obj_name: getattr(init_ops_v2, obj_name)
|
||||
for obj_name in dir(init_ops_v2)
|
||||
}
|
||||
else:
|
||||
module_objects = globals()
|
||||
return deserialize_keras_object(
|
||||
config,
|
||||
module_objects=module_objects,
|
||||
custom_objects=custom_objects,
|
||||
printable_module_name='initializer')
|
||||
|
||||
|
||||
@keras_export('keras.initializers.get')
|
||||
def get(identifier):
|
||||
if identifier is None:
|
||||
return None
|
||||
if isinstance(identifier, dict):
|
||||
return deserialize(identifier)
|
||||
elif isinstance(identifier, six.string_types):
|
||||
identifier = str(identifier)
|
||||
# We have to special-case functions that return classes.
|
||||
# TODO(omalleyt): Turn these into classes or class aliases.
|
||||
special_cases = ['he_normal', 'he_uniform', 'lecun_normal', 'lecun_uniform']
|
||||
if identifier in special_cases:
|
||||
# Treat like a class.
|
||||
return deserialize({'class_name': identifier, 'config': {}})
|
||||
return deserialize(identifier)
|
||||
elif callable(identifier):
|
||||
return identifier
|
||||
else:
|
||||
raise ValueError('Could not interpret initializer identifier: ' +
|
||||
str(identifier))
|
142
tensorflow/python/keras/initializers/__init__.py
Normal file
142
tensorflow/python/keras/initializers/__init__.py
Normal file
@ -0,0 +1,142 @@
|
||||
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
# ==============================================================================
|
||||
"""Keras initializer serialization / deserialization.
|
||||
"""
|
||||
# pylint: disable=unused-import
|
||||
# pylint: disable=line-too-long
|
||||
# pylint: disable=g-import-not-at-top
|
||||
# pylint: disable=g-bad-import-order
|
||||
# pylint: disable=invalid-name
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
import six
|
||||
|
||||
from tensorflow.python import tf2
|
||||
from tensorflow.python.keras.utils.generic_utils import deserialize_keras_object
|
||||
from tensorflow.python.keras.utils.generic_utils import serialize_keras_object
|
||||
from tensorflow.python.util.tf_export import keras_export
|
||||
|
||||
# These imports are brought in so that keras.initializers.deserialize
|
||||
# has them available in module_objects.
|
||||
from tensorflow.python.keras.initializers.initializers_v2 import Constant as ConstantV2
|
||||
from tensorflow.python.keras.initializers.initializers_v2 import GlorotNormal as GlorotNormalV2
|
||||
from tensorflow.python.keras.initializers.initializers_v2 import GlorotUniform as GlorotUniformV2
|
||||
from tensorflow.python.keras.initializers.initializers_v2 import HeNormal as HeNormalV2
|
||||
from tensorflow.python.keras.initializers.initializers_v2 import HeUniform as HeUniformV2
|
||||
from tensorflow.python.keras.initializers.initializers_v2 import Identity as IdentityV2
|
||||
from tensorflow.python.keras.initializers.initializers_v2 import Initializer
|
||||
from tensorflow.python.keras.initializers.initializers_v2 import LecunNormal as LecunNormalV2
|
||||
from tensorflow.python.keras.initializers.initializers_v2 import LecunUniform as LecunUniformV2
|
||||
from tensorflow.python.keras.initializers.initializers_v2 import Ones as OnesV2
|
||||
from tensorflow.python.keras.initializers.initializers_v2 import Orthogonal as OrthogonalV2
|
||||
from tensorflow.python.keras.initializers.initializers_v2 import RandomNormal as RandomNormalV2
|
||||
from tensorflow.python.keras.initializers.initializers_v2 import RandomUniform as RandomUniformV2
|
||||
from tensorflow.python.keras.initializers.initializers_v2 import TruncatedNormal as TruncatedNormalV2
|
||||
from tensorflow.python.keras.initializers.initializers_v2 import VarianceScaling as VarianceScalingV2
|
||||
from tensorflow.python.keras.initializers.initializers_v2 import Zeros as ZerosV2
|
||||
|
||||
if tf2.enabled():
|
||||
Constant = ConstantV2
|
||||
GlorotNormal = GlorotNormalV2
|
||||
GlorotUniform = GlorotUniformV2
|
||||
HeNormal = HeNormalV2
|
||||
HeUniform = HeUniformV2
|
||||
Identity = IdentityV2
|
||||
LecunNormal = LecunNormalV2
|
||||
LecunUniform = LecunUniformV2
|
||||
Ones = OnesV2
|
||||
Orthogonal = OrthogonalV2
|
||||
RandomNormal = RandomNormalV2
|
||||
RandomUniform = RandomUniformV2
|
||||
TruncatedNormal = TruncatedNormalV2
|
||||
VarianceScaling = VarianceScalingV2
|
||||
Zeros = ZerosV2
|
||||
else:
|
||||
from tensorflow.python.ops.init_ops import Constant
|
||||
from tensorflow.python.ops.init_ops import GlorotNormal
|
||||
from tensorflow.python.ops.init_ops import GlorotUniform
|
||||
from tensorflow.python.ops.init_ops import Identity
|
||||
from tensorflow.python.ops.init_ops import Ones
|
||||
from tensorflow.python.ops.init_ops import Orthogonal
|
||||
from tensorflow.python.ops.init_ops import VarianceScaling
|
||||
from tensorflow.python.ops.init_ops import Zeros
|
||||
from tensorflow.python.keras.initializers.initializers_v1 import HeNormal
|
||||
from tensorflow.python.keras.initializers.initializers_v1 import HeUniform
|
||||
from tensorflow.python.keras.initializers.initializers_v1 import LecunNormal
|
||||
from tensorflow.python.keras.initializers.initializers_v1 import LecunUniform
|
||||
from tensorflow.python.keras.initializers.initializers_v1 import RandomNormal
|
||||
from tensorflow.python.keras.initializers.initializers_v1 import RandomUniform
|
||||
from tensorflow.python.keras.initializers.initializers_v1 import TruncatedNormal
|
||||
|
||||
|
||||
# Compatibility aliases
|
||||
glorot_normal = GlorotNormal
|
||||
glorot_uniform = GlorotUniform
|
||||
he_normal = HeNormal
|
||||
he_uniform = HeUniform
|
||||
lecun_normal = LecunNormal
|
||||
lecun_uniform = LecunUniform
|
||||
zero = zeros = Zeros
|
||||
one = ones = Ones
|
||||
constant = Constant
|
||||
uniform = random_uniform = RandomUniform
|
||||
normal = random_normal = RandomNormal
|
||||
truncated_normal = TruncatedNormal
|
||||
identity = Identity
|
||||
orthogonal = Orthogonal
|
||||
|
||||
# For unit tests
|
||||
glorot_normalV2 = GlorotNormalV2
|
||||
glorot_uniformV2 = GlorotUniformV2
|
||||
he_normalV2 = HeNormalV2
|
||||
he_uniformV2 = HeUniformV2
|
||||
lecun_normalV2 = LecunNormalV2
|
||||
lecun_uniformV2 = LecunUniformV2
|
||||
|
||||
# Utility functions
|
||||
|
||||
|
||||
@keras_export('keras.initializers.serialize')
|
||||
def serialize(initializer):
|
||||
return serialize_keras_object(initializer)
|
||||
|
||||
|
||||
@keras_export('keras.initializers.deserialize')
|
||||
def deserialize(config, custom_objects=None):
|
||||
"""Return an `Initializer` object from its config."""
|
||||
module_objects = globals()
|
||||
return deserialize_keras_object(
|
||||
config,
|
||||
module_objects=module_objects,
|
||||
custom_objects=custom_objects,
|
||||
printable_module_name='initializer')
|
||||
|
||||
|
||||
@keras_export('keras.initializers.get')
|
||||
def get(identifier):
|
||||
if identifier is None:
|
||||
return None
|
||||
if isinstance(identifier, dict):
|
||||
return deserialize(identifier)
|
||||
elif isinstance(identifier, six.string_types):
|
||||
identifier = str(identifier)
|
||||
return deserialize(identifier)
|
||||
elif callable(identifier):
|
||||
return identifier
|
||||
else:
|
||||
raise ValueError('Could not interpret initializer identifier: ' +
|
||||
str(identifier))
|
112
tensorflow/python/keras/initializers/initializers_v1.py
Normal file
112
tensorflow/python/keras/initializers/initializers_v1.py
Normal file
@ -0,0 +1,112 @@
|
||||
# Copyright 2020 The TensorFlow Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
# ==============================================================================
|
||||
"""Keras initializers for TF 1.
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
from tensorflow.python.framework import dtypes
|
||||
from tensorflow.python.ops import init_ops
|
||||
from tensorflow.python.util.tf_export import keras_export
|
||||
|
||||
keras_export(v1=['keras.initializers.Zeros', 'keras.initializers.zeros'])(
|
||||
init_ops.Zeros)
|
||||
keras_export(v1=['keras.initializers.Ones', 'keras.initializers.ones'])(
|
||||
init_ops.Ones)
|
||||
keras_export(v1=['keras.initializers.Constant', 'keras.initializers.constant'])(
|
||||
init_ops.Constant)
|
||||
keras_export(v1=['keras.initializers.VarianceScaling'])(
|
||||
init_ops.VarianceScaling)
|
||||
keras_export(v1=['keras.initializers.Orthogonal',
|
||||
'keras.initializers.orthogonal'])(init_ops.Orthogonal)
|
||||
keras_export(v1=['keras.initializers.Identity',
|
||||
'keras.initializers.identity'])(init_ops.Identity)
|
||||
keras_export(v1=['keras.initializers.glorot_uniform'])(init_ops.GlorotUniform)
|
||||
keras_export(v1=['keras.initializers.glorot_normal'])(init_ops.GlorotNormal)
|
||||
|
||||
|
||||
@keras_export(v1=['keras.initializers.RandomNormal',
|
||||
'keras.initializers.random_normal',
|
||||
'keras.initializers.normal'])
|
||||
class RandomNormal(init_ops.RandomNormal):
|
||||
|
||||
def __init__(self, mean=0.0, stddev=0.05, seed=None, dtype=dtypes.float32):
|
||||
super(RandomNormal, self).__init__(
|
||||
mean=mean, stddev=stddev, seed=seed, dtype=dtype)
|
||||
|
||||
|
||||
@keras_export(v1=['keras.initializers.RandomUniform',
|
||||
'keras.initializers.random_uniform',
|
||||
'keras.initializers.uniform'])
|
||||
class RandomUniform(init_ops.RandomUniform):
|
||||
|
||||
def __init__(self, minval=-0.05, maxval=0.05, seed=None,
|
||||
dtype=dtypes.float32):
|
||||
super(RandomUniform, self).__init__(
|
||||
minval=minval, maxval=maxval, seed=seed, dtype=dtype)
|
||||
|
||||
|
||||
@keras_export(v1=['keras.initializers.TruncatedNormal',
|
||||
'keras.initializers.truncated_normal'])
|
||||
class TruncatedNormal(init_ops.TruncatedNormal):
|
||||
|
||||
def __init__(self, mean=0.0, stddev=0.05, seed=None, dtype=dtypes.float32):
|
||||
super(TruncatedNormal, self).__init__(
|
||||
mean=mean, stddev=stddev, seed=seed, dtype=dtype)
|
||||
|
||||
|
||||
@keras_export(v1=['keras.initializers.lecun_normal'])
|
||||
class LecunNormal(init_ops.VarianceScaling):
|
||||
|
||||
def __init__(self, seed=None):
|
||||
super(LecunNormal, self).__init__(
|
||||
scale=1., mode='fan_in', distribution='truncated_normal', seed=seed)
|
||||
|
||||
def get_config(self):
|
||||
return {'seed': self.seed}
|
||||
|
||||
|
||||
@keras_export(v1=['keras.initializers.lecun_uniform'])
|
||||
class LecunUniform(init_ops.VarianceScaling):
|
||||
|
||||
def __init__(self, seed=None):
|
||||
super(LecunUniform, self).__init__(
|
||||
scale=1., mode='fan_in', distribution='uniform', seed=seed)
|
||||
|
||||
def get_config(self):
|
||||
return {'seed': self.seed}
|
||||
|
||||
|
||||
@keras_export(v1=['keras.initializers.he_normal'])
|
||||
class HeNormal(init_ops.VarianceScaling):
|
||||
|
||||
def __init__(self, seed=None):
|
||||
super(HeNormal, self).__init__(
|
||||
scale=2., mode='fan_in', distribution='truncated_normal', seed=seed)
|
||||
|
||||
def get_config(self):
|
||||
return {'seed': self.seed}
|
||||
|
||||
|
||||
@keras_export(v1=['keras.initializers.he_uniform'])
|
||||
class HeUniform(init_ops.VarianceScaling):
|
||||
|
||||
def __init__(self, seed=None):
|
||||
super(HeUniform, self).__init__(
|
||||
scale=2., mode='fan_in', distribution='uniform', seed=seed)
|
||||
|
||||
def get_config(self):
|
||||
return {'seed': self.seed}
|
751
tensorflow/python/keras/initializers/initializers_v2.py
Normal file
751
tensorflow/python/keras/initializers/initializers_v2.py
Normal file
@ -0,0 +1,751 @@
|
||||
# Copyright 2020 The TensorFlow Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
# ==============================================================================
|
||||
"""Keras initializers for TF 2.
|
||||
"""
|
||||
# pylint: disable=g-classes-have-attributes
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
from tensorflow.python.framework import constant_op
|
||||
from tensorflow.python.framework import dtypes
|
||||
from tensorflow.python.keras import backend
|
||||
from tensorflow.python.ops import init_ops_v2
|
||||
from tensorflow.python.util.tf_export import keras_export
|
||||
|
||||
|
||||
@keras_export('keras.initializers.Initializer')
|
||||
class Initializer(object):
|
||||
"""Initializer base class: all Keras initializers inherit from this class.
|
||||
|
||||
Initializers should implement a `__call__` method with the following
|
||||
signature:
|
||||
|
||||
```python
|
||||
def __call__(self, shape, dtype=None)`:
|
||||
# returns a tensor of shape `shape` and dtype `dtype`
|
||||
# containing values drawn from a distribution of your choice.
|
||||
```
|
||||
|
||||
Optionally, you an also implement the method `get_config` and the class
|
||||
method `from_config` in order to support serialization -- just like with
|
||||
any Keras object.
|
||||
|
||||
Here's a simple example: a random normal initializer.
|
||||
|
||||
```python
|
||||
import tensorflow as tf
|
||||
|
||||
class ExampleRandomNormal(tf.keras.initializers.Initializer):
|
||||
|
||||
def __init__(self, mean, stddev):
|
||||
self.mean = mean
|
||||
self.stddev = stddev
|
||||
|
||||
def __call__(self, shape, dtype=None)`:
|
||||
return tf.random.normal(
|
||||
shape, mean=self.mean, stddev=self.stddev, dtype=dtype)
|
||||
|
||||
def get_config(self): # To support serialization
|
||||
return {"mean": self.mean, "stddev": self.stddev}
|
||||
```
|
||||
|
||||
Note that we don't have to implement `from_config` in the example above since
|
||||
the constructor arguments of the class the keys in the config returned by
|
||||
`get_config` are the same. In this case, the default `from_config`
|
||||
works fine.
|
||||
"""
|
||||
|
||||
def __call__(self, shape, dtype=None):
|
||||
"""Returns a tensor object initialized as specified by the initializer.
|
||||
|
||||
Args:
|
||||
shape: Shape of the tensor.
|
||||
dtype: Optional dtype of the tensor.
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
def get_config(self):
|
||||
"""Returns the configuration of the initializer as a JSON-serializable dict.
|
||||
|
||||
Returns:
|
||||
A JSON-serializable Python dict.
|
||||
"""
|
||||
return {}
|
||||
|
||||
@classmethod
|
||||
def from_config(cls, config):
|
||||
"""Instantiates an initializer from a configuration dictionary.
|
||||
|
||||
Example:
|
||||
|
||||
```python
|
||||
initializer = RandomUniform(-1, 1)
|
||||
config = initializer.get_config()
|
||||
initializer = RandomUniform.from_config(config)
|
||||
```
|
||||
|
||||
Args:
|
||||
config: A Python dictionary, the output of `get_config`.
|
||||
|
||||
Returns:
|
||||
A `tf.keras.initializers.Initializer` instance.
|
||||
"""
|
||||
config.pop('dtype', None)
|
||||
return cls(**config)
|
||||
|
||||
|
||||
@keras_export('keras.initializers.Zeros', 'keras.initializers.zeros', v1=[])
|
||||
class Zeros(init_ops_v2.Zeros, Initializer):
|
||||
"""Initializer that generates tensors initialized to 0.
|
||||
|
||||
Also available via the shortcut function `tf.keras.initializers.zeros`.
|
||||
|
||||
Examples:
|
||||
|
||||
>>> # Standalone usage:
|
||||
>>> initializer = tf.keras.initializers.Zeros()
|
||||
>>> values = initializer(shape=(2, 2))
|
||||
|
||||
>>> # Usage in a Keras layer:
|
||||
>>> initializer = tf.keras.initializers.Zeros()
|
||||
>>> layer = tf.keras.layers.Dense(3, kernel_initializer=initializer)
|
||||
"""
|
||||
|
||||
def __call__(self, shape, dtype=None):
|
||||
"""Returns a tensor object initialized as specified by the initializer.
|
||||
|
||||
Args:
|
||||
shape: Shape of the tensor.
|
||||
dtype: Optional dtype of the tensor. Only numeric or boolean dtypes are
|
||||
supported. If not specified, `tf.keras.backend.floatx()` is used,
|
||||
which default to `float32` unless you configured it otherwise
|
||||
(via `tf.keras.backend.set_floatx(float_dtype)`).
|
||||
"""
|
||||
return super(Zeros, self).__call__(shape, dtype=_get_dtype(dtype))
|
||||
|
||||
|
||||
@keras_export('keras.initializers.Ones', 'keras.initializers.ones', v1=[])
|
||||
class Ones(init_ops_v2.Ones, Initializer):
|
||||
"""Initializer that generates tensors initialized to 1.
|
||||
|
||||
Also available via the shortcut function `tf.keras.initializers.ones`.
|
||||
|
||||
Examples:
|
||||
|
||||
>>> # Standalone usage:
|
||||
>>> initializer = tf.keras.initializers.Ones()
|
||||
>>> values = initializer(shape=(2, 2))
|
||||
|
||||
>>> # Usage in a Keras layer:
|
||||
>>> initializer = tf.keras.initializers.Ones()
|
||||
>>> layer = tf.keras.layers.Dense(3, kernel_initializer=initializer)
|
||||
"""
|
||||
|
||||
def __call__(self, shape, dtype=None):
|
||||
"""Returns a tensor object initialized as specified by the initializer.
|
||||
|
||||
Args:
|
||||
shape: Shape of the tensor.
|
||||
dtype: Optional dtype of the tensor. Only numeric or boolean dtypes are
|
||||
supported. If not specified, `tf.keras.backend.floatx()` is used,
|
||||
which default to `float32` unless you configured it otherwise
|
||||
(via `tf.keras.backend.set_floatx(float_dtype)`).
|
||||
"""
|
||||
return super(Ones, self).__call__(shape, dtype=_get_dtype(dtype))
|
||||
|
||||
|
||||
@keras_export('keras.initializers.Constant',
|
||||
'keras.initializers.constant',
|
||||
v1=[])
|
||||
class Constant(Initializer):
|
||||
"""Initializer that generates tensors with constant values.
|
||||
|
||||
Also available via the shortcut function `tf.keras.initializers.constant`.
|
||||
|
||||
Only scalar values are allowed.
|
||||
The constant value provided must be convertible to the dtype requested
|
||||
when calling the initializer.
|
||||
|
||||
Examples:
|
||||
|
||||
>>> # Standalone usage:
|
||||
>>> initializer = tf.keras.initializers.Constant(3.)
|
||||
>>> values = initializer(shape=(2, 2))
|
||||
|
||||
>>> # Usage in a Keras layer:
|
||||
>>> initializer = tf.keras.initializers.Constant(3.)
|
||||
>>> layer = tf.keras.layers.Dense(3, kernel_initializer=initializer)
|
||||
|
||||
Args:
|
||||
value: A Python scalar.
|
||||
"""
|
||||
|
||||
def __init__(self, value=0):
|
||||
self.value = value
|
||||
|
||||
def __call__(self, shape, dtype=None):
|
||||
"""Returns a tensor object initialized to `self.value`.
|
||||
|
||||
Args:
|
||||
shape: Shape of the tensor.
|
||||
dtype: Optional dtype of the tensor. If not specified,
|
||||
`tf.keras.backend.floatx()` is used,
|
||||
which default to `float32` unless you configured it otherwise
|
||||
(via `tf.keras.backend.set_floatx(float_dtype)`).
|
||||
"""
|
||||
return constant_op.constant(
|
||||
self.value, dtype=_get_dtype(dtype), shape=shape)
|
||||
|
||||
def get_config(self):
|
||||
return {'value': self.value}
|
||||
|
||||
|
||||
@keras_export('keras.initializers.RandomUniform',
|
||||
'keras.initializers.random_uniform',
|
||||
v1=[])
|
||||
class RandomUniform(init_ops_v2.RandomUniform, Initializer):
|
||||
"""Initializer that generates tensors with a uniform distribution.
|
||||
|
||||
Also available via the shortcut function
|
||||
`tf.keras.initializers.random_uniform`.
|
||||
|
||||
Examples:
|
||||
|
||||
>>> # Standalone usage:
|
||||
>>> initializer = tf.keras.initializers.RandomUniform(minval=0., maxval=1.)
|
||||
>>> values = initializer(shape=(2, 2))
|
||||
|
||||
>>> # Usage in a Keras layer:
|
||||
>>> initializer = tf.keras.initializers.RandomUniform(minval=0., maxval=1.)
|
||||
>>> layer = tf.keras.layers.Dense(3, kernel_initializer=initializer)
|
||||
|
||||
Args:
|
||||
minval: A python scalar or a scalar tensor. Lower bound of the range of
|
||||
random values to generate (inclusive).
|
||||
maxval: A python scalar or a scalar tensor. Upper bound of the range of
|
||||
random values to generate (exclusive).
|
||||
seed: A Python integer. An initializer created with a given seed will
|
||||
always produce the same random tensor for a given shape and dtype.
|
||||
"""
|
||||
|
||||
def __call__(self, shape, dtype=None):
|
||||
"""Returns a tensor object initialized as specified by the initializer.
|
||||
|
||||
Args:
|
||||
shape: Shape of the tensor.
|
||||
dtype: Optional dtype of the tensor. Only floating point and integer
|
||||
types are supported. If not specified,
|
||||
`tf.keras.backend.floatx()` is used,
|
||||
which default to `float32` unless you configured it otherwise
|
||||
(via `tf.keras.backend.set_floatx(float_dtype)`).
|
||||
"""
|
||||
return super(RandomUniform, self).__call__(shape, dtype=_get_dtype(dtype))
|
||||
|
||||
|
||||
@keras_export('keras.initializers.RandomNormal',
|
||||
'keras.initializers.random_normal',
|
||||
v1=[])
|
||||
class RandomNormal(init_ops_v2.RandomNormal, Initializer):
|
||||
"""Initializer that generates tensors with a normal distribution.
|
||||
|
||||
Also available via the shortcut function
|
||||
`tf.keras.initializers.random_normal`.
|
||||
|
||||
Examples:
|
||||
|
||||
>>> # Standalone usage:
|
||||
>>> initializer = tf.keras.initializers.RandomNormal(mean=0., stddev=1.)
|
||||
>>> values = initializer(shape=(2, 2))
|
||||
|
||||
>>> # Usage in a Keras layer:
|
||||
>>> initializer = tf.keras.initializers.RandomNormal(mean=0., stddev=1.)
|
||||
>>> layer = tf.keras.layers.Dense(3, kernel_initializer=initializer)
|
||||
|
||||
Args:
|
||||
mean: a python scalar or a scalar tensor. Mean of the random values to
|
||||
generate.
|
||||
stddev: a python scalar or a scalar tensor. Standard deviation of the random
|
||||
values to generate.
|
||||
seed: A Python integer. An initializer created with a given seed will
|
||||
always produce the same random tensor for a given shape and dtype.
|
||||
"""
|
||||
|
||||
def __call__(self, shape, dtype=None):
|
||||
"""Returns a tensor object initialized to random normal values.
|
||||
|
||||
Args:
|
||||
shape: Shape of the tensor.
|
||||
dtype: Optional dtype of the tensor. Only floating point types are
|
||||
supported. If not specified, `tf.keras.backend.floatx()` is used,
|
||||
which default to `float32` unless you configured it otherwise
|
||||
(via `tf.keras.backend.set_floatx(float_dtype)`)
|
||||
"""
|
||||
return super(RandomNormal, self).__call__(shape, dtype=_get_dtype(dtype))
|
||||
|
||||
|
||||
@keras_export('keras.initializers.TruncatedNormal',
|
||||
'keras.initializers.truncated_normal',
|
||||
v1=[])
|
||||
class TruncatedNormal(init_ops_v2.TruncatedNormal, Initializer):
|
||||
"""Initializer that generates a truncated normal distribution.
|
||||
|
||||
Also available via the shortcut function
|
||||
`tf.keras.initializers.truncated_normal`.
|
||||
|
||||
The values generated are similar to values from a
|
||||
`tf.keras.initializers.RandomNormal` initializer except that values more
|
||||
than two standard deviations from the mean are
|
||||
discarded and re-drawn.
|
||||
|
||||
Examples:
|
||||
|
||||
>>> # Standalone usage:
|
||||
>>> initializer = tf.keras.initializers.TruncatedNormal(mean=0., stddev=1.)
|
||||
>>> values = initializer(shape=(2, 2))
|
||||
|
||||
>>> # Usage in a Keras layer:
|
||||
>>> initializer = tf.keras.initializers.TruncatedNormal(mean=0., stddev=1.)
|
||||
>>> layer = tf.keras.layers.Dense(3, kernel_initializer=initializer)
|
||||
|
||||
Args:
|
||||
mean: a python scalar or a scalar tensor. Mean of the random values
|
||||
to generate.
|
||||
stddev: a python scalar or a scalar tensor. Standard deviation of the
|
||||
random values to generate.
|
||||
seed: A Python integer. An initializer created with a given seed will
|
||||
always produce the same random tensor for a given shape and dtype.
|
||||
"""
|
||||
|
||||
def __call__(self, shape, dtype=None):
|
||||
"""Returns a tensor object initialized to random normal values (truncated).
|
||||
|
||||
Args:
|
||||
shape: Shape of the tensor.
|
||||
dtype: Optional dtype of the tensor. Only floating point types are
|
||||
supported. If not specified, `tf.keras.backend.floatx()` is used,
|
||||
which default to `float32` unless you configured it otherwise
|
||||
(via `tf.keras.backend.set_floatx(float_dtype)`)
|
||||
"""
|
||||
return super(TruncatedNormal, self).__call__(shape, dtype=_get_dtype(dtype))
|
||||
|
||||
|
||||
@keras_export('keras.initializers.VarianceScaling',
|
||||
'keras.initializers.variance_scaling',
|
||||
v1=[])
|
||||
class VarianceScaling(init_ops_v2.VarianceScaling, Initializer):
|
||||
"""Initializer capable of adapting its scale to the shape of weights tensors.
|
||||
|
||||
Also available via the shortcut function
|
||||
`tf.keras.initializers.variance_scaling`.
|
||||
|
||||
With `distribution="truncated_normal" or "untruncated_normal"`, samples are
|
||||
drawn from a truncated/untruncated normal distribution with a mean of zero and
|
||||
a standard deviation (after truncation, if used) `stddev = sqrt(scale / n)`
|
||||
where n is:
|
||||
|
||||
- number of input units in the weight tensor, if mode = "fan_in"
|
||||
- number of output units, if mode = "fan_out"
|
||||
- average of the numbers of input and output units, if mode = "fan_avg"
|
||||
|
||||
With `distribution="uniform"`, samples are drawn from a uniform distribution
|
||||
within [-limit, limit], with `limit = sqrt(3 * scale / n)`.
|
||||
|
||||
Examples:
|
||||
|
||||
>>> # Standalone usage:
|
||||
>>> initializer = tf.keras.initializers.VarianceScaling(
|
||||
... scale=0.1, mode='fan_in', distribution='uniform')
|
||||
>>> values = initializer(shape=(2, 2))
|
||||
|
||||
>>> # Usage in a Keras layer:
|
||||
>>> initializer = tf.keras.initializers.VarianceScaling(
|
||||
... scale=0.1, mode='fan_in', distribution='uniform')
|
||||
>>> layer = tf.keras.layers.Dense(3, kernel_initializer=initializer)
|
||||
|
||||
Args:
|
||||
scale: Scaling factor (positive float).
|
||||
mode: One of "fan_in", "fan_out", "fan_avg".
|
||||
distribution: Random distribution to use. One of "truncated_normal",
|
||||
"untruncated_normal" and "uniform".
|
||||
seed: A Python integer. An initializer created with a given seed will
|
||||
always produce the same random tensor for a given shape and dtype.
|
||||
"""
|
||||
|
||||
def __call__(self, shape, dtype=None):
|
||||
"""Returns a tensor object initialized as specified by the initializer.
|
||||
|
||||
Args:
|
||||
shape: Shape of the tensor.
|
||||
dtype: Optional dtype of the tensor. Only floating point types are
|
||||
supported. If not specified, `tf.keras.backend.floatx()` is used,
|
||||
which default to `float32` unless you configured it otherwise
|
||||
(via `tf.keras.backend.set_floatx(float_dtype)`)
|
||||
"""
|
||||
return super(VarianceScaling, self).__call__(shape, dtype=_get_dtype(dtype))
|
||||
|
||||
|
||||
@keras_export('keras.initializers.Orthogonal',
|
||||
'keras.initializers.orthogonal',
|
||||
v1=[])
|
||||
class Orthogonal(init_ops_v2.Orthogonal, Initializer):
|
||||
"""Initializer that generates an orthogonal matrix.
|
||||
|
||||
Also available via the shortcut function `tf.keras.initializers.orthogonal`.
|
||||
|
||||
If the shape of the tensor to initialize is two-dimensional, it is initialized
|
||||
with an orthogonal matrix obtained from the QR decomposition of a matrix of
|
||||
random numbers drawn from a normal distribution.
|
||||
If the matrix has fewer rows than columns then the output will have orthogonal
|
||||
rows. Otherwise, the output will have orthogonal columns.
|
||||
|
||||
If the shape of the tensor to initialize is more than two-dimensional,
|
||||
a matrix of shape `(shape[0] * ... * shape[n - 2], shape[n - 1])`
|
||||
is initialized, where `n` is the length of the shape vector.
|
||||
The matrix is subsequently reshaped to give a tensor of the desired shape.
|
||||
|
||||
Examples:
|
||||
|
||||
>>> # Standalone usage:
|
||||
>>> initializer = tf.keras.initializers.Orthogonal()
|
||||
>>> values = initializer(shape=(2, 2))
|
||||
|
||||
>>> # Usage in a Keras layer:
|
||||
>>> initializer = tf.keras.initializers.Orthogonal()
|
||||
>>> layer = tf.keras.layers.Dense(3, kernel_initializer=initializer)
|
||||
|
||||
Args:
|
||||
gain: multiplicative factor to apply to the orthogonal matrix
|
||||
seed: A Python integer. An initializer created with a given seed will
|
||||
always produce the same random tensor for a given shape and dtype.
|
||||
|
||||
References:
|
||||
[Saxe et al., 2014](https://openreview.net/forum?id=_wzZwKpTDF_9C)
|
||||
([pdf](https://arxiv.org/pdf/1312.6120.pdf))
|
||||
"""
|
||||
|
||||
def __call__(self, shape, dtype=None):
|
||||
"""Returns a tensor object initialized to an orthogonal matrix.
|
||||
|
||||
Args:
|
||||
shape: Shape of the tensor.
|
||||
dtype: Optional dtype of the tensor. Only floating point types are
|
||||
supported. If not specified, `tf.keras.backend.floatx()` is used,
|
||||
which default to `float32` unless you configured it otherwise
|
||||
(via `tf.keras.backend.set_floatx(float_dtype)`)
|
||||
"""
|
||||
return super(Orthogonal, self).__call__(shape, dtype=_get_dtype(dtype))
|
||||
|
||||
|
||||
@keras_export('keras.initializers.Identity',
|
||||
'keras.initializers.identity',
|
||||
v1=[])
|
||||
class Identity(init_ops_v2.Identity, Initializer):
|
||||
"""Initializer that generates the identity matrix.
|
||||
|
||||
Also available via the shortcut function `tf.keras.initializers.identity`.
|
||||
|
||||
Only usable for generating 2D matrices.
|
||||
|
||||
Examples:
|
||||
|
||||
>>> # Standalone usage:
|
||||
>>> initializer = tf.keras.initializers.Identity()
|
||||
>>> values = initializer(shape=(2, 2))
|
||||
|
||||
>>> # Usage in a Keras layer:
|
||||
>>> initializer = tf.keras.initializers.Identity()
|
||||
>>> layer = tf.keras.layers.Dense(3, kernel_initializer=initializer)
|
||||
|
||||
Args:
|
||||
gain: Multiplicative factor to apply to the identity matrix.
|
||||
"""
|
||||
|
||||
def __call__(self, shape, dtype=None):
|
||||
"""Returns a tensor object initialized to a 2D identity matrix.
|
||||
|
||||
Args:
|
||||
shape: Shape of the tensor. It should have exactly rank 2.
|
||||
dtype: Optional dtype of the tensor. Only floating point types are
|
||||
supported. If not specified, `tf.keras.backend.floatx()` is used,
|
||||
which default to `float32` unless you configured it otherwise
|
||||
(via `tf.keras.backend.set_floatx(float_dtype)`)
|
||||
"""
|
||||
return super(Identity, self).__call__(shape, dtype=_get_dtype(dtype))
|
||||
|
||||
|
||||
@keras_export('keras.initializers.GlorotUniform',
|
||||
'keras.initializers.glorot_uniform',
|
||||
v1=[])
|
||||
class GlorotUniform(VarianceScaling):
|
||||
"""The Glorot uniform initializer, also called Xavier uniform initializer.
|
||||
|
||||
Also available via the shortcut function
|
||||
`tf.keras.initializers.glorot_uniform`.
|
||||
|
||||
Draws samples from a uniform distribution within [-limit, limit] where `limit`
|
||||
is `sqrt(6 / (fan_in + fan_out))` where `fan_in` is the number of input units
|
||||
in the weight tensor and `fan_out` is the number of output units in the weight
|
||||
tensor.
|
||||
|
||||
Examples:
|
||||
|
||||
>>> # Standalone usage:
|
||||
>>> initializer = tf.keras.initializers.GlorotUniform()
|
||||
>>> values = initializer(shape=(2, 2))
|
||||
|
||||
>>> # Usage in a Keras layer:
|
||||
>>> initializer = tf.keras.initializers.GlorotUniform()
|
||||
>>> layer = tf.keras.layers.Dense(3, kernel_initializer=initializer)
|
||||
|
||||
Args:
|
||||
seed: A Python integer. An initializer created with a given seed will
|
||||
always produce the same random tensor for a given shape and dtype.
|
||||
|
||||
References:
|
||||
[Glorot et al., 2010](http://proceedings.mlr.press/v9/glorot10a.html)
|
||||
([pdf](http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf))
|
||||
"""
|
||||
|
||||
def __init__(self, seed=None):
|
||||
super(GlorotUniform, self).__init__(
|
||||
scale=1.0,
|
||||
mode='fan_avg',
|
||||
distribution='uniform',
|
||||
seed=seed)
|
||||
|
||||
def get_config(self):
|
||||
return {'seed': self.seed}
|
||||
|
||||
|
||||
@keras_export('keras.initializers.GlorotNormal',
|
||||
'keras.initializers.glorot_normal',
|
||||
v1=[])
|
||||
class GlorotNormal(VarianceScaling):
|
||||
"""The Glorot normal initializer, also called Xavier normal initializer.
|
||||
|
||||
Also available via the shortcut function
|
||||
`tf.keras.initializers.glorot_normal`.
|
||||
|
||||
Draws samples from a truncated normal distribution centered on 0 with `stddev
|
||||
= sqrt(2 / (fan_in + fan_out))` where `fan_in` is the number of input units in
|
||||
the weight tensor and `fan_out` is the number of output units in the weight
|
||||
tensor.
|
||||
|
||||
Examples:
|
||||
|
||||
>>> # Standalone usage:
|
||||
>>> initializer = tf.keras.initializers.GlorotNormal()
|
||||
>>> values = initializer(shape=(2, 2))
|
||||
|
||||
>>> # Usage in a Keras layer:
|
||||
>>> initializer = tf.keras.initializers.GlorotNormal()
|
||||
>>> layer = tf.keras.layers.Dense(3, kernel_initializer=initializer)
|
||||
|
||||
Args:
|
||||
seed: A Python integer. An initializer created with a given seed will
|
||||
always produce the same random tensor for a given shape and dtype.
|
||||
|
||||
References:
|
||||
[Glorot et al., 2010](http://proceedings.mlr.press/v9/glorot10a.html)
|
||||
([pdf](http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf))
|
||||
"""
|
||||
|
||||
def __init__(self, seed=None):
|
||||
super(GlorotNormal, self).__init__(
|
||||
scale=1.0,
|
||||
mode='fan_avg',
|
||||
distribution='truncated_normal',
|
||||
seed=seed)
|
||||
|
||||
def get_config(self):
|
||||
return {'seed': self.seed}
|
||||
|
||||
|
||||
@keras_export('keras.initializers.LecunNormal',
|
||||
'keras.initializers.lecun_normal',
|
||||
v1=[])
|
||||
class LecunNormal(VarianceScaling):
|
||||
"""Lecun normal initializer.
|
||||
|
||||
Also available via the shortcut function
|
||||
`tf.keras.initializers.lecun_normal`.
|
||||
|
||||
Initializers allow you to pre-specify an initialization strategy, encoded in
|
||||
the Initializer object, without knowing the shape and dtype of the variable
|
||||
being initialized.
|
||||
|
||||
Draws samples from a truncated normal distribution centered on 0 with `stddev
|
||||
= sqrt(1 / fan_in)` where `fan_in` is the number of input units in the weight
|
||||
tensor.
|
||||
|
||||
Examples:
|
||||
|
||||
>>> # Standalone usage:
|
||||
>>> initializer = tf.keras.initializers.LecunNormal()
|
||||
>>> values = initializer(shape=(2, 2))
|
||||
|
||||
>>> # Usage in a Keras layer:
|
||||
>>> initializer = tf.keras.initializers.LecunNormal()
|
||||
>>> layer = tf.keras.layers.Dense(3, kernel_initializer=initializer)
|
||||
|
||||
Arguments:
|
||||
seed: A Python integer. Used to seed the random generator.
|
||||
|
||||
References:
|
||||
- Self-Normalizing Neural Networks,
|
||||
[Klambauer et al., 2017]
|
||||
(https://papers.nips.cc/paper/6698-self-normalizing-neural-networks)
|
||||
([pdf]
|
||||
(https://papers.nips.cc/paper/6698-self-normalizing-neural-networks.pdf))
|
||||
- Efficient Backprop,
|
||||
[Lecun et al., 1998](http://yann.lecun.com/exdb/publis/pdf/lecun-98b.pdf)
|
||||
"""
|
||||
|
||||
def __init__(self, seed=None):
|
||||
super(LecunNormal, self).__init__(
|
||||
scale=1., mode='fan_in', distribution='truncated_normal', seed=seed)
|
||||
|
||||
def get_config(self):
|
||||
return {'seed': self.seed}
|
||||
|
||||
|
||||
@keras_export('keras.initializers.LecunUniform',
|
||||
'keras.initializers.lecun_uniform',
|
||||
v1=[])
|
||||
class LecunUniform(VarianceScaling):
|
||||
"""Lecun uniform initializer.
|
||||
|
||||
Also available via the shortcut function
|
||||
`tf.keras.initializers.lecun_uniform`.
|
||||
|
||||
Draws samples from a uniform distribution within [-limit, limit] where `limit`
|
||||
is `sqrt(3 / fan_in)` where `fan_in` is the number of input units in the
|
||||
weight tensor.
|
||||
|
||||
Examples:
|
||||
|
||||
>>> # Standalone usage:
|
||||
>>> initializer = tf.keras.initializers.LecunUniform()
|
||||
>>> values = initializer(shape=(2, 2))
|
||||
|
||||
>>> # Usage in a Keras layer:
|
||||
>>> initializer = tf.keras.initializers.LecunUniform()
|
||||
>>> layer = tf.keras.layers.Dense(3, kernel_initializer=initializer)
|
||||
|
||||
Arguments:
|
||||
seed: A Python integer. An initializer created with a given seed will
|
||||
always produce the same random tensor for a given shape and dtype.
|
||||
|
||||
References:
|
||||
- Self-Normalizing Neural Networks,
|
||||
[Klambauer et al., 2017](https://papers.nips.cc/paper/6698-self-normalizing-neural-networks) # pylint: disable=line-too-long
|
||||
([pdf](https://papers.nips.cc/paper/6698-self-normalizing-neural-networks.pdf))
|
||||
- Efficient Backprop,
|
||||
[Lecun et al., 1998](http://yann.lecun.com/exdb/publis/pdf/lecun-98b.pdf)
|
||||
"""
|
||||
|
||||
def __init__(self, seed=None):
|
||||
super(LecunUniform, self).__init__(
|
||||
scale=1., mode='fan_in', distribution='uniform', seed=seed)
|
||||
|
||||
def get_config(self):
|
||||
return {'seed': self.seed}
|
||||
|
||||
|
||||
@keras_export('keras.initializers.HeNormal',
|
||||
'keras.initializers.he_normal',
|
||||
v1=[])
|
||||
class HeNormal(VarianceScaling):
|
||||
"""He normal initializer.
|
||||
|
||||
Also available via the shortcut function
|
||||
`tf.keras.initializers.he_normal`.
|
||||
|
||||
It draws samples from a truncated normal distribution centered on 0 with
|
||||
`stddev = sqrt(2 / fan_in)` where `fan_in` is the number of input units in the
|
||||
weight tensor.
|
||||
|
||||
Examples:
|
||||
|
||||
>>> # Standalone usage:
|
||||
>>> initializer = tf.keras.initializers.HeNormal()
|
||||
>>> values = initializer(shape=(2, 2))
|
||||
|
||||
>>> # Usage in a Keras layer:
|
||||
>>> initializer = tf.keras.initializers.HeNormal()
|
||||
>>> layer = tf.keras.layers.Dense(3, kernel_initializer=initializer)
|
||||
|
||||
Arguments:
|
||||
seed: A Python integer. An initializer created with a given seed will
|
||||
always produce the same random tensor for a given shape and dtype.
|
||||
|
||||
References:
|
||||
[He et al., 2015](https://www.cv-foundation.org/openaccess/content_iccv_2015/html/He_Delving_Deep_into_ICCV_2015_paper.html) # pylint: disable=line-too-long
|
||||
([pdf](https://www.cv-foundation.org/openaccess/content_iccv_2015/papers/He_Delving_Deep_into_ICCV_2015_paper.pdf))
|
||||
"""
|
||||
|
||||
def __init__(self, seed=None):
|
||||
super(HeNormal, self).__init__(
|
||||
scale=2., mode='fan_in', distribution='truncated_normal', seed=seed)
|
||||
|
||||
def get_config(self):
|
||||
return {'seed': self.seed}
|
||||
|
||||
|
||||
@keras_export('keras.initializers.HeUniform',
|
||||
'keras.initializers.he_uniform',
|
||||
v1=[])
|
||||
class HeUniform(VarianceScaling):
|
||||
"""He uniform variance scaling initializer.
|
||||
|
||||
Also available via the shortcut function
|
||||
`tf.keras.initializers.he_uniform`.
|
||||
|
||||
Draws samples from a uniform distribution within [-limit, limit] where `limit`
|
||||
is `sqrt(6 / fan_in)` where `fan_in` is the number of input units in the
|
||||
weight tensor.
|
||||
|
||||
Examples:
|
||||
|
||||
>>> # Standalone usage:
|
||||
>>> initializer = tf.keras.initializers.HeUniform()
|
||||
>>> values = initializer(shape=(2, 2))
|
||||
|
||||
>>> # Usage in a Keras layer:
|
||||
>>> initializer = tf.keras.initializers.HeUniform()
|
||||
>>> layer = tf.keras.layers.Dense(3, kernel_initializer=initializer)
|
||||
|
||||
Arguments:
|
||||
seed: A Python integer. An initializer created with a given seed will
|
||||
always produce the same random tensor for a given shape and dtype.
|
||||
|
||||
References:
|
||||
[He et al., 2015](https://www.cv-foundation.org/openaccess/content_iccv_2015/html/He_Delving_Deep_into_ICCV_2015_paper.html) # pylint: disable=line-too-long
|
||||
([pdf](https://www.cv-foundation.org/openaccess/content_iccv_2015/papers/He_Delving_Deep_into_ICCV_2015_paper.pdf))
|
||||
"""
|
||||
|
||||
def __init__(self, seed=None):
|
||||
super(HeUniform, self).__init__(
|
||||
scale=2., mode='fan_in', distribution='uniform', seed=seed)
|
||||
|
||||
def get_config(self):
|
||||
return {'seed': self.seed}
|
||||
|
||||
|
||||
def _get_dtype(dtype):
|
||||
if dtype is None:
|
||||
dtype = backend.floatx()
|
||||
return dtypes.as_dtype(dtype)
|
@ -20,7 +20,6 @@ from __future__ import print_function
|
||||
|
||||
import numpy as np
|
||||
|
||||
from tensorflow.python import tf2
|
||||
from tensorflow.python.framework import test_util
|
||||
from tensorflow.python.keras import backend
|
||||
from tensorflow.python.keras import combinations
|
||||
@ -202,15 +201,6 @@ class KerasInitializersTest(test.TestCase):
|
||||
self.assertEqual(tn.mean, 0.0)
|
||||
self.assertEqual(tn.stddev, 0.05)
|
||||
|
||||
def test_initializer_v2_get(self):
|
||||
tf2_force_enabled = tf2._force_enable # pylint: disable=protected-access
|
||||
try:
|
||||
tf2.enable()
|
||||
rn = initializers.get('random_normal')
|
||||
self.assertIn('init_ops_v2', rn.__class__.__module__)
|
||||
finally:
|
||||
tf2._force_enable = tf2_force_enabled # pylint: disable=protected-access
|
||||
|
||||
def test_custom_initializer_saving(self):
|
||||
|
||||
def my_initializer(shape, dtype=None):
|
||||
|
@ -1,110 +0,0 @@
|
||||
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
# ==============================================================================
|
||||
"""Module for exporting TensorFlow ops under tf.keras.*."""
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
from tensorflow.python.framework import ops
|
||||
from tensorflow.python.ops import init_ops
|
||||
from tensorflow.python.ops import init_ops_v2
|
||||
from tensorflow.python.util.tf_export import keras_export
|
||||
|
||||
|
||||
# pylint: disable=bad-continuation
|
||||
keras_export(v1=["keras.initializers.Initializer"])(
|
||||
init_ops.Initializer)
|
||||
keras_export(v1=["keras.initializers.Zeros", "keras.initializers.zeros"])(
|
||||
init_ops.Zeros)
|
||||
keras_export(v1=["keras.initializers.Ones", "keras.initializers.ones"])(
|
||||
init_ops.Ones)
|
||||
keras_export(v1=["keras.initializers.Constant", "keras.initializers.constant"])(
|
||||
init_ops.Constant)
|
||||
keras_export(v1=["keras.initializers.VarianceScaling"])(
|
||||
init_ops.VarianceScaling)
|
||||
keras_export(v1=["keras.initializers.Orthogonal",
|
||||
"keras.initializers.orthogonal"])(
|
||||
init_ops.Orthogonal)
|
||||
keras_export(v1=["keras.initializers.Identity",
|
||||
"keras.initializers.identity"])(
|
||||
init_ops.Identity)
|
||||
keras_export(v1=["keras.initializers.glorot_uniform"])(
|
||||
init_ops.GlorotUniform)
|
||||
keras_export(v1=["keras.initializers.glorot_normal"])(
|
||||
init_ops.GlorotNormal)
|
||||
keras_export(v1=["keras.initializers.lecun_normal"])(
|
||||
init_ops.lecun_normal)
|
||||
keras_export(v1=["keras.initializers.lecun_uniform"])(
|
||||
init_ops.lecun_uniform)
|
||||
keras_export(v1=["keras.initializers.he_normal"])(
|
||||
init_ops.he_normal)
|
||||
keras_export(v1=["keras.initializers.he_uniform"])(
|
||||
init_ops.he_uniform)
|
||||
|
||||
keras_export("keras.initializers.Initializer", v1=[])(
|
||||
init_ops_v2.Initializer)
|
||||
keras_export(
|
||||
"keras.initializers.Zeros", "keras.initializers.zeros", v1=[])(
|
||||
init_ops_v2.Zeros)
|
||||
keras_export(
|
||||
"keras.initializers.Ones", "keras.initializers.ones", v1=[])(
|
||||
init_ops_v2.Ones)
|
||||
keras_export(
|
||||
"keras.initializers.Constant", "keras.initializers.constant", v1=[])(
|
||||
init_ops_v2.Constant)
|
||||
keras_export("keras.initializers.VarianceScaling", v1=[])(
|
||||
init_ops_v2.VarianceScaling)
|
||||
keras_export(
|
||||
"keras.initializers.Orthogonal", "keras.initializers.orthogonal", v1=[])(
|
||||
init_ops_v2.Orthogonal)
|
||||
keras_export(
|
||||
"keras.initializers.Identity", "keras.initializers.identity", v1=[])(
|
||||
init_ops_v2.Identity)
|
||||
keras_export(
|
||||
"keras.initializers.GlorotUniform",
|
||||
"keras.initializers.glorot_uniform",
|
||||
v1=[])(
|
||||
init_ops_v2.GlorotUniform)
|
||||
keras_export(
|
||||
"keras.initializers.GlorotNormal",
|
||||
"keras.initializers.glorot_normal",
|
||||
v1=[])(
|
||||
init_ops_v2.GlorotNormal)
|
||||
keras_export("keras.initializers.lecun_normal", v1=[])(
|
||||
init_ops_v2.lecun_normal)
|
||||
keras_export("keras.initializers.lecun_uniform", v1=[])(
|
||||
init_ops_v2.lecun_uniform)
|
||||
keras_export("keras.initializers.he_normal", v1=[])(
|
||||
init_ops_v2.he_normal)
|
||||
keras_export("keras.initializers.he_uniform", v1=[])(
|
||||
init_ops_v2.he_uniform)
|
||||
keras_export(
|
||||
"keras.initializers.RandomNormal",
|
||||
"keras.initializers.random_normal",
|
||||
v1=[])(
|
||||
init_ops_v2.RandomNormal)
|
||||
keras_export(
|
||||
"keras.initializers.RandomUniform",
|
||||
"keras.initializers.random_uniform",
|
||||
v1=[])(
|
||||
init_ops_v2.RandomUniform)
|
||||
keras_export(
|
||||
"keras.initializers.TruncatedNormal",
|
||||
"keras.initializers.truncated_normal",
|
||||
v1=[])(
|
||||
init_ops_v2.TruncatedNormal)
|
||||
# pylint: enable=bad-continuation
|
||||
|
||||
keras_export(v1=["keras.backend.name_scope"])(ops.name_scope_v1)
|
@ -41,6 +41,7 @@ from tensorflow.python.ops import linalg_ops_impl
|
||||
from tensorflow.python.ops import math_ops
|
||||
from tensorflow.python.ops import random_ops
|
||||
from tensorflow.python.ops import stateless_random_ops
|
||||
from tensorflow.python.ops.init_ops import _compute_fans
|
||||
from tensorflow.python.util.tf_export import tf_export
|
||||
|
||||
|
||||
@ -126,6 +127,8 @@ class Zeros(Initializer):
|
||||
ValuesError: If the dtype is not numeric or boolean.
|
||||
"""
|
||||
dtype = dtypes.as_dtype(dtype)
|
||||
if not dtype.is_numpy_compatible or dtype == dtypes.string:
|
||||
raise ValueError("Expected numeric or boolean dtype, got %s." % dtype)
|
||||
return array_ops.zeros(shape, dtype)
|
||||
|
||||
|
||||
@ -991,33 +994,6 @@ def he_uniform(seed=None):
|
||||
# Utility functions.
|
||||
|
||||
|
||||
def _compute_fans(shape):
|
||||
"""Computes the number of input and output units for a weight shape.
|
||||
|
||||
Args:
|
||||
shape: Integer shape tuple or TF tensor shape.
|
||||
|
||||
Returns:
|
||||
A tuple of scalars (fan_in, fan_out).
|
||||
"""
|
||||
if len(shape) < 1: # Just to avoid errors for constants.
|
||||
fan_in = fan_out = 1
|
||||
elif len(shape) == 1:
|
||||
fan_in = fan_out = shape[0]
|
||||
elif len(shape) == 2:
|
||||
fan_in = shape[0]
|
||||
fan_out = shape[1]
|
||||
else:
|
||||
# Assuming convolution kernels (2D, 3D, or more).
|
||||
# kernel shape: (..., input_depth, depth)
|
||||
receptive_field_size = 1.
|
||||
for dim in shape[:-2]:
|
||||
receptive_field_size *= dim
|
||||
fan_in = shape[-2] * receptive_field_size
|
||||
fan_out = shape[-1] * receptive_field_size
|
||||
return fan_in, fan_out
|
||||
|
||||
|
||||
def _assert_float_dtype(dtype):
|
||||
"""Validate and return floating point type based on `dtype`.
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
path: "tensorflow.keras.initializers.Initializer"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
@ -1,6 +1,6 @@
|
||||
path: "tensorflow.keras.initializers.RandomNormal"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.RandomNormalV1\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v1.RandomNormal\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops.RandomNormal\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
|
@ -1,6 +1,6 @@
|
||||
path: "tensorflow.keras.initializers.RandomUniform"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.RandomUniformV1\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v1.RandomUniform\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops.RandomUniform\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
|
@ -1,6 +1,6 @@
|
||||
path: "tensorflow.keras.initializers.TruncatedNormal"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.TruncatedNormalV1\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v1.TruncatedNormal\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops.TruncatedNormal\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
|
@ -0,0 +1,19 @@
|
||||
path: "tensorflow.keras.initializers.he_normal"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v1.HeNormal\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
argspec: "args=[\'self\', \'seed\'], varargs=None, keywords=None, defaults=[\'None\'], "
|
||||
}
|
||||
member_method {
|
||||
name: "from_config"
|
||||
argspec: "args=[\'cls\', \'config\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
member_method {
|
||||
name: "get_config"
|
||||
argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
path: "tensorflow.keras.initializers.he_uniform"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v1.HeUniform\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
argspec: "args=[\'self\', \'seed\'], varargs=None, keywords=None, defaults=[\'None\'], "
|
||||
}
|
||||
member_method {
|
||||
name: "from_config"
|
||||
argspec: "args=[\'cls\', \'config\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
member_method {
|
||||
name: "get_config"
|
||||
argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
path: "tensorflow.keras.initializers.lecun_normal"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v1.LecunNormal\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
argspec: "args=[\'self\', \'seed\'], varargs=None, keywords=None, defaults=[\'None\'], "
|
||||
}
|
||||
member_method {
|
||||
name: "from_config"
|
||||
argspec: "args=[\'cls\', \'config\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
member_method {
|
||||
name: "get_config"
|
||||
argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
path: "tensorflow.keras.initializers.lecun_uniform"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v1.LecunUniform\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
argspec: "args=[\'self\', \'seed\'], varargs=None, keywords=None, defaults=[\'None\'], "
|
||||
}
|
||||
member_method {
|
||||
name: "from_config"
|
||||
argspec: "args=[\'cls\', \'config\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
member_method {
|
||||
name: "get_config"
|
||||
argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
path: "tensorflow.keras.initializers.normal"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.RandomNormalV1\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v1.RandomNormal\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops.RandomNormal\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
|
@ -52,10 +52,26 @@ tf_module {
|
||||
name: "glorot_uniform"
|
||||
mtype: "<type \'type\'>"
|
||||
}
|
||||
member {
|
||||
name: "he_normal"
|
||||
mtype: "<type \'type\'>"
|
||||
}
|
||||
member {
|
||||
name: "he_uniform"
|
||||
mtype: "<type \'type\'>"
|
||||
}
|
||||
member {
|
||||
name: "identity"
|
||||
mtype: "<type \'type\'>"
|
||||
}
|
||||
member {
|
||||
name: "lecun_normal"
|
||||
mtype: "<type \'type\'>"
|
||||
}
|
||||
member {
|
||||
name: "lecun_uniform"
|
||||
mtype: "<type \'type\'>"
|
||||
}
|
||||
member {
|
||||
name: "normal"
|
||||
mtype: "<type \'type\'>"
|
||||
@ -96,22 +112,6 @@ tf_module {
|
||||
name: "get"
|
||||
argspec: "args=[\'identifier\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
member_method {
|
||||
name: "he_normal"
|
||||
argspec: "args=[\'seed\'], varargs=None, keywords=None, defaults=[\'None\'], "
|
||||
}
|
||||
member_method {
|
||||
name: "he_uniform"
|
||||
argspec: "args=[\'seed\'], varargs=None, keywords=None, defaults=[\'None\'], "
|
||||
}
|
||||
member_method {
|
||||
name: "lecun_normal"
|
||||
argspec: "args=[\'seed\'], varargs=None, keywords=None, defaults=[\'None\'], "
|
||||
}
|
||||
member_method {
|
||||
name: "lecun_uniform"
|
||||
argspec: "args=[\'seed\'], varargs=None, keywords=None, defaults=[\'None\'], "
|
||||
}
|
||||
member_method {
|
||||
name: "serialize"
|
||||
argspec: "args=[\'initializer\'], varargs=None, keywords=None, defaults=None"
|
||||
|
@ -1,6 +1,6 @@
|
||||
path: "tensorflow.keras.initializers.random_normal"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.RandomNormalV1\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v1.RandomNormal\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops.RandomNormal\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
|
@ -1,6 +1,6 @@
|
||||
path: "tensorflow.keras.initializers.random_uniform"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.RandomUniformV1\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v1.RandomUniform\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops.RandomUniform\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
|
@ -1,6 +1,6 @@
|
||||
path: "tensorflow.keras.initializers.truncated_normal"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.TruncatedNormalV1\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v1.TruncatedNormal\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops.TruncatedNormal\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
|
@ -1,6 +1,6 @@
|
||||
path: "tensorflow.keras.initializers.uniform"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.RandomUniformV1\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v1.RandomUniform\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops.RandomUniform\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
|
@ -1,7 +1,7 @@
|
||||
path: "tensorflow.initializers.Constant"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Constant\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Constant\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
@ -1,8 +1,10 @@
|
||||
path: "tensorflow.initializers.GlorotNormal"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.GlorotNormal\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.GlorotNormal\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
@ -1,8 +1,10 @@
|
||||
path: "tensorflow.initializers.GlorotUniform"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.GlorotUniform\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.GlorotUniform\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
@ -0,0 +1,21 @@
|
||||
path: "tensorflow.initializers.HeNormal"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.HeNormal\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
argspec: "args=[\'self\', \'seed\'], varargs=None, keywords=None, defaults=[\'None\'], "
|
||||
}
|
||||
member_method {
|
||||
name: "from_config"
|
||||
argspec: "args=[\'cls\', \'config\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
member_method {
|
||||
name: "get_config"
|
||||
argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
path: "tensorflow.initializers.HeUniform"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.HeUniform\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
argspec: "args=[\'self\', \'seed\'], varargs=None, keywords=None, defaults=[\'None\'], "
|
||||
}
|
||||
member_method {
|
||||
name: "from_config"
|
||||
argspec: "args=[\'cls\', \'config\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
member_method {
|
||||
name: "get_config"
|
||||
argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
}
|
@ -1,7 +1,9 @@
|
||||
path: "tensorflow.initializers.Identity"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Identity\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Identity\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
@ -1,6 +1,6 @@
|
||||
path: "tensorflow.initializers.Initializer"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
@ -0,0 +1,21 @@
|
||||
path: "tensorflow.initializers.LecunNormal"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.LecunNormal\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
argspec: "args=[\'self\', \'seed\'], varargs=None, keywords=None, defaults=[\'None\'], "
|
||||
}
|
||||
member_method {
|
||||
name: "from_config"
|
||||
argspec: "args=[\'cls\', \'config\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
member_method {
|
||||
name: "get_config"
|
||||
argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
path: "tensorflow.initializers.LecunUniform"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.LecunUniform\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
argspec: "args=[\'self\', \'seed\'], varargs=None, keywords=None, defaults=[\'None\'], "
|
||||
}
|
||||
member_method {
|
||||
name: "from_config"
|
||||
argspec: "args=[\'cls\', \'config\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
member_method {
|
||||
name: "get_config"
|
||||
argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
}
|
@ -1,7 +1,9 @@
|
||||
path: "tensorflow.initializers.Ones"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Ones\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Ones\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
@ -1,7 +1,9 @@
|
||||
path: "tensorflow.initializers.Orthogonal"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Orthogonal\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Orthogonal\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
@ -1,7 +1,9 @@
|
||||
path: "tensorflow.initializers.RandomNormal"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.RandomNormal\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.RandomNormal\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
@ -1,7 +1,9 @@
|
||||
path: "tensorflow.initializers.RandomUniform"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.RandomUniform\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.RandomUniform\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
@ -1,7 +1,9 @@
|
||||
path: "tensorflow.initializers.TruncatedNormal"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.TruncatedNormal\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.TruncatedNormal\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
@ -1,7 +1,9 @@
|
||||
path: "tensorflow.initializers.VarianceScaling"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
@ -1,7 +1,9 @@
|
||||
path: "tensorflow.initializers.Zeros"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Zeros\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Zeros\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
@ -1,7 +1,7 @@
|
||||
path: "tensorflow.initializers.constant"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Constant\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Constant\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
@ -1,8 +1,10 @@
|
||||
path: "tensorflow.initializers.glorot_normal"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.GlorotNormal\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.GlorotNormal\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
@ -1,8 +1,10 @@
|
||||
path: "tensorflow.initializers.glorot_uniform"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.GlorotUniform\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.GlorotUniform\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
@ -0,0 +1,21 @@
|
||||
path: "tensorflow.initializers.he_normal"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.HeNormal\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
argspec: "args=[\'self\', \'seed\'], varargs=None, keywords=None, defaults=[\'None\'], "
|
||||
}
|
||||
member_method {
|
||||
name: "from_config"
|
||||
argspec: "args=[\'cls\', \'config\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
member_method {
|
||||
name: "get_config"
|
||||
argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
path: "tensorflow.initializers.he_uniform"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.HeUniform\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
argspec: "args=[\'self\', \'seed\'], varargs=None, keywords=None, defaults=[\'None\'], "
|
||||
}
|
||||
member_method {
|
||||
name: "from_config"
|
||||
argspec: "args=[\'cls\', \'config\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
member_method {
|
||||
name: "get_config"
|
||||
argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
}
|
@ -1,7 +1,9 @@
|
||||
path: "tensorflow.initializers.identity"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Identity\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Identity\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
@ -0,0 +1,21 @@
|
||||
path: "tensorflow.initializers.lecun_normal"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.LecunNormal\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
argspec: "args=[\'self\', \'seed\'], varargs=None, keywords=None, defaults=[\'None\'], "
|
||||
}
|
||||
member_method {
|
||||
name: "from_config"
|
||||
argspec: "args=[\'cls\', \'config\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
member_method {
|
||||
name: "get_config"
|
||||
argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
path: "tensorflow.initializers.lecun_uniform"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.LecunUniform\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
argspec: "args=[\'self\', \'seed\'], varargs=None, keywords=None, defaults=[\'None\'], "
|
||||
}
|
||||
member_method {
|
||||
name: "from_config"
|
||||
argspec: "args=[\'cls\', \'config\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
member_method {
|
||||
name: "get_config"
|
||||
argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
}
|
@ -1,7 +1,9 @@
|
||||
path: "tensorflow.initializers.ones"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Ones\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Ones\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
@ -1,7 +1,9 @@
|
||||
path: "tensorflow.initializers.orthogonal"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Orthogonal\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Orthogonal\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
@ -12,6 +12,14 @@ tf_module {
|
||||
name: "GlorotUniform"
|
||||
mtype: "<type \'type\'>"
|
||||
}
|
||||
member {
|
||||
name: "HeNormal"
|
||||
mtype: "<type \'type\'>"
|
||||
}
|
||||
member {
|
||||
name: "HeUniform"
|
||||
mtype: "<type \'type\'>"
|
||||
}
|
||||
member {
|
||||
name: "Identity"
|
||||
mtype: "<type \'type\'>"
|
||||
@ -20,6 +28,14 @@ tf_module {
|
||||
name: "Initializer"
|
||||
mtype: "<type \'type\'>"
|
||||
}
|
||||
member {
|
||||
name: "LecunNormal"
|
||||
mtype: "<type \'type\'>"
|
||||
}
|
||||
member {
|
||||
name: "LecunUniform"
|
||||
mtype: "<type \'type\'>"
|
||||
}
|
||||
member {
|
||||
name: "Ones"
|
||||
mtype: "<type \'type\'>"
|
||||
@ -60,10 +76,26 @@ tf_module {
|
||||
name: "glorot_uniform"
|
||||
mtype: "<type \'type\'>"
|
||||
}
|
||||
member {
|
||||
name: "he_normal"
|
||||
mtype: "<type \'type\'>"
|
||||
}
|
||||
member {
|
||||
name: "he_uniform"
|
||||
mtype: "<type \'type\'>"
|
||||
}
|
||||
member {
|
||||
name: "identity"
|
||||
mtype: "<type \'type\'>"
|
||||
}
|
||||
member {
|
||||
name: "lecun_normal"
|
||||
mtype: "<type \'type\'>"
|
||||
}
|
||||
member {
|
||||
name: "lecun_uniform"
|
||||
mtype: "<type \'type\'>"
|
||||
}
|
||||
member {
|
||||
name: "ones"
|
||||
mtype: "<type \'type\'>"
|
||||
@ -84,6 +116,10 @@ tf_module {
|
||||
name: "truncated_normal"
|
||||
mtype: "<type \'type\'>"
|
||||
}
|
||||
member {
|
||||
name: "variance_scaling"
|
||||
mtype: "<type \'type\'>"
|
||||
}
|
||||
member {
|
||||
name: "zeros"
|
||||
mtype: "<type \'type\'>"
|
||||
@ -96,22 +132,6 @@ tf_module {
|
||||
name: "get"
|
||||
argspec: "args=[\'identifier\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
member_method {
|
||||
name: "he_normal"
|
||||
argspec: "args=[\'seed\'], varargs=None, keywords=None, defaults=[\'None\'], "
|
||||
}
|
||||
member_method {
|
||||
name: "he_uniform"
|
||||
argspec: "args=[\'seed\'], varargs=None, keywords=None, defaults=[\'None\'], "
|
||||
}
|
||||
member_method {
|
||||
name: "lecun_normal"
|
||||
argspec: "args=[\'seed\'], varargs=None, keywords=None, defaults=[\'None\'], "
|
||||
}
|
||||
member_method {
|
||||
name: "lecun_uniform"
|
||||
argspec: "args=[\'seed\'], varargs=None, keywords=None, defaults=[\'None\'], "
|
||||
}
|
||||
member_method {
|
||||
name: "serialize"
|
||||
argspec: "args=[\'initializer\'], varargs=None, keywords=None, defaults=None"
|
||||
|
@ -1,7 +1,9 @@
|
||||
path: "tensorflow.initializers.random_normal"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.RandomNormal\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.RandomNormal\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
@ -1,7 +1,9 @@
|
||||
path: "tensorflow.initializers.random_uniform"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.RandomUniform\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.RandomUniform\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
@ -1,7 +1,9 @@
|
||||
path: "tensorflow.initializers.truncated_normal"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.TruncatedNormal\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.TruncatedNormal\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
@ -0,0 +1,20 @@
|
||||
path: "tensorflow.initializers.variance_scaling"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
argspec: "args=[\'self\', \'scale\', \'mode\', \'distribution\', \'seed\'], varargs=None, keywords=None, defaults=[\'1.0\', \'fan_in\', \'truncated_normal\', \'None\'], "
|
||||
}
|
||||
member_method {
|
||||
name: "from_config"
|
||||
argspec: "args=[\'cls\', \'config\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
member_method {
|
||||
name: "get_config"
|
||||
argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
}
|
@ -1,7 +1,9 @@
|
||||
path: "tensorflow.initializers.zeros"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Zeros\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Zeros\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
@ -1,7 +1,7 @@
|
||||
path: "tensorflow.keras.initializers.Constant"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Constant\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Constant\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
@ -1,8 +1,10 @@
|
||||
path: "tensorflow.keras.initializers.GlorotNormal"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.GlorotNormal\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.GlorotNormal\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
@ -1,8 +1,10 @@
|
||||
path: "tensorflow.keras.initializers.GlorotUniform"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.GlorotUniform\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.GlorotUniform\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
@ -0,0 +1,21 @@
|
||||
path: "tensorflow.keras.initializers.HeNormal"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.HeNormal\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
argspec: "args=[\'self\', \'seed\'], varargs=None, keywords=None, defaults=[\'None\'], "
|
||||
}
|
||||
member_method {
|
||||
name: "from_config"
|
||||
argspec: "args=[\'cls\', \'config\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
member_method {
|
||||
name: "get_config"
|
||||
argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
path: "tensorflow.keras.initializers.HeUniform"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.HeUniform\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
argspec: "args=[\'self\', \'seed\'], varargs=None, keywords=None, defaults=[\'None\'], "
|
||||
}
|
||||
member_method {
|
||||
name: "from_config"
|
||||
argspec: "args=[\'cls\', \'config\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
member_method {
|
||||
name: "get_config"
|
||||
argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
}
|
@ -1,7 +1,9 @@
|
||||
path: "tensorflow.keras.initializers.Identity"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Identity\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Identity\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
@ -1,6 +1,6 @@
|
||||
path: "tensorflow.keras.initializers.Initializer"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
@ -0,0 +1,21 @@
|
||||
path: "tensorflow.keras.initializers.LecunNormal"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.LecunNormal\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
argspec: "args=[\'self\', \'seed\'], varargs=None, keywords=None, defaults=[\'None\'], "
|
||||
}
|
||||
member_method {
|
||||
name: "from_config"
|
||||
argspec: "args=[\'cls\', \'config\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
member_method {
|
||||
name: "get_config"
|
||||
argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
path: "tensorflow.keras.initializers.LecunUniform"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.LecunUniform\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
argspec: "args=[\'self\', \'seed\'], varargs=None, keywords=None, defaults=[\'None\'], "
|
||||
}
|
||||
member_method {
|
||||
name: "from_config"
|
||||
argspec: "args=[\'cls\', \'config\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
member_method {
|
||||
name: "get_config"
|
||||
argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
}
|
@ -1,7 +1,9 @@
|
||||
path: "tensorflow.keras.initializers.Ones"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Ones\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Ones\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
@ -1,7 +1,9 @@
|
||||
path: "tensorflow.keras.initializers.Orthogonal"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Orthogonal\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Orthogonal\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
@ -1,7 +1,9 @@
|
||||
path: "tensorflow.keras.initializers.RandomNormal"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.RandomNormal\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.RandomNormal\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
@ -1,7 +1,9 @@
|
||||
path: "tensorflow.keras.initializers.RandomUniform"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.RandomUniform\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.RandomUniform\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
@ -1,7 +1,9 @@
|
||||
path: "tensorflow.keras.initializers.TruncatedNormal"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.TruncatedNormal\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.TruncatedNormal\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
@ -1,7 +1,9 @@
|
||||
path: "tensorflow.keras.initializers.VarianceScaling"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
@ -1,7 +1,9 @@
|
||||
path: "tensorflow.keras.initializers.Zeros"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Zeros\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Zeros\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
@ -1,7 +1,7 @@
|
||||
path: "tensorflow.keras.initializers.constant"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Constant\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Constant\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
@ -1,8 +1,10 @@
|
||||
path: "tensorflow.keras.initializers.glorot_normal"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.GlorotNormal\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.GlorotNormal\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
@ -1,8 +1,10 @@
|
||||
path: "tensorflow.keras.initializers.glorot_uniform"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.GlorotUniform\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.GlorotUniform\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
@ -0,0 +1,21 @@
|
||||
path: "tensorflow.keras.initializers.he_normal"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.HeNormal\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
argspec: "args=[\'self\', \'seed\'], varargs=None, keywords=None, defaults=[\'None\'], "
|
||||
}
|
||||
member_method {
|
||||
name: "from_config"
|
||||
argspec: "args=[\'cls\', \'config\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
member_method {
|
||||
name: "get_config"
|
||||
argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
path: "tensorflow.keras.initializers.he_uniform"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.HeUniform\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
argspec: "args=[\'self\', \'seed\'], varargs=None, keywords=None, defaults=[\'None\'], "
|
||||
}
|
||||
member_method {
|
||||
name: "from_config"
|
||||
argspec: "args=[\'cls\', \'config\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
member_method {
|
||||
name: "get_config"
|
||||
argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
}
|
@ -1,7 +1,9 @@
|
||||
path: "tensorflow.keras.initializers.identity"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Identity\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Identity\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
@ -0,0 +1,21 @@
|
||||
path: "tensorflow.keras.initializers.lecun_normal"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.LecunNormal\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
argspec: "args=[\'self\', \'seed\'], varargs=None, keywords=None, defaults=[\'None\'], "
|
||||
}
|
||||
member_method {
|
||||
name: "from_config"
|
||||
argspec: "args=[\'cls\', \'config\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
member_method {
|
||||
name: "get_config"
|
||||
argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
path: "tensorflow.keras.initializers.lecun_uniform"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.LecunUniform\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
argspec: "args=[\'self\', \'seed\'], varargs=None, keywords=None, defaults=[\'None\'], "
|
||||
}
|
||||
member_method {
|
||||
name: "from_config"
|
||||
argspec: "args=[\'cls\', \'config\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
member_method {
|
||||
name: "get_config"
|
||||
argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
}
|
@ -1,7 +1,9 @@
|
||||
path: "tensorflow.keras.initializers.ones"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Ones\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Ones\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
@ -1,7 +1,9 @@
|
||||
path: "tensorflow.keras.initializers.orthogonal"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Orthogonal\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Orthogonal\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
@ -12,6 +12,14 @@ tf_module {
|
||||
name: "GlorotUniform"
|
||||
mtype: "<type \'type\'>"
|
||||
}
|
||||
member {
|
||||
name: "HeNormal"
|
||||
mtype: "<type \'type\'>"
|
||||
}
|
||||
member {
|
||||
name: "HeUniform"
|
||||
mtype: "<type \'type\'>"
|
||||
}
|
||||
member {
|
||||
name: "Identity"
|
||||
mtype: "<type \'type\'>"
|
||||
@ -20,6 +28,14 @@ tf_module {
|
||||
name: "Initializer"
|
||||
mtype: "<type \'type\'>"
|
||||
}
|
||||
member {
|
||||
name: "LecunNormal"
|
||||
mtype: "<type \'type\'>"
|
||||
}
|
||||
member {
|
||||
name: "LecunUniform"
|
||||
mtype: "<type \'type\'>"
|
||||
}
|
||||
member {
|
||||
name: "Ones"
|
||||
mtype: "<type \'type\'>"
|
||||
@ -60,10 +76,26 @@ tf_module {
|
||||
name: "glorot_uniform"
|
||||
mtype: "<type \'type\'>"
|
||||
}
|
||||
member {
|
||||
name: "he_normal"
|
||||
mtype: "<type \'type\'>"
|
||||
}
|
||||
member {
|
||||
name: "he_uniform"
|
||||
mtype: "<type \'type\'>"
|
||||
}
|
||||
member {
|
||||
name: "identity"
|
||||
mtype: "<type \'type\'>"
|
||||
}
|
||||
member {
|
||||
name: "lecun_normal"
|
||||
mtype: "<type \'type\'>"
|
||||
}
|
||||
member {
|
||||
name: "lecun_uniform"
|
||||
mtype: "<type \'type\'>"
|
||||
}
|
||||
member {
|
||||
name: "ones"
|
||||
mtype: "<type \'type\'>"
|
||||
@ -84,6 +116,10 @@ tf_module {
|
||||
name: "truncated_normal"
|
||||
mtype: "<type \'type\'>"
|
||||
}
|
||||
member {
|
||||
name: "variance_scaling"
|
||||
mtype: "<type \'type\'>"
|
||||
}
|
||||
member {
|
||||
name: "zeros"
|
||||
mtype: "<type \'type\'>"
|
||||
@ -96,22 +132,6 @@ tf_module {
|
||||
name: "get"
|
||||
argspec: "args=[\'identifier\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
member_method {
|
||||
name: "he_normal"
|
||||
argspec: "args=[\'seed\'], varargs=None, keywords=None, defaults=[\'None\'], "
|
||||
}
|
||||
member_method {
|
||||
name: "he_uniform"
|
||||
argspec: "args=[\'seed\'], varargs=None, keywords=None, defaults=[\'None\'], "
|
||||
}
|
||||
member_method {
|
||||
name: "lecun_normal"
|
||||
argspec: "args=[\'seed\'], varargs=None, keywords=None, defaults=[\'None\'], "
|
||||
}
|
||||
member_method {
|
||||
name: "lecun_uniform"
|
||||
argspec: "args=[\'seed\'], varargs=None, keywords=None, defaults=[\'None\'], "
|
||||
}
|
||||
member_method {
|
||||
name: "serialize"
|
||||
argspec: "args=[\'initializer\'], varargs=None, keywords=None, defaults=None"
|
||||
|
@ -1,7 +1,9 @@
|
||||
path: "tensorflow.keras.initializers.random_normal"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.RandomNormal\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.RandomNormal\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
@ -1,7 +1,9 @@
|
||||
path: "tensorflow.keras.initializers.random_uniform"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.RandomUniform\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.RandomUniform\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
@ -1,7 +1,9 @@
|
||||
path: "tensorflow.keras.initializers.truncated_normal"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.TruncatedNormal\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.TruncatedNormal\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
@ -0,0 +1,20 @@
|
||||
path: "tensorflow.keras.initializers.variance_scaling"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.VarianceScaling\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
argspec: "args=[\'self\', \'scale\', \'mode\', \'distribution\', \'seed\'], varargs=None, keywords=None, defaults=[\'1.0\', \'fan_in\', \'truncated_normal\', \'None\'], "
|
||||
}
|
||||
member_method {
|
||||
name: "from_config"
|
||||
argspec: "args=[\'cls\', \'config\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
member_method {
|
||||
name: "get_config"
|
||||
argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
}
|
@ -1,7 +1,9 @@
|
||||
path: "tensorflow.keras.initializers.zeros"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Zeros\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Zeros\'>"
|
||||
is_instance: "<class \'tensorflow.python.ops.init_ops_v2.Initializer\'>"
|
||||
is_instance: "<class \'tensorflow.python.keras.initializers.initializers_v2.Initializer\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
|
Loading…
Reference in New Issue
Block a user