當前位置: 首頁>>代碼示例>>Python>>正文


Python initializers.serialize方法代碼示例

本文整理匯總了Python中tensorflow.keras.initializers.serialize方法的典型用法代碼示例。如果您正苦於以下問題:Python initializers.serialize方法的具體用法?Python initializers.serialize怎麽用?Python initializers.serialize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在tensorflow.keras.initializers的用法示例。


在下文中一共展示了initializers.serialize方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: get_config

# 需要導入模塊: from tensorflow.keras import initializers [as 別名]
# 或者: from tensorflow.keras.initializers import serialize [as 別名]
def get_config(self):
        config = {
            'filters': self.filters,
            'kernel_size': self.kernel_size,
            'strides': self.strides,
            'padding': self.padding,
            'dilation_rate': self.dilation_rate,
            'kernel_initializer': initializers.serialize(self.kernel_initializer),
            'kernel_regularizer': regularizers.serialize(self.kernel_regularizer),
            'activity_regularizer':
                regularizers.serialize(self.activity_regularizer),
            'kernel_constraint': constraints.serialize(self.kernel_constraint),
            'demod': self.demod
        }
        base_config = super(Conv2DMod, self).get_config()
        return dict(list(base_config.items()) + list(config.items())) 
開發者ID:manicman1999,項目名稱:StyleGAN2-Tensorflow-2.0,代碼行數:18,代碼來源:conv_mod.py

示例2: get_config

# 需要導入模塊: from tensorflow.keras import initializers [as 別名]
# 或者: from tensorflow.keras.initializers import serialize [as 別名]
def get_config(self):
        config = {
            "groups": self.groups,
            "axis": self.axis,
            "epsilon": self.epsilon,
            "center": self.center,
            "scale": self.scale,
            "beta_initializer": initializers.serialize(self.beta_initializer),
            "gamma_initializer": initializers.serialize(self.gamma_initializer),
            "beta_regularizer": regularizers.serialize(self.beta_regularizer),
            "gamma_regularizer": regularizers.serialize(self.gamma_regularizer),
            "beta_constraint": constraints.serialize(self.beta_constraint),
            "gamma_constraint": constraints.serialize(self.gamma_constraint)
        }
        base_config = super(GroupNormalization, self).get_config()
        return dict(list(base_config.items()) + list(config.items())) 
開發者ID:sandialabs,項目名稱:bcnn,代碼行數:18,代碼來源:groupnorm.py

示例3: get_config

# 需要導入模塊: from tensorflow.keras import initializers [as 別名]
# 或者: from tensorflow.keras.initializers import serialize [as 別名]
def get_config(self):
        config = {
            'filters': self.filters,
            'kernel_size': self.kernel_size,
            'strides': self.strides,
            'padding': self.padding,
            'data_format': self.data_format,
            'activation': activations.serialize(self.activation),
            'use_bias': self.use_bias,
            'kernel_initializer': initializers.serialize(self.kernel_initializer),
            'bias_initializer': initializers.serialize(self.bias_initializer),
            'kernel_regularizer': regularizers.serialize(self.kernel_regularizer),
            'bias_regularizer': regularizers.serialize(self.bias_regularizer),
            'activity_regularizer': regularizers.serialize(self.activity_regularizer),
            'kernel_constraint': constraints.serialize(self.kernel_constraint),
            'bias_constraint': constraints.serialize(self.bias_constraint)
        }
        base_config = super(
            LocallyConnected3D, self).get_config()
        return dict(list(base_config.items()) + list(config.items())) 
開發者ID:adalca,項目名稱:neuron,代碼行數:22,代碼來源:layers.py

示例4: get_config

