我们从Python开源项目中,提取了以下23个代码示例,用于说明如何使用keras.constraints.serialize()。
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()))
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()))
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(MultiplicativeLSTM, self).get_config() return dict(list(base_config.items()) + list(config.items()))
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()))
def get_config(self): config = { 'alpha_pos_initializer': initializers.serialize(self.alpha_pos_initializer), 'alpha_neg_initializer': initializers.serialize(self.alpha_neg_initializer), 'beta_pos_initializer': initializers.serialize(self.beta_pos_initializer), 'beta_neg_initializer': initializers.serialize(self.beta_neg_initializer), 'rho_pos_initializer': initializers.serialize(self.rho_pos_initializer), 'rho_neg_initializer': initializers.serialize(self.rho_neg_initializer), 'alpha_pos_constraint': constraints.serialize(self.alpha_pos_constraint), 'alpha_neg_constraint': constraints.serialize(self.alpha_neg_constraint), 'beta_pos_constraint': constraints.serialize(self.beta_pos_constraint), 'beta_neg_constraint': constraints.serialize(self.beta_neg_constraint), 'rho_pos_constraint': constraints.serialize(self.rho_pos_constraint), 'rho_neg_constraint': constraints.serialize(self.rho_neg_constraint), 'alpha_pos_regularizer': regularizers.serialize(self.alpha_pos_regularizer), 'alpha_neg_regularizer': regularizers.serialize(self.alpha_neg_regularizer), 'beta_pos_regularizer': regularizers.serialize(self.beta_pos_regularizer), 'beta_neg_regularizer': regularizers.serialize(self.beta_neg_regularizer), 'rho_pos_regularizer': regularizers.serialize(self.rho_pos_regularizer), 'rho_neg_regularizer': regularizers.serialize(self.rho_neg_regularizer), } base_config = super(PowerPReLU, self).get_config() return dict(list(base_config.items()) + list(config.items()))
def get_config(self): config = { 'a_initializer': initializers.serialize(self.a_initializer), 'a_regularizer': regularizers.serialize(self.a_regularizer), 'a_constraint': constraints.serialize(self.a_constraint), 'k_initializer': initializers.serialize(self.k_initializer), 'k_regularizer': regularizers.serialize(self.k_regularizer), 'k_constraint': constraints.serialize(self.k_constraint), 'n_initializer': initializers.serialize(self.n_initializer), 'n_regularizer': regularizers.serialize(self.n_regularizer), 'n_constraint': constraints.serialize(self.n_constraint), 'z_initializer': initializers.serialize(self.z_initializer), 'z_regularizer': regularizers.serialize(self.z_regularizer), 'z_constraint': constraints.serialize(self.z_constraint), 'shared_axes': self.shared_axes } base_config = super(Hill, self).get_config() return dict(list(base_config.items()) + list(config.items()))
def get_config(self): config = { 'filters': self.filters, 'sum_axes': self.sum_axes, 'filter_axes': self.filter_axes, 'activation': activations.serialize(self.activation), 'kernel_activation': activations.serialize(self.kernel_activation), 'use_bias': self.use_bias, 'kernel_initializer': initializers.serialize(self.kernel_initializer), 'bias_initializer': initializers.serialize(self.kernel_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(FilterDims, self).get_config() return dict(list(base_config.items()) + list(config.items()))
def get_config(self): config = { 'filters_simple': self.filters_simple, 'filters_complex': self.filters_complex, 'sum_axes': self.sum_axes, 'filter_axes': self.filter_axes, 'activation': activations.serialize(self.activation), 'kernel_activation': activations.serialize(self.kernel_activation), 'use_bias': self.use_bias, 'kernel_initializer': initializers.serialize(self.kernel_initializer), 'bias_initializer': initializers.serialize(self.kernel_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(FilterDimsV1, self).get_config() return dict(list(base_config.items()) + list(config.items()))
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()))
def get_config(self): config = { '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), '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) } base_config = super(ExtendedRNNCell, self).get_config() config.update(base_config) return config
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()))
def get_config(self): config = { 'ratio': self.ratio, 'data_format': self.data_format, '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(SE, self).get_config() return dict(list(base_config.items()) + list(config.items()))
def get_config(self): config = { 'kernel_initializer': initializers.serialize(self.kernel_initializer), 'kernel_regularizer': regularizers.serialize(self.kernel_regularizer), 'kernel_constraint': constraints.serialize(self.kernel_constraint), 'bias_initializer': initializers.serialize(self.bias_initializer), 'bias_regularizer': regularizers.serialize(self.bias_regularizer), 'bias_constraint': constraints.serialize(self.bias_constraint), 'context_initializer': initializers.serialize(self.context_initializer), 'context_regularizer': regularizers.serialize(self.context_regularizer), 'context_constraint': constraints.serialize(self.context_constraint) } base_config = super(AttentionLayer, self).get_config() return dict(list(base_config.items()) + list(config.items()))
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
def get_config(self): config = { 'alpha_initializer': initializers.serialize(self.alpha_initializer), 'alpha_regularizer': regularizers.serialize(self.alpha_regularizer), 'alpha_constraint': constraints.serialize(self.alpha_constraint), 'beta_initializer': initializers.serialize(self.beta_initializer), 'beta_regularizer': regularizers.serialize(self.beta_regularizer), 'beta_constraint': constraints.serialize(self.beta_constraint), 'shared_axes': self.shared_axes } base_config = super(ParametricSoftplus, self).get_config() return dict(list(base_config.items()) + list(config.items()))
def get_config(self): config = { 'units': self.units, '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) } base_config = super(WeightedMean, self).get_config() return dict(list(base_config.items()) + list(config.items()))
def get_config(self): config = {'init': initializers.serialize(self.init), 'activation': activations.serialize(self.activation), 'W_regularizer': regularizers.serialize(self.W_regularizer), 'b_regularizer': regularizers.serialize(self.b_regularizer), 'activity_regularizer': regularizers.serialize(self.activity_regularizer), 'W_constraint': constraints.serialize(self.W_constraint), 'b_constraint': constraints.serialize(self.b_constraint), 'bias': self.bias, 'input_dim': self.input_dim} base_config = super(Highway, self).get_config() return dict(list(base_config.items()) + list(config.items()))
def get_config(self): config = { 'init': initializers.serialize(self.init), 'U_regularizer': regularizers.serialize(self.U_regularizer), 'b_start_regularizer': regularizers.serialize(self.b_start_regularizer), 'b_end_regularizer': regularizers.serialize(self.b_end_regularizer), 'U_constraint': constraints.serialize(self.U_constraint), 'b_start_constraint': constraints.serialize(self.b_start_constraint), 'b_end_constraint': constraints.serialize(self.b_end_constraint) } base_config = super(ChainCRF, self).get_config() return dict(list(base_config.items()) + list(config.items()))
def get_config(self): config = {'W_regularizer': regularizers.serialize(self.W_regularizer), 'u_regularizer': regularizers.serialize(self.u_regularizer), 'b_regularizer': regularizers.serialize(self.b_regularizer), 'W_constraint': constraints.serialize(self.W_constraint), 'u_constraint': constraints.serialize(self.u_constraint), 'b_constraint': constraints.serialize(self.b_constraint), 'W_dropout': self.W_dropout, 'u_dropout': self.u_dropout, 'bias': self.bias} base_config = super(AttentionWithContext, self).get_config() return dict(list(base_config.items()) + list(config.items()))