本文整理汇总了Python中keras.activations.serialize方法的典型用法代码示例。如果您正苦于以下问题:Python activations.serialize方法的具体用法?Python activations.serialize怎么用?Python activations.serialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类keras.activations
的用法示例。
在下文中一共展示了activations.serialize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_config
# 需要导入模块: from keras import activations [as 别名]
# 或者: from keras.activations import serialize [as 别名]
def get_config(self):
if self.kernel_initializer in {'complex'}:
ki = self.kernel_initializer
else:
ki = initializers.serialize(self.kernel_initializer)
config = {
'units': self.units,
'activation': activations.serialize(self.activation),
'use_bias': self.use_bias,
'init_criterion': self.init_criterion,
'kernel_initializer': ki,
'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),
'seed': self.seed,
}
base_config = super(ComplexDense, self).get_config()
return dict(list(base_config.items()) + list(config.items()))
示例2: get_config
# 需要导入模块: from keras import activations [as 别名]
# 或者: from keras.activations import serialize [as 别名]
def get_config(self):
config = {'units': self.units,
'projection_units': self.projection_units,
'activation': activations.serialize(self.activation),
'recurrent_activation': activations.serialize(self.recurrent_activation),
'projection_activation': activations.serialize(self.projection_activation),
'use_bias': self.use_bias,
'kernel_initializer': initializers.serialize(self.kernel_initializer),
'recurrent_initializer': initializers.serialize(self.recurrent_initializer),
'projection_initializer': initializers.serialize(self.projection_initializer),
'bias_initializer': initializers.serialize(self.bias_initializer),
'unit_forget_bias': self.unit_forget_bias,
'kernel_regularizer': regularizers.serialize(self.kernel_regularizer),
'recurrent_regularizer': regularizers.serialize(self.recurrent_regularizer),
'projection_regularizer': regularizers.serialize(self.projection_regularizer),
'bias_regularizer': regularizers.serialize(self.bias_regularizer),
'kernel_constraint': constraints.serialize(self.kernel_constraint),
'recurrent_constraint': constraints.serialize(self.recurrent_constraint),
'projection_constraint': constraints.serialize(self.projection_constraint),
'bias_constraint': constraints.serialize(self.bias_constraint),
'dropout': self.dropout,
'recurrent_dropout': self.recurrent_dropout,
'implementation': self.implementation}
base_config = super(NASCell, self).get_config()
return dict(list(base_config.items()) + list(config.items()))
示例3: get_config
# 需要导入模块: from keras import activations [as 别名]
# 或者: from keras.activations import serialize [as 别名]
def get_config(self):
config = {
'rank': self.rank,
'filters': self.filters,
'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),
'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(_Conv, self).get_config()
return dict(list(base_config.items()) + list(config.items()))
示例4: get_config
# 需要导入模块: from keras import activations [as 别名]
# 或者: from keras.activations import serialize [as 别名]
def get_config(self):
if self.kernel_initializer == 'quaternion':
ki = self.kernel_init
else:
ki = initializers.serialize(self.kernel_initializer)
config = {
'units': self.units,
'activation': activations.serialize(self.activation),
'use_bias': self.use_bias,
'init_criterion': self.init_criterion,
'kernel_initializer': ki,
'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),
'seed': self.seed,
}
base_config = super(QuaternionDense, self).get_config()
return dict(list(base_config.items()) + list(config.items()))
开发者ID:Orkis-Research,项目名称:Quaternion-Convolutional-Neural-Networks-for-End-to-End-Automatic-Speech-Recognition,代码行数:23,代码来源:dense.py
示例5: get_config
# 需要导入模块: from keras import activations [as 别名]
# 或者: from keras.activations import serialize [as 别名]
def get_config(self):
config = {'units': self.units,
'recurrent_clip_min': self.recurrent_clip_min,
'recurrent_clip_max': self.recurrent_clip_max,
'activation': activations.serialize(self.activation),
'use_bias': self.use_bias,
'kernel_initializer': initializers.serialize(self.kernel_initializer),
'recurrent_initializer': initializers.serialize(self.recurrent_initializer),
'bias_initializer': initializers.serialize(self.bias_initializer),
'kernel_regularizer': regularizers.serialize(self.kernel_regularizer),
'recurrent_regularizer': regularizers.serialize(self.recurrent_regularizer),
'bias_regularizer': regularizers.serialize(self.bias_regularizer),
'kernel_constraint': constraints.serialize(self.kernel_constraint),
'recurrent_constraint': constraints.serialize(self.recurrent_constraint),
'bias_constraint': constraints.serialize(self.bias_constraint),
'dropout': self.dropout,
'recurrent_dropout': self.recurrent_dropout,
'implementation': self.implementation}
base_config = super(IndRNNCell, self).get_config()
return dict(list(base_config.items()) + list(config.items()))
示例6: get_config
# 需要导入模块: from keras import activations [as 别名]
# 或者: from keras.activations import serialize [as 别名]
def get_config(self):
config = {'units': self.units,
'depth': self.depth,
'activation': activations.serialize(self.activation),
'recurrent_activation': activations.serialize(self.recurrent_activation),
'cell_activation': activations.serialize(self.cell_activation),
'use_bias': self.use_bias,
'kernel_initializer': initializers.serialize(self.kernel_initializer),
'recurrent_initializer': initializers.serialize(self.recurrent_initializer),
'bias_initializer': initializers.serialize(self.bias_initializer),
'unit_forget_bias': self.unit_forget_bias,
'kernel_regularizer': regularizers.serialize(self.kernel_regularizer),
'recurrent_regularizer': regularizers.serialize(self.recurrent_regularizer),
'bias_regularizer': regularizers.serialize(self.bias_regularizer),
'kernel_constraint': constraints.serialize(self.kernel_constraint),
'recurrent_constraint': constraints.serialize(self.recurrent_constraint),
'bias_constraint': constraints.serialize(self.bias_constraint),
'dropout': self.dropout,
'recurrent_dropout': self.recurrent_dropout,
'implementation': self.implementation}
base_config = super(NestedLSTMCell, self).get_config()
return dict(list(base_config.items()) + list(config.items()))
示例7: get_config
# 需要导入模块: from keras import activations [as 别名]
# 或者: from keras.activations import serialize [as 别名]
def get_config(self):
config = {'units': self.units,
'window_size': self.window_size,
'stride': self.strides[0],
'return_sequences': self.return_sequences,
'go_backwards': self.go_backwards,
'stateful': self.stateful,
'unroll': self.unroll,
'use_bias': self.use_bias,
'dropout': self.dropout,
'activation': activations.serialize(self.activation),
'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),
'input_dim': self.input_dim,
'input_length': self.input_length}
base_config = super(QRNN, self).get_config()
return dict(list(base_config.items()) + list(config.items()))
示例8: get_config
# 需要导入模块: from keras import activations [as 别名]
# 或者: from keras.activations import serialize [as 别名]
def get_config(self):
config = {
'filters': self.filters,
'kernel_size': self.kernel_size,
'kernel_initializer': initializers.serialize(self.kernel_initializer),
'activation': activations.serialize(self.activation),
'padding': self.padding,
'strides': self.strides,
'data_format': self.data_format,
'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),
'use_bias': self.use_bias}
base_config = super(CosineConvolution2D, self).get_config()
return dict(list(base_config.items()) + list(config.items()))
示例9: get_config
# 需要导入模块: from keras import activations [as 别名]
# 或者: from keras.activations import serialize [as 别名]
def get_config(self):
config = {'output_dim': self.output_dim,
'window_size': self.window_size,
'init': self.init.get_config(),
'stride': self.strides[0],
'activation': activations.serialize(self.activation),
'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.activy_regularizer),
'kernel_constraint': constraints.serialize(self.kernel_constraint),
'bias_constraint': constraints.serialize(self.bias_constraint),
'use_bias': self.use_bias,
'input_dim': self.input_dim,
'input_length': self.input_length}
base_config = super(GCNN, self).get_config()
return dict(list(base_config.items()) + list(config.items()))
示例10: get_config
# 需要导入模块: from keras import activations [as 别名]
# 或者: from keras.activations import serialize [as 别名]
def get_config(self):
config = {'units': self.units,
'learn_mode': self.learn_mode,
'test_mode': self.test_mode,
'use_boundary': self.use_boundary,
'use_bias': self.use_bias,
'sparse_target': self.sparse_target,
'kernel_initializer': initializers.serialize(self.kernel_initializer),
'chain_initializer': initializers.serialize(self.chain_initializer),
'boundary_initializer': initializers.serialize(self.boundary_initializer),
'bias_initializer': initializers.serialize(self.bias_initializer),
'activation': activations.serialize(self.activation),
'kernel_regularizer': regularizers.serialize(self.kernel_regularizer),
'chain_regularizer': regularizers.serialize(self.chain_regularizer),
'boundary_regularizer': regularizers.serialize(self.boundary_regularizer),
'bias_regularizer': regularizers.serialize(self.bias_regularizer),
'kernel_constraint': constraints.serialize(self.kernel_constraint),
'chain_constraint': constraints.serialize(self.chain_constraint),
'boundary_constraint': constraints.serialize(self.boundary_constraint),
'bias_constraint': constraints.serialize(self.bias_constraint),
'input_dim': self.input_dim,
'unroll': self.unroll}
base_config = super(CRF, self).get_config()
return dict(list(base_config.items()) + list(config.items()))
示例11: get_config
# 需要导入模块: from keras import activations [as 别名]
# 或者: from keras.activations import serialize [as 别名]
def get_config(self):
config = {
'units': self.units,
'n_experts':self.n_experts,
'expert_activation': activations.serialize(self.expert_activation),
'gating_activation': activations.serialize(self.gating_activation),
'use_expert_bias': self.use_expert_bias,
'use_gating_bias': self.use_gating_bias,
'expert_kernel_initializer_scale': self.expert_kernel_initializer_scale,
'gating_kernel_initializer_scale': self.gating_kernel_initializer_scale,
'expert_bias_initializer': initializers.serialize(self.expert_bias_initializer),
'gating_bias_initializer': initializers.serialize(self.gating_bias_initializer),
'expert_kernel_regularizer': regularizers.serialize(self.expert_kernel_regularizer),
'gating_kernel_regularizer': regularizers.serialize(self.gating_kernel_regularizer),
'expert_bias_regularizer': regularizers.serialize(self.expert_bias_regularizer),
'gating_bias_regularizer': regularizers.serialize(self.gating_bias_regularizer),
'expert_kernel_constraint': constraints.serialize(self.expert_kernel_constraint),
'gating_kernel_constraint': constraints.serialize(self.gating_kernel_constraint),
'expert_bias_constraint': constraints.serialize(self.expert_bias_constraint),
'gating_bias_constraint': constraints.serialize(self.gating_bias_constraint),
'activity_regularizer': regularizers.serialize(self.activity_regularizer)
}
base_config = super(DenseMoE, self).get_config()
return dict(list(base_config.items()) + list(config.items()))
示例12: get_config
# 需要导入模块: from keras import activations [as 别名]
# 或者: from keras.activations import serialize [as 别名]
def get_config(self):
config = {'units': self.units,
'activation': activations.serialize(self.activation),
'use_bias': self.use_bias,
'kernel_initializer': initializers.serialize(self.kernel_initializer),
'recurrent_initializer': initializers.serialize(self.recurrent_initializer),
'bias_initializer': initializers.serialize(self.bias_initializer),
'kernel_regularizer': regularizers.serialize(self.kernel_regularizer),
'recurrent_regularizer': regularizers.serialize(self.recurrent_regularizer),
'bias_regularizer': regularizers.serialize(self.bias_regularizer),
'activity_regularizer': regularizers.serialize(self.activity_regularizer),
'kernel_constraint': constraints.serialize(self.kernel_constraint),
'recurrent_constraint': constraints.serialize(self.recurrent_constraint),
'bias_constraint': constraints.serialize(self.bias_constraint),
'dropout': self.dropout,
'recurrent_dropout': self.recurrent_dropout}
base_config = super(TT_RNN, self).get_config()
return dict(list(base_config.items()) + list(config.items()))
示例13: get_config
# 需要导入模块: from keras import activations [as 别名]
# 或者: from keras.activations import serialize [as 别名]
def get_config(self):
config = {'units': self.units,
'activation': activations.serialize(self.activation),
'recurrent_activation': activations.serialize(self.recurrent_activation),
'use_bias': self.use_bias,
'kernel_initializer': initializers.serialize(self.kernel_initializer),
'recurrent_initializer': initializers.serialize(self.recurrent_initializer),
'bias_initializer': initializers.serialize(self.bias_initializer),
'unit_forget_bias': self.unit_forget_bias,
'kernel_regularizer': regularizers.serialize(self.kernel_regularizer),
'recurrent_regularizer': regularizers.serialize(self.recurrent_regularizer),
'bias_regularizer': regularizers.serialize(self.bias_regularizer),
'activity_regularizer': regularizers.serialize(self.activity_regularizer),
'kernel_constraint': constraints.serialize(self.kernel_constraint),
'recurrent_constraint': constraints.serialize(self.recurrent_constraint),
'bias_constraint': constraints.serialize(self.bias_constraint),
'dropout': self.dropout,
'recurrent_dropout': self.recurrent_dropout}
base_config = super(PhasedLSTM, self).get_config()
return dict(list(base_config.items()) + list(config.items()))
示例14: sanitizedInitSer
# 需要导入模块: from keras import activations [as 别名]
# 或者: from keras.activations import serialize [as 别名]
def sanitizedInitSer(init):
if init in [sqrt_init]:
return "sqrt_init"
elif init == "complex" or isinstance(init, ComplexInit):
return "complex"
elif init == "complex_independent" or isinstance(init, ComplexIndependentFilters):
return "complex_independent"
else:
return initializers.serialize(init)
示例15: get_config
# 需要导入模块: from keras import activations [as 别名]
# 或者: from keras.activations import serialize [as 别名]
def get_config(self):
config = {
'rank': self.rank,
'filters': self.filters,
'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),
'use_bias': self.use_bias,
'normalize_weight': self.normalize_weight,
'kernel_initializer': sanitizedInitSer(self.kernel_initializer),
'bias_initializer': sanitizedInitSer(self.bias_initializer),
'gamma_diag_initializer': sanitizedInitSer(self.gamma_diag_initializer),
'gamma_off_initializer': sanitizedInitSer(self.gamma_off_initializer),
'kernel_regularizer': regularizers.serialize(self.kernel_regularizer),
'bias_regularizer': regularizers.serialize(self.bias_regularizer),
'gamma_diag_regularizer': regularizers.serialize(self.gamma_diag_regularizer),
'gamma_off_regularizer': regularizers.serialize(self.gamma_off_regularizer),
'activity_regularizer': regularizers.serialize(self.activity_regularizer),
'kernel_constraint': constraints.serialize(self.kernel_constraint),
'bias_constraint': constraints.serialize(self.bias_constraint),
'gamma_diag_constraint': constraints.serialize(self.gamma_diag_constraint),
'gamma_off_constraint': constraints.serialize(self.gamma_off_constraint),
'init_criterion': self.init_criterion,
'spectral_parametrization': self.spectral_parametrization,
}
base_config = super(ComplexConv, self).get_config()
return dict(list(base_config.items()) + list(config.items()))