# 需要導入模塊: from tensorflow.keras import initializers [as 別名]
# 或者: from tensorflow.keras.initializers import serialize [as 別名]
def get_config(self):
    config = super(QDepthwiseConv2D, self).get_config()
    config.pop("filters", None)
    config.pop("kernel_initializer", None)
    config.pop("kernel_regularizer", None)
    config.pop("kernel_constraint", None)
    config["depth_multiplier"] = self.depth_multiplier
    config["depthwise_initializer"] = initializers.serialize(
        self.depthwise_initializer)
    config["depthwise_regularizer"] = regularizers.serialize(
        self.depthwise_regularizer)
    config["depthwise_constraint"] = constraints.serialize(
        self.depthwise_constraint)
    config["depthwise_quantizer"] = constraints.serialize(
        self.depthwise_quantizer_internal)
    config["bias_quantizer"] = constraints.serialize(
        self.bias_quantizer_internal)
    config["depthwise_range"] = self.depthwise_range
    config["bias_range"] = self.bias_range
    return config 
開發者ID:google,項目名稱:qkeras,代碼行數:22,代碼來源:qconvolutional.py

示例5: get_config

# 需要導入模塊: from tensorflow.keras import initializers [as 別名]
# 或者: from tensorflow.keras.initializers import serialize [as 別名]
def get_config(self) -> dict:
    config = {
        'filters': self.filters,
        'kernel_size': self.kernel_size,
        'num_nodes': self.num_nodes,
        'bond_dim': self.bond_dim,
        'strides': self.strides,
        'padding': self.padding,
        'data_format': self.data_format,
        'dilation_rate': self.dilation_rate,
        'activation': activations.serialize(self.activation),
        'use_bias': self.use_bias,
        'kernel_initializer': initializers.serialize(self.kernel_initializer),
        'bias_initializer': initializers.serialize(self.bias_initializer),
        'kernel_regularizer': regularizers.serialize(self.kernel_regularizer),
        'bias_regularizer': regularizers.serialize(self.bias_regularizer),
    }
    base_config = super(Conv2DMPO, self).get_config()
    config.update(base_config)
    return config 
開發者ID:google,項目名稱:TensorNetwork,代碼行數:22,代碼來源:conv2d_mpo.py

示例6: get_config

# 需要導入模塊: from tensorflow.keras import initializers [as 別名]
# 或者: from tensorflow.keras.initializers import serialize [as 別名]
def get_config(self):
        config = {
            'groups': self.groups,
            'axis': self.axis,
            'epsilon': self.epsilon,
            'center': self.center,
            'scale': self.scale,
            'beta_initializer': initializers.serialize(self.beta_initializer),
            'gamma_initializer': initializers.serialize(self.gamma_initializer),
            'beta_regularizer': regularizers.serialize(self.beta_regularizer),
            'gamma_regularizer': regularizers.serialize(self.gamma_regularizer),
            'beta_constraint': constraints.serialize(self.beta_constraint),
            'gamma_constraint': constraints.serialize(self.gamma_constraint)
        }
        base_config = super(GroupNormalization, self).get_config()
        return dict(list(base_config.items()) + list(config.items())) 
開發者ID:vliu15,項目名稱:3d-brain-tumor-segmentation,代碼行數:18,代碼來源:group_norm.py

示例7: get_config

# 需要導入模塊: from tensorflow.keras import initializers [as 別名]
# 或者: from tensorflow.keras.initializers import serialize [as 別名]
def get_config(self):
        config = {
            "input_channels": self.input_channels,
            "output_channels": self.output_channels,
            "kernel_size": self.kernel_size,
            "strides": self.strides,
            "padding": self.padding,
            "data_format": self.data_format,
            "dilation_rate": self.dilation_rate,
            "activation": activations.serialize(self.activation),
            "groups": self.groups,
            "use_bias": self.use_bias,
            "kernel_initializer": initializers.serialize(self.kernel_initializer),
            "bias_initializer": initializers.serialize(self.bias_initializer),
            "kernel_regularizer": regularizers.serialize(self.kernel_regularizer),
            "bias_regularizer": regularizers.serialize(self.bias_regularizer),
            "activity_regularizer": regularizers.serialize(self.activity_regularizer),
            "kernel_constraint": constraints.serialize(self.kernel_constraint),
            "bias_constraint": constraints.serialize(self.bias_constraint)
        }
        base_config = super(GroupConv2D, self).get_config()
        return {**base_config, **config} 
開發者ID:calmisential,項目名稱:Basic_CNNs_TensorFlow2,代碼行數:24,代碼來源:group_convolution.py

示例8: get_config

# 需要導入模塊: from tensorflow.keras import initializers [as 別名]
# 或者: from tensorflow.keras.initializers import serialize [as 別名]
def get_config(self):
        config = {
            'axis': self.axis,
            'epsilon': self.epsilon,
            'beta_initializer': initializers.serialize(self.beta_initializer),
            'tau_initializer': initializers.serialize(self.tau_initializer),
            'gamma_initializer': initializers.serialize(self.gamma_initializer),
            'beta_regularizer': regularizers.serialize(self.beta_regularizer),
            'tau_regularizer': regularizers.serialize(self.tau_regularizer),
            'gamma_regularizer': regularizers.serialize(self.gamma_regularizer),
            'beta_constraint': constraints.serialize(self.beta_constraint),
            'gamma_constraint': constraints.serialize(self.gamma_constraint),
            'tau_constraint': constraints.serialize(self.tau_constraint)
        }
        base_config = super(FRN, self).get_config()
        return dict(list(base_config.items()) + list(config.items())) 
開發者ID:1044197988,項目名稱:TF.Keras-Commonly-used-models,代碼行數:18,代碼來源:FRN.py

示例9: serialize_kwarg

# 需要導入模塊: from tensorflow.keras import initializers [as 別名]
# 或者: from tensorflow.keras.initializers import serialize [as 別名]
def serialize_kwarg(key, attr):
    if key.endswith('_initializer'):
        return initializers.serialize(attr)
    if key.endswith('_regularizer'):
        return regularizers.serialize(attr)
    if key.endswith('_constraint'):
        return constraints.serialize(attr)
    if key == 'activation':
        return activations.serialize(attr)
    if key == 'use_bias':
        return attr 
開發者ID:danielegrattarola,項目名稱:spektral,代碼行數:13,代碼來源:keras.py

示例10: get_config

# 需要導入模塊: from tensorflow.keras import initializers [as 別名]
# 或者: from tensorflow.keras.initializers import serialize [as 別名]
def get_config(self):
        config = {
            'ratio': self.ratio,
            'return_mask': self.return_mask,
            'kernel_initializer': initializers.serialize(self.kernel_initializer),
            'kernel_regularizer': regularizers.serialize(self.kernel_regularizer),
            'kernel_constraint': constraints.serialize(self.kernel_constraint),
        }
        base_config = super().get_config()
        return dict(list(base_config.items()) + list(config.items())) 
開發者ID:danielegrattarola,項目名稱:spektral,代碼行數:12,代碼來源:topk_pool.py

示例11: get_config

# 需要導入模塊: from tensorflow.keras import initializers [as 別名]
# 或者: from tensorflow.keras.initializers import serialize [as 別名]
def get_config(self):
        config = {
            'k': self.k,
            'channels': self.channels,
            'return_mask': self.return_mask,
            'kernel_initializer': initializers.serialize(self.kernel_initializer),
            'kernel_regularizer': regularizers.serialize(self.kernel_regularizer),
            'kernel_constraint': constraints.serialize(self.kernel_constraint),
        }
        base_config = super().get_config()
        return dict(list(base_config.items()) + list(config.items())) 
開發者ID:danielegrattarola,項目名稱:spektral,代碼行數:13,代碼來源:diff_pool.py

示例12: get_config

# 需要導入模塊: from tensorflow.keras import initializers [as 別名]
# 或者: from tensorflow.keras.initializers import serialize [as 別名]
def get_config(self):
        config = {
            'k': self.k,
            'mlp_hidden': self.mlp_hidden,
            'mlp_activation': self.mlp_activation,
            'return_mask': self.return_mask,
            'kernel_initializer': initializers.serialize(self.kernel_initializer),
            'bias_initializer': initializers.serialize(self.bias_initializer),
            'kernel_regularizer': regularizers.serialize(self.kernel_regularizer),
            'bias_regularizer': regularizers.serialize(self.bias_regularizer),
            'kernel_constraint': constraints.serialize(self.kernel_constraint),
            'bias_constraint': constraints.serialize(self.bias_constraint)
        }
        base_config = super().get_config()
        return dict(list(base_config.items()) + list(config.items())) 
開發者ID:danielegrattarola,項目名稱:spektral,代碼行數:17,代碼來源:mincut_pool.py

示例13: get_config

# 需要導入模塊: from tensorflow.keras import initializers [as 別名]
# 或者: from tensorflow.keras.initializers import serialize [as 別名]
def get_config(self):
        config = {
            'channels': self.channels,
            'activation': activations.serialize(self.activation),
            'use_bias': self.use_bias,
            'kernel_initializer': initializers.serialize(self.kernel_initializer),
            'bias_initializer': initializers.serialize(self.bias_initializer),
            'kernel_regularizer': regularizers.serialize(self.kernel_regularizer),
            'bias_regularizer': regularizers.serialize(self.bias_regularizer),
            'kernel_constraint': constraints.serialize(self.kernel_constraint),
            'bias_constraint': constraints.serialize(self.bias_constraint)
        }
        base_config = super().get_config()
        return dict(list(base_config.items()) + list(config.items())) 
開發者ID:danielegrattarola,項目名稱:spektral,代碼行數:16,代碼來源:graph_conv.py

示例14: get_config

# 需要導入模塊: from tensorflow.keras import initializers [as 別名]
# 或者: from tensorflow.keras.initializers import serialize [as 別名]
def get_config(self):
        config = super(DepthwiseConv2D, self).get_config()
        config.pop('filters')
        config.pop('kernel_initializer')
        config.pop('kernel_regularizer')
        config.pop('kernel_constraint')
        config['depth_multiplier'] = self.depth_multiplier
        config['depthwise_initializer'] = initializers.serialize(self.depthwise_initializer)
        config['depthwise_regularizer'] = regularizers.serialize(self.depthwise_regularizer)
        config['depthwise_constraint'] = constraints.serialize(self.depthwise_constraint)
        return config 
開發者ID:titu1994,項目名稱:keras-squeeze-excite-network,代碼行數:13,代碼來源:se_mobilenets.py

示例15: get_config

# 需要導入模塊: from tensorflow.keras import initializers [as 別名]
# 或者: from tensorflow.keras.initializers import serialize [as 別名]
def get_config(self):
    config = {
        "units": self.units,
        "activation": activations.serialize(self.activation),
        "use_bias": self.use_bias,
        "kernel_quantizer":
            constraints.serialize(self.kernel_quantizer_internal),
        "bias_quantizer":
            constraints.serialize(self.bias_quantizer_internal),
        "kernel_initializer":
            initializers.serialize(self.kernel_initializer),
        "bias_initializer":
            initializers.serialize(self.bias_initializer),
        "kernel_regularizer":
            regularizers.serialize(self.kernel_regularizer),
        "bias_regularizer":
            regularizers.serialize(self.bias_regularizer),
        "activity_regularizer":
            regularizers.serialize(self.activity_regularizer),
        "kernel_constraint":
            constraints.serialize(self.kernel_constraint),
        "bias_constraint":
            constraints.serialize(self.bias_constraint),
        "kernel_range": self.kernel_range,
        "bias_range": self.bias_range
    }
    base_config = super(QDense, self).get_config()
    return dict(list(base_config.items()) + list(config.items())) 
開發者ID:google,項目名稱:qkeras,代碼行數:30,代碼來源:qlayers.py


注:本文中的tensorflow.keras.initializers.serialize方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